mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
magic-removal: Moved django.core.meta to django.db.models
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1631 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -5,17 +5,17 @@ To define a many-to-one relationship that can have a null foreign key, use
|
||||
``ForeignKey()`` with ``null=True`` .
|
||||
"""
|
||||
|
||||
from django.core import meta
|
||||
from django.db import models
|
||||
|
||||
class Reporter(meta.Model):
|
||||
name = meta.CharField(maxlength=30)
|
||||
class Reporter(models.Model):
|
||||
name = models.CharField(maxlength=30)
|
||||
|
||||
def __repr__(self):
|
||||
return self.name
|
||||
|
||||
class Article(meta.Model):
|
||||
headline = meta.CharField(maxlength=100)
|
||||
reporter = meta.ForeignKey(Reporter, null=True)
|
||||
class Article(models.Model):
|
||||
headline = models.CharField(maxlength=100)
|
||||
reporter = models.ForeignKey(Reporter, null=True)
|
||||
|
||||
def __repr__(self):
|
||||
return self.headline
|
||||
|
||||
Reference in New Issue
Block a user