mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #2363 -- Improved base class checking in ModelBase metaclass. Thanks to
combined work from phil.h.smith@gmail.com and Chris.Wesseling@cwi.nl. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4881 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -97,6 +97,16 @@ class SelfClashM2M(models.Model):
|
||||
m2m_3 = models.ManyToManyField('self', symmetrical=False)
|
||||
m2m_4 = models.ManyToManyField('self', symmetrical=False)
|
||||
|
||||
class Model(models.Model):
|
||||
"But it's valid to call a model Model."
|
||||
year = models.PositiveIntegerField() #1960
|
||||
make = models.CharField(maxlength=10) #Aston Martin
|
||||
name = models.CharField(maxlength=10) #DB 4 GT
|
||||
|
||||
class Car(models.Model):
|
||||
colour = models.CharField(maxlength=5)
|
||||
model = models.ForeignKey(Model)
|
||||
|
||||
model_errors = """invalid_models.fielderrors: "charfield": CharFields require a "maxlength" attribute.
|
||||
invalid_models.fielderrors: "floatfield": FloatFields require a "decimal_places" attribute.
|
||||
invalid_models.fielderrors: "floatfield": FloatFields require a "max_digits" attribute.
|
||||
|
||||
Reference in New Issue
Block a user