mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Followed style guide for model attribute ordering.
This commit is contained in:
parent
dd8ed64113
commit
e817ae74da
27 changed files with 148 additions and 135 deletions
|
@ -23,13 +23,13 @@ class Author(models.Model):
|
|||
first_name = models.CharField(max_length=30, db_column='firstname')
|
||||
last_name = models.CharField(max_length=30, db_column='last')
|
||||
|
||||
def __str__(self):
|
||||
return '%s %s' % (self.first_name, self.last_name)
|
||||
|
||||
class Meta:
|
||||
db_table = 'my_author_table'
|
||||
ordering = ('last_name', 'first_name')
|
||||
|
||||
def __str__(self):
|
||||
return '%s %s' % (self.first_name, self.last_name)
|
||||
|
||||
|
||||
class Article(models.Model):
|
||||
Article_ID = models.AutoField(primary_key=True, db_column='Article ID')
|
||||
|
@ -43,8 +43,8 @@ class Article(models.Model):
|
|||
null=True,
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return self.headline
|
||||
|
||||
class Meta:
|
||||
ordering = ('headline',)
|
||||
|
||||
def __str__(self):
|
||||
return self.headline
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue