from django db import models Create your models here class Author mode

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from django.db import models
# Create your models here.
class Author(models.Model):
login = models.CharField(max_length=32)
date_first_mark = models.DateTimeField('date first mark')
class Meta:
ordering = ['date_first_mark']
def __unicode__(self):
return self.login
class Admin:
pass
class mark(models.Model):
title = models.CharField(max_length=32)
content = models.TextField()
author = models.ForeignKey(Author)
review = models.IntegerField()
public = models.BooleanField(False)
date_add = models.DateTimeField('mark add')
def __unicode__(self):
return self.title
class Meta:
ordering = ['date_add']
class Admin:
pass