mirror of
https://github.com/django/django.git
synced 2024-12-28 03:55:50 +00:00
e57cd291cc
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14423 bcc190cf-cafb-0310-a4f2-bffc1f526a37
18 lines
402 B
Python
18 lines
402 B
Python
"""
|
|
7. The lookup API
|
|
|
|
This demonstrates features of the database API.
|
|
"""
|
|
|
|
from django.db import models, DEFAULT_DB_ALIAS, connection
|
|
from django.conf import settings
|
|
|
|
class Article(models.Model):
|
|
headline = models.CharField(max_length=100)
|
|
pub_date = models.DateTimeField()
|
|
class Meta:
|
|
ordering = ('-pub_date', 'headline')
|
|
|
|
def __unicode__(self):
|
|
return self.headline
|