mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
gis: Merged revisions 4786-5490 via svnmerge from
http://code.djangoproject.com/svn/django/trunk git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@5492 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -8,7 +8,7 @@ from django.db import models
|
||||
|
||||
class FieldErrors(models.Model):
|
||||
charfield = models.CharField()
|
||||
floatfield = models.FloatField()
|
||||
decimalfield = models.DecimalField()
|
||||
filefield = models.FileField()
|
||||
prepopulate = models.CharField(maxlength=10, prepopulate_from='bad')
|
||||
choices = models.CharField(maxlength=10, choices='bad')
|
||||
@@ -87,19 +87,29 @@ class SelfClashM2M(models.Model):
|
||||
src_safe = models.CharField(maxlength=10)
|
||||
selfclashm2m = models.CharField(maxlength=10)
|
||||
|
||||
# Non-symmetrical M2M fields _do_ have related accessors, so
|
||||
# Non-symmetrical M2M fields _do_ have related accessors, so
|
||||
# there is potential for clashes.
|
||||
selfclashm2m_set = models.ManyToManyField("SelfClashM2M", symmetrical=False)
|
||||
|
||||
|
||||
m2m_1 = models.ManyToManyField("SelfClashM2M", related_name='id', symmetrical=False)
|
||||
m2m_2 = models.ManyToManyField("SelfClashM2M", related_name='src_safe', symmetrical=False)
|
||||
|
||||
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.
|
||||
invalid_models.fielderrors: "decimalfield": DecimalFields require a "decimal_places" attribute.
|
||||
invalid_models.fielderrors: "decimalfield": DecimalFields require a "max_digits" attribute.
|
||||
invalid_models.fielderrors: "filefield": FileFields require an "upload_to" attribute.
|
||||
invalid_models.fielderrors: "prepopulate": prepopulate_from should be a list or tuple.
|
||||
invalid_models.fielderrors: "choices": "choices" should be iterable (e.g., a tuple or list).
|
||||
|
||||
Reference in New Issue
Block a user