1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +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:
Adrian Holovaty
2005-12-14 05:02:51 +00:00
parent 55933c86e7
commit d0fabc0499
39 changed files with 338 additions and 331 deletions

View File

@@ -5,21 +5,21 @@ By default, Django adds an ``"id"`` field to each model. But you can override
this behavior by explicitly adding ``primary_key=True`` to a field.
"""
from django.core import meta
from django.db import models
class Employee(meta.Model):
employee_code = meta.CharField(maxlength=10, primary_key=True)
first_name = meta.CharField(maxlength=20)
last_name = meta.CharField(maxlength=20)
class Employee(models.Model):
employee_code = models.CharField(maxlength=10, primary_key=True)
first_name = models.CharField(maxlength=20)
last_name = models.CharField(maxlength=20)
class META:
ordering = ('last_name', 'first_name')
def __repr__(self):
return "%s %s" % (self.first_name, self.last_name)
class Business(meta.Model):
name = meta.CharField(maxlength=20, primary_key=True)
employees = meta.ManyToManyField(Employee)
class Business(models.Model):
name = models.CharField(maxlength=20, primary_key=True)
employees = models.ManyToManyField(Employee)
class META:
verbose_name_plural = 'businesses'
module_name = 'businesses'