Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debugging Django error correction progress
- Loading branch information
Showing
265 changed files
with
23 additions
and
37,485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
from django.contrib import admin | ||
from blog.models import Category, Post | ||
|
||
# Register your models here. | ||
admin.site.register(Category) | ||
admin.site.register(Post) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,3 @@ | ||
from django.db import models | ||
from django.urls import reverse | ||
|
||
# Create your models here. | ||
# 글의 분류(일상, 유머, 정보) | ||
|
||
|
||
class Category(models.Model): | ||
# 분류 : 최대길이 50자 | ||
name = models.CharField(max_length=50, help_text="분류를 입력하세요.") | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
# 블로그 글(제목, 작성일, 대표이미지, 내용, 분류) | ||
|
||
|
||
class Post(models.Model): | ||
# 글 제목 : 최대길이 200자 | ||
title = models.CharField(max_length=200) | ||
# 대표 이미지 : 비어있어도 됨 | ||
title_image = models.ImageField(blank=True) | ||
# 글 내용 : 내용의 글자수는 정해지지 않으므로 TextField | ||
content = models.TextField() | ||
# 작성일 : 사용자가 입력하지 않고 현재 날짜를 받아옴 | ||
createDate = models.DateTimeField(auto_now_add=True) | ||
# 수정일 : 사용자가 입력하지 않고 현재 날짜를 받아옴 | ||
updateDate = models.DateTimeField(auto_now_add=True) | ||
# 분류 : 다대다 관계정의 | ||
category = models.ManyToManyField(Category, help_text='분류를 입력하세요.') | ||
|
||
def __str__(self): | ||
return self.title | ||
|
||
# 1번 글의 경우 -> single/1 | ||
|
||
def get_absolute_url(self): | ||
return reverse('single', args=[str(self.id)]) |
Oops, something went wrong.