blob: 9841b36ce56c4afa257a4b817ef059ba762cbd54 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=20)
age = models.IntegerField(null=True)
birthdate = models.DateField(null=True)
average_rating = models.FloatField(null=True)
def __str__(self):
return self.name
|