Skip to content

Commit

Permalink
update models
Browse files Browse the repository at this point in the history
  • Loading branch information
gothack329 committed Feb 24, 2018
1 parent 254bed3 commit 8be9a8d
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 0 deletions.
Binary file added article/.models.py.swp
Binary file not shown.
Binary file modified article/__pycache__/admin.cpython-36.pyc
Binary file not shown.
Binary file modified article/__pycache__/adminx.cpython-36.pyc
Binary file not shown.
Binary file modified article/__pycache__/models.cpython-36.pyc
Binary file not shown.
21 changes: 21 additions & 0 deletions article/migrations/0003_article_author_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 2.0.2 on 2018-02-24 02:29

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('article', '0002_article_visible'),
]

operations = [
migrations.AddField(
model_name='article',
name='author_id',
field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions article/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# coding=utf-8
from django.db import models
from tinymce.models import HTMLField
from django.contrib.auth.models import User
#from django.conf import settings
#from tagging.fields import TagField
#from tagging.models import Tag

Expand All @@ -10,6 +12,8 @@ class Article(models.Model):
id=models.AutoField(primary_key=True)
#catalog=models.ForeignKey(Catalogs)
author = models.CharField(max_length=128,default='小志')
author_id = models.ForeignKey(User,on_delete=models.CASCADE,default=0)
#author_id = models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE)
publish_date = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=1024)
detail = HTMLField()
Expand Down
Binary file modified db.sqlite3
Binary file not shown.

0 comments on commit 8be9a8d

Please sign in to comment.