2006-05-02 01:31:56 +00:00
|
|
|
"""
|
2006-05-31 18:45:17 +00:00
|
|
|
26. Invalid models
|
|
|
|
|
|
|
|
This example exists purely to point out errors in models.
|
2006-05-02 01:31:56 +00:00
|
|
|
"""
|
|
|
|
|
2010-11-14 23:21:39 +00:00
|
|
|
from django.contrib.contenttypes import generic
|
2006-05-02 01:31:56 +00:00
|
|
|
from django.db import models
|
2008-08-19 14:17:24 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
class FieldErrors(models.Model):
|
|
|
|
charfield = models.CharField()
|
2010-03-12 15:22:05 +00:00
|
|
|
charfield2 = models.CharField(max_length=-1)
|
|
|
|
charfield3 = models.CharField(max_length="bad")
|
2007-05-21 01:29:58 +00:00
|
|
|
decimalfield = models.DecimalField()
|
2010-03-12 15:22:05 +00:00
|
|
|
decimalfield2 = models.DecimalField(max_digits=-1, decimal_places=-1)
|
|
|
|
decimalfield3 = models.DecimalField(max_digits="bad", decimal_places="bad")
|
2010-12-29 01:18:11 +00:00
|
|
|
decimalfield4 = models.DecimalField(max_digits=9, decimal_places=10)
|
|
|
|
decimalfield5 = models.DecimalField(max_digits=10, decimal_places=10)
|
2006-05-02 01:31:56 +00:00
|
|
|
filefield = models.FileField()
|
2007-08-05 05:14:46 +00:00
|
|
|
choices = models.CharField(max_length=10, choices='bad')
|
|
|
|
choices2 = models.CharField(max_length=10, choices=[(1,2,3),(1,2,3)])
|
|
|
|
index = models.CharField(max_length=10, db_index='bad')
|
2007-10-21 21:53:18 +00:00
|
|
|
field_ = models.CharField(max_length=10)
|
2009-04-09 15:09:35 +00:00
|
|
|
nullbool = models.BooleanField(null=True)
|
2006-05-02 01:31:56 +00:00
|
|
|
|
|
|
|
class Target(models.Model):
|
2007-08-05 05:14:46 +00:00
|
|
|
tgt_safe = models.CharField(max_length=10)
|
|
|
|
clash1 = models.CharField(max_length=10)
|
|
|
|
clash2 = models.CharField(max_length=10)
|
2006-05-31 18:45:17 +00:00
|
|
|
|
2007-08-05 05:14:46 +00:00
|
|
|
clash1_set = models.CharField(max_length=10)
|
2006-05-31 18:45:17 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
class Clash1(models.Model):
|
Removed oldforms, validators, and related code:
* Removed `Manipulator`, `AutomaticManipulator`, and related classes.
* Removed oldforms specific bits from model fields:
* Removed `validator_list` and `core` arguments from constructors.
* Removed the methods:
* `get_manipulator_field_names`
* `get_manipulator_field_objs`
* `get_manipulator_fields`
* `get_manipulator_new_data`
* `prepare_field_objs_and_params`
* `get_follow`
* Renamed `flatten_data` method to `value_to_string` for better alignment with its use by the serialization framework, which was the only remaining code using `flatten_data`.
* Removed oldforms methods from `django.db.models.Options` class: `get_followed_related_objects`, `get_data_holders`, `get_follow`, and `has_field_type`.
* Removed oldforms-admin specific options from `django.db.models.fields.related` classes: `num_in_admin`, `min_num_in_admin`, `max_num_in_admin`, `num_extra_on_change`, and `edit_inline`.
* Serialization framework
* `Serializer.get_string_value` now calls the model fields' renamed `value_to_string` methods.
* Removed a special-casing of `models.DateTimeField` in `core.serializers.base.Serializer.get_string_value` that's handled by `django.db.models.fields.DateTimeField.value_to_string`.
* Removed `django.core.validators`:
* Moved `ValidationError` exception to `django.core.exceptions`.
* For the couple places that were using validators, brought over the necessary code to maintain the same functionality.
* Introduced a SlugField form field for validation and to compliment the SlugField model field (refs #8040).
* Removed an oldforms-style model creation hack (refs #2160).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 07:19:44 +00:00
|
|
|
src_safe = models.CharField(max_length=10)
|
2006-05-31 18:45:17 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
foreign = models.ForeignKey(Target)
|
|
|
|
m2m = models.ManyToManyField(Target)
|
|
|
|
|
|
|
|
class Clash2(models.Model):
|
Removed oldforms, validators, and related code:
* Removed `Manipulator`, `AutomaticManipulator`, and related classes.
* Removed oldforms specific bits from model fields:
* Removed `validator_list` and `core` arguments from constructors.
* Removed the methods:
* `get_manipulator_field_names`
* `get_manipulator_field_objs`
* `get_manipulator_fields`
* `get_manipulator_new_data`
* `prepare_field_objs_and_params`
* `get_follow`
* Renamed `flatten_data` method to `value_to_string` for better alignment with its use by the serialization framework, which was the only remaining code using `flatten_data`.
* Removed oldforms methods from `django.db.models.Options` class: `get_followed_related_objects`, `get_data_holders`, `get_follow`, and `has_field_type`.
* Removed oldforms-admin specific options from `django.db.models.fields.related` classes: `num_in_admin`, `min_num_in_admin`, `max_num_in_admin`, `num_extra_on_change`, and `edit_inline`.
* Serialization framework
* `Serializer.get_string_value` now calls the model fields' renamed `value_to_string` methods.
* Removed a special-casing of `models.DateTimeField` in `core.serializers.base.Serializer.get_string_value` that's handled by `django.db.models.fields.DateTimeField.value_to_string`.
* Removed `django.core.validators`:
* Moved `ValidationError` exception to `django.core.exceptions`.
* For the couple places that were using validators, brought over the necessary code to maintain the same functionality.
* Introduced a SlugField form field for validation and to compliment the SlugField model field (refs #8040).
* Removed an oldforms-style model creation hack (refs #2160).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 07:19:44 +00:00
|
|
|
src_safe = models.CharField(max_length=10)
|
2006-05-02 01:31:56 +00:00
|
|
|
|
|
|
|
foreign_1 = models.ForeignKey(Target, related_name='id')
|
|
|
|
foreign_2 = models.ForeignKey(Target, related_name='src_safe')
|
|
|
|
|
|
|
|
m2m_1 = models.ManyToManyField(Target, related_name='id')
|
|
|
|
m2m_2 = models.ManyToManyField(Target, related_name='src_safe')
|
|
|
|
|
|
|
|
class Target2(models.Model):
|
2007-08-05 05:14:46 +00:00
|
|
|
clash3 = models.CharField(max_length=10)
|
2006-05-02 01:31:56 +00:00
|
|
|
foreign_tgt = models.ForeignKey(Target)
|
|
|
|
clashforeign_set = models.ForeignKey(Target)
|
2006-05-31 18:45:17 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
m2m_tgt = models.ManyToManyField(Target)
|
|
|
|
clashm2m_set = models.ManyToManyField(Target)
|
|
|
|
|
|
|
|
class Clash3(models.Model):
|
Removed oldforms, validators, and related code:
* Removed `Manipulator`, `AutomaticManipulator`, and related classes.
* Removed oldforms specific bits from model fields:
* Removed `validator_list` and `core` arguments from constructors.
* Removed the methods:
* `get_manipulator_field_names`
* `get_manipulator_field_objs`
* `get_manipulator_fields`
* `get_manipulator_new_data`
* `prepare_field_objs_and_params`
* `get_follow`
* Renamed `flatten_data` method to `value_to_string` for better alignment with its use by the serialization framework, which was the only remaining code using `flatten_data`.
* Removed oldforms methods from `django.db.models.Options` class: `get_followed_related_objects`, `get_data_holders`, `get_follow`, and `has_field_type`.
* Removed oldforms-admin specific options from `django.db.models.fields.related` classes: `num_in_admin`, `min_num_in_admin`, `max_num_in_admin`, `num_extra_on_change`, and `edit_inline`.
* Serialization framework
* `Serializer.get_string_value` now calls the model fields' renamed `value_to_string` methods.
* Removed a special-casing of `models.DateTimeField` in `core.serializers.base.Serializer.get_string_value` that's handled by `django.db.models.fields.DateTimeField.value_to_string`.
* Removed `django.core.validators`:
* Moved `ValidationError` exception to `django.core.exceptions`.
* For the couple places that were using validators, brought over the necessary code to maintain the same functionality.
* Introduced a SlugField form field for validation and to compliment the SlugField model field (refs #8040).
* Removed an oldforms-style model creation hack (refs #2160).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 07:19:44 +00:00
|
|
|
src_safe = models.CharField(max_length=10)
|
2007-10-21 21:53:18 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
foreign_1 = models.ForeignKey(Target2, related_name='foreign_tgt')
|
|
|
|
foreign_2 = models.ForeignKey(Target2, related_name='m2m_tgt')
|
2006-05-31 18:45:17 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
m2m_1 = models.ManyToManyField(Target2, related_name='foreign_tgt')
|
|
|
|
m2m_2 = models.ManyToManyField(Target2, related_name='m2m_tgt')
|
2006-05-31 18:45:17 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
class ClashForeign(models.Model):
|
|
|
|
foreign = models.ForeignKey(Target2)
|
|
|
|
|
|
|
|
class ClashM2M(models.Model):
|
|
|
|
m2m = models.ManyToManyField(Target2)
|
2006-05-31 18:45:17 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
class SelfClashForeign(models.Model):
|
Removed oldforms, validators, and related code:
* Removed `Manipulator`, `AutomaticManipulator`, and related classes.
* Removed oldforms specific bits from model fields:
* Removed `validator_list` and `core` arguments from constructors.
* Removed the methods:
* `get_manipulator_field_names`
* `get_manipulator_field_objs`
* `get_manipulator_fields`
* `get_manipulator_new_data`
* `prepare_field_objs_and_params`
* `get_follow`
* Renamed `flatten_data` method to `value_to_string` for better alignment with its use by the serialization framework, which was the only remaining code using `flatten_data`.
* Removed oldforms methods from `django.db.models.Options` class: `get_followed_related_objects`, `get_data_holders`, `get_follow`, and `has_field_type`.
* Removed oldforms-admin specific options from `django.db.models.fields.related` classes: `num_in_admin`, `min_num_in_admin`, `max_num_in_admin`, `num_extra_on_change`, and `edit_inline`.
* Serialization framework
* `Serializer.get_string_value` now calls the model fields' renamed `value_to_string` methods.
* Removed a special-casing of `models.DateTimeField` in `core.serializers.base.Serializer.get_string_value` that's handled by `django.db.models.fields.DateTimeField.value_to_string`.
* Removed `django.core.validators`:
* Moved `ValidationError` exception to `django.core.exceptions`.
* For the couple places that were using validators, brought over the necessary code to maintain the same functionality.
* Introduced a SlugField form field for validation and to compliment the SlugField model field (refs #8040).
* Removed an oldforms-style model creation hack (refs #2160).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 07:19:44 +00:00
|
|
|
src_safe = models.CharField(max_length=10)
|
2007-08-05 05:14:46 +00:00
|
|
|
selfclashforeign = models.CharField(max_length=10)
|
2006-05-31 18:45:17 +00:00
|
|
|
|
|
|
|
selfclashforeign_set = models.ForeignKey("SelfClashForeign")
|
2006-05-02 01:31:56 +00:00
|
|
|
foreign_1 = models.ForeignKey("SelfClashForeign", related_name='id')
|
|
|
|
foreign_2 = models.ForeignKey("SelfClashForeign", related_name='src_safe')
|
|
|
|
|
2006-09-07 13:29:56 +00:00
|
|
|
class ValidM2M(models.Model):
|
2007-08-05 05:14:46 +00:00
|
|
|
src_safe = models.CharField(max_length=10)
|
|
|
|
validm2m = models.CharField(max_length=10)
|
2006-09-07 13:29:56 +00:00
|
|
|
|
|
|
|
# M2M fields are symmetrical by default. Symmetrical M2M fields
|
|
|
|
# on self don't require a related accessor, so many potential
|
|
|
|
# clashes are avoided.
|
2010-04-06 12:18:56 +00:00
|
|
|
validm2m_set = models.ManyToManyField("self")
|
2007-10-21 21:53:18 +00:00
|
|
|
|
2010-04-06 12:18:56 +00:00
|
|
|
m2m_1 = models.ManyToManyField("self", related_name='id')
|
|
|
|
m2m_2 = models.ManyToManyField("self", related_name='src_safe')
|
2006-09-07 13:29:56 +00:00
|
|
|
|
|
|
|
m2m_3 = models.ManyToManyField('self')
|
|
|
|
m2m_4 = models.ManyToManyField('self')
|
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
class SelfClashM2M(models.Model):
|
2007-08-05 05:14:46 +00:00
|
|
|
src_safe = models.CharField(max_length=10)
|
|
|
|
selfclashm2m = models.CharField(max_length=10)
|
2006-05-02 01:31:56 +00:00
|
|
|
|
2007-05-21 01:29:58 +00:00
|
|
|
# Non-symmetrical M2M fields _do_ have related accessors, so
|
2006-09-07 13:29:56 +00:00
|
|
|
# there is potential for clashes.
|
2010-04-06 12:18:56 +00:00
|
|
|
selfclashm2m_set = models.ManyToManyField("self", symmetrical=False)
|
2007-05-21 01:29:58 +00:00
|
|
|
|
2010-04-06 12:18:56 +00:00
|
|
|
m2m_1 = models.ManyToManyField("self", related_name='id', symmetrical=False)
|
|
|
|
m2m_2 = models.ManyToManyField("self", related_name='src_safe', symmetrical=False)
|
2006-06-27 15:21:43 +00:00
|
|
|
|
2006-09-07 13:29:56 +00:00
|
|
|
m2m_3 = models.ManyToManyField('self', symmetrical=False)
|
|
|
|
m2m_4 = models.ManyToManyField('self', symmetrical=False)
|
2006-06-27 15:21:43 +00:00
|
|
|
|
2007-03-31 12:02:37 +00:00
|
|
|
class Model(models.Model):
|
|
|
|
"But it's valid to call a model Model."
|
|
|
|
year = models.PositiveIntegerField() #1960
|
2007-08-05 05:14:46 +00:00
|
|
|
make = models.CharField(max_length=10) #Aston Martin
|
|
|
|
name = models.CharField(max_length=10) #DB 4 GT
|
2007-03-31 12:02:37 +00:00
|
|
|
|
|
|
|
class Car(models.Model):
|
2007-08-05 05:14:46 +00:00
|
|
|
colour = models.CharField(max_length=5)
|
2007-03-31 12:02:37 +00:00
|
|
|
model = models.ForeignKey(Model)
|
|
|
|
|
2007-12-02 18:10:07 +00:00
|
|
|
class MissingRelations(models.Model):
|
|
|
|
rel1 = models.ForeignKey("Rel1")
|
|
|
|
rel2 = models.ManyToManyField("Rel2")
|
2008-08-23 16:56:41 +00:00
|
|
|
|
2008-07-29 12:41:08 +00:00
|
|
|
class MissingManualM2MModel(models.Model):
|
|
|
|
name = models.CharField(max_length=5)
|
|
|
|
missing_m2m = models.ManyToManyField(Model, through="MissingM2MModel")
|
2008-08-23 16:56:41 +00:00
|
|
|
|
2008-07-29 12:41:08 +00:00
|
|
|
class Person(models.Model):
|
|
|
|
name = models.CharField(max_length=5)
|
|
|
|
|
|
|
|
class Group(models.Model):
|
|
|
|
name = models.CharField(max_length=5)
|
|
|
|
primary = models.ManyToManyField(Person, through="Membership", related_name="primary")
|
|
|
|
secondary = models.ManyToManyField(Person, through="Membership", related_name="secondary")
|
|
|
|
tertiary = models.ManyToManyField(Person, through="RelationshipDoubleFK", related_name="tertiary")
|
|
|
|
|
|
|
|
class GroupTwo(models.Model):
|
|
|
|
name = models.CharField(max_length=5)
|
|
|
|
primary = models.ManyToManyField(Person, through="Membership")
|
|
|
|
secondary = models.ManyToManyField(Group, through="MembershipMissingFK")
|
|
|
|
|
|
|
|
class Membership(models.Model):
|
|
|
|
person = models.ForeignKey(Person)
|
|
|
|
group = models.ForeignKey(Group)
|
|
|
|
not_default_or_null = models.CharField(max_length=5)
|
|
|
|
|
|
|
|
class MembershipMissingFK(models.Model):
|
|
|
|
person = models.ForeignKey(Person)
|
|
|
|
|
|
|
|
class PersonSelfRefM2M(models.Model):
|
|
|
|
name = models.CharField(max_length=5)
|
|
|
|
friends = models.ManyToManyField('self', through="Relationship")
|
|
|
|
too_many_friends = models.ManyToManyField('self', through="RelationshipTripleFK")
|
|
|
|
|
|
|
|
class PersonSelfRefM2MExplicit(models.Model):
|
|
|
|
name = models.CharField(max_length=5)
|
|
|
|
friends = models.ManyToManyField('self', through="ExplicitRelationship", symmetrical=True)
|
|
|
|
|
|
|
|
class Relationship(models.Model):
|
|
|
|
first = models.ForeignKey(PersonSelfRefM2M, related_name="rel_from_set")
|
|
|
|
second = models.ForeignKey(PersonSelfRefM2M, related_name="rel_to_set")
|
|
|
|
date_added = models.DateTimeField()
|
|
|
|
|
|
|
|
class ExplicitRelationship(models.Model):
|
|
|
|
first = models.ForeignKey(PersonSelfRefM2MExplicit, related_name="rel_from_set")
|
|
|
|
second = models.ForeignKey(PersonSelfRefM2MExplicit, related_name="rel_to_set")
|
|
|
|
date_added = models.DateTimeField()
|
|
|
|
|
|
|
|
class RelationshipTripleFK(models.Model):
|
|
|
|
first = models.ForeignKey(PersonSelfRefM2M, related_name="rel_from_set_2")
|
|
|
|
second = models.ForeignKey(PersonSelfRefM2M, related_name="rel_to_set_2")
|
|
|
|
third = models.ForeignKey(PersonSelfRefM2M, related_name="too_many_by_far")
|
|
|
|
date_added = models.DateTimeField()
|
|
|
|
|
|
|
|
class RelationshipDoubleFK(models.Model):
|
|
|
|
first = models.ForeignKey(Person, related_name="first_related_name")
|
|
|
|
second = models.ForeignKey(Person, related_name="second_related_name")
|
|
|
|
third = models.ForeignKey(Group, related_name="rel_to_set")
|
|
|
|
date_added = models.DateTimeField()
|
2007-12-02 18:10:07 +00:00
|
|
|
|
2008-08-19 14:17:24 +00:00
|
|
|
class AbstractModel(models.Model):
|
|
|
|
name = models.CharField(max_length=10)
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
|
|
|
|
|
|
|
class AbstractRelationModel(models.Model):
|
|
|
|
fk1 = models.ForeignKey('AbstractModel')
|
|
|
|
fk2 = models.ManyToManyField('AbstractModel')
|
2008-08-23 16:56:41 +00:00
|
|
|
|
|
|
|
class UniqueM2M(models.Model):
|
|
|
|
""" Model to test for unique ManyToManyFields, which are invalid. """
|
2010-03-10 15:44:43 +00:00
|
|
|
unique_people = models.ManyToManyField(Person, unique=True)
|
|
|
|
|
|
|
|
class NonUniqueFKTarget1(models.Model):
|
|
|
|
""" Model to test for non-unique FK target in yet-to-be-defined model: expect an error """
|
|
|
|
tgt = models.ForeignKey('FKTarget', to_field='bad')
|
|
|
|
|
|
|
|
class UniqueFKTarget1(models.Model):
|
|
|
|
""" Model to test for unique FK target in yet-to-be-defined model: expect no error """
|
|
|
|
tgt = models.ForeignKey('FKTarget', to_field='good')
|
|
|
|
|
|
|
|
class FKTarget(models.Model):
|
|
|
|
bad = models.IntegerField()
|
|
|
|
good = models.IntegerField(unique=True)
|
|
|
|
|
|
|
|
class NonUniqueFKTarget2(models.Model):
|
|
|
|
""" Model to test for non-unique FK target in previously seen model: expect an error """
|
|
|
|
tgt = models.ForeignKey(FKTarget, to_field='bad')
|
|
|
|
|
|
|
|
class UniqueFKTarget2(models.Model):
|
|
|
|
""" Model to test for unique FK target in previously seen model: expect no error """
|
|
|
|
tgt = models.ForeignKey(FKTarget, to_field='good')
|
2008-08-23 16:56:41 +00:00
|
|
|
|
2010-10-21 21:17:07 +00:00
|
|
|
class NonExistingOrderingWithSingleUnderscore(models.Model):
|
|
|
|
class Meta:
|
|
|
|
ordering = ("does_not_exist",)
|
2009-11-03 14:02:49 +00:00
|
|
|
|
2010-11-09 16:46:42 +00:00
|
|
|
class InvalidSetNull(models.Model):
|
|
|
|
fk = models.ForeignKey('self', on_delete=models.SET_NULL)
|
|
|
|
|
|
|
|
class InvalidSetDefault(models.Model):
|
|
|
|
fk = models.ForeignKey('self', on_delete=models.SET_DEFAULT)
|
|
|
|
|
2010-11-14 23:21:39 +00:00
|
|
|
class Tag(models.Model):
|
|
|
|
name = models.CharField("name", max_length=20)
|
|
|
|
|
|
|
|
class TaggedObject(models.Model):
|
|
|
|
object_id = models.PositiveIntegerField("Object ID")
|
|
|
|
tag = models.ForeignKey(Tag)
|
|
|
|
content_object = generic.GenericForeignKey()
|
|
|
|
|
|
|
|
class UserTaggedObject(models.Model):
|
|
|
|
object_tag = models.ForeignKey(TaggedObject)
|
|
|
|
|
|
|
|
class ArticleAttachment(models.Model):
|
|
|
|
tags = generic.GenericRelation(TaggedObject)
|
|
|
|
user_tags = generic.GenericRelation(UserTaggedObject)
|
2010-11-09 16:46:42 +00:00
|
|
|
|
2010-03-12 15:22:05 +00:00
|
|
|
model_errors = """invalid_models.fielderrors: "charfield": CharFields require a "max_length" attribute that is a positive integer.
|
|
|
|
invalid_models.fielderrors: "charfield2": CharFields require a "max_length" attribute that is a positive integer.
|
|
|
|
invalid_models.fielderrors: "charfield3": CharFields require a "max_length" attribute that is a positive integer.
|
2010-03-13 22:11:48 +00:00
|
|
|
invalid_models.fielderrors: "decimalfield": DecimalFields require a "decimal_places" attribute that is a non-negative integer.
|
2010-03-12 15:22:05 +00:00
|
|
|
invalid_models.fielderrors: "decimalfield": DecimalFields require a "max_digits" attribute that is a positive integer.
|
2010-03-13 22:11:48 +00:00
|
|
|
invalid_models.fielderrors: "decimalfield2": DecimalFields require a "decimal_places" attribute that is a non-negative integer.
|
2010-03-12 15:22:05 +00:00
|
|
|
invalid_models.fielderrors: "decimalfield2": DecimalFields require a "max_digits" attribute that is a positive integer.
|
2010-03-13 22:11:48 +00:00
|
|
|
invalid_models.fielderrors: "decimalfield3": DecimalFields require a "decimal_places" attribute that is a non-negative integer.
|
2010-03-12 15:22:05 +00:00
|
|
|
invalid_models.fielderrors: "decimalfield3": DecimalFields require a "max_digits" attribute that is a positive integer.
|
2010-12-29 01:18:11 +00:00
|
|
|
invalid_models.fielderrors: "decimalfield4": DecimalFields require a "max_digits" attribute value that is greater than the value of the "decimal_places" attribute.
|
|
|
|
invalid_models.fielderrors: "decimalfield5": DecimalFields require a "max_digits" attribute value that is greater than the value of the "decimal_places" attribute.
|
2006-05-02 01:31:56 +00:00
|
|
|
invalid_models.fielderrors: "filefield": FileFields require an "upload_to" attribute.
|
2006-06-07 09:19:43 +00:00
|
|
|
invalid_models.fielderrors: "choices": "choices" should be iterable (e.g., a tuple or list).
|
2006-05-02 01:31:56 +00:00
|
|
|
invalid_models.fielderrors: "choices2": "choices" should be a sequence of two-tuples.
|
|
|
|
invalid_models.fielderrors: "choices2": "choices" should be a sequence of two-tuples.
|
|
|
|
invalid_models.fielderrors: "index": "db_index" should be either None, True or False.
|
2007-10-21 21:53:18 +00:00
|
|
|
invalid_models.fielderrors: "field_": Field names cannot end with underscores, because this would lead to ambiguous queryset filters.
|
2009-04-09 15:09:35 +00:00
|
|
|
invalid_models.fielderrors: "nullbool": BooleanFields do not accept null values. Use a NullBooleanField instead.
|
2006-06-27 15:21:43 +00:00
|
|
|
invalid_models.clash1: Accessor for field 'foreign' clashes with field 'Target.clash1_set'. Add a related_name argument to the definition for 'foreign'.
|
|
|
|
invalid_models.clash1: Accessor for field 'foreign' clashes with related m2m field 'Target.clash1_set'. Add a related_name argument to the definition for 'foreign'.
|
|
|
|
invalid_models.clash1: Reverse query name for field 'foreign' clashes with field 'Target.clash1'. Add a related_name argument to the definition for 'foreign'.
|
|
|
|
invalid_models.clash1: Accessor for m2m field 'm2m' clashes with field 'Target.clash1_set'. Add a related_name argument to the definition for 'm2m'.
|
|
|
|
invalid_models.clash1: Accessor for m2m field 'm2m' clashes with related field 'Target.clash1_set'. Add a related_name argument to the definition for 'm2m'.
|
|
|
|
invalid_models.clash1: Reverse query name for m2m field 'm2m' clashes with field 'Target.clash1'. Add a related_name argument to the definition for 'm2m'.
|
|
|
|
invalid_models.clash2: Accessor for field 'foreign_1' clashes with field 'Target.id'. Add a related_name argument to the definition for 'foreign_1'.
|
|
|
|
invalid_models.clash2: Accessor for field 'foreign_1' clashes with related m2m field 'Target.id'. Add a related_name argument to the definition for 'foreign_1'.
|
|
|
|
invalid_models.clash2: Reverse query name for field 'foreign_1' clashes with field 'Target.id'. Add a related_name argument to the definition for 'foreign_1'.
|
|
|
|
invalid_models.clash2: Reverse query name for field 'foreign_1' clashes with related m2m field 'Target.id'. Add a related_name argument to the definition for 'foreign_1'.
|
|
|
|
invalid_models.clash2: Accessor for field 'foreign_2' clashes with related m2m field 'Target.src_safe'. Add a related_name argument to the definition for 'foreign_2'.
|
|
|
|
invalid_models.clash2: Reverse query name for field 'foreign_2' clashes with related m2m field 'Target.src_safe'. Add a related_name argument to the definition for 'foreign_2'.
|
|
|
|
invalid_models.clash2: Accessor for m2m field 'm2m_1' clashes with field 'Target.id'. Add a related_name argument to the definition for 'm2m_1'.
|
|
|
|
invalid_models.clash2: Accessor for m2m field 'm2m_1' clashes with related field 'Target.id'. Add a related_name argument to the definition for 'm2m_1'.
|
|
|
|
invalid_models.clash2: Reverse query name for m2m field 'm2m_1' clashes with field 'Target.id'. Add a related_name argument to the definition for 'm2m_1'.
|
|
|
|
invalid_models.clash2: Reverse query name for m2m field 'm2m_1' clashes with related field 'Target.id'. Add a related_name argument to the definition for 'm2m_1'.
|
|
|
|
invalid_models.clash2: Accessor for m2m field 'm2m_2' clashes with related field 'Target.src_safe'. Add a related_name argument to the definition for 'm2m_2'.
|
|
|
|
invalid_models.clash2: Reverse query name for m2m field 'm2m_2' clashes with related field 'Target.src_safe'. Add a related_name argument to the definition for 'm2m_2'.
|
|
|
|
invalid_models.clash3: Accessor for field 'foreign_1' clashes with field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'foreign_1'.
|
|
|
|
invalid_models.clash3: Accessor for field 'foreign_1' clashes with related m2m field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'foreign_1'.
|
|
|
|
invalid_models.clash3: Reverse query name for field 'foreign_1' clashes with field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'foreign_1'.
|
|
|
|
invalid_models.clash3: Reverse query name for field 'foreign_1' clashes with related m2m field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'foreign_1'.
|
|
|
|
invalid_models.clash3: Accessor for field 'foreign_2' clashes with m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'foreign_2'.
|
|
|
|
invalid_models.clash3: Accessor for field 'foreign_2' clashes with related m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'foreign_2'.
|
|
|
|
invalid_models.clash3: Reverse query name for field 'foreign_2' clashes with m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'foreign_2'.
|
|
|
|
invalid_models.clash3: Reverse query name for field 'foreign_2' clashes with related m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'foreign_2'.
|
|
|
|
invalid_models.clash3: Accessor for m2m field 'm2m_1' clashes with field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'm2m_1'.
|
|
|
|
invalid_models.clash3: Accessor for m2m field 'm2m_1' clashes with related field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'm2m_1'.
|
|
|
|
invalid_models.clash3: Reverse query name for m2m field 'm2m_1' clashes with field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'm2m_1'.
|
|
|
|
invalid_models.clash3: Reverse query name for m2m field 'm2m_1' clashes with related field 'Target2.foreign_tgt'. Add a related_name argument to the definition for 'm2m_1'.
|
|
|
|
invalid_models.clash3: Accessor for m2m field 'm2m_2' clashes with m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'm2m_2'.
|
|
|
|
invalid_models.clash3: Accessor for m2m field 'm2m_2' clashes with related field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'm2m_2'.
|
|
|
|
invalid_models.clash3: Reverse query name for m2m field 'm2m_2' clashes with m2m field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'm2m_2'.
|
|
|
|
invalid_models.clash3: Reverse query name for m2m field 'm2m_2' clashes with related field 'Target2.m2m_tgt'. Add a related_name argument to the definition for 'm2m_2'.
|
|
|
|
invalid_models.clashforeign: Accessor for field 'foreign' clashes with field 'Target2.clashforeign_set'. Add a related_name argument to the definition for 'foreign'.
|
|
|
|
invalid_models.clashm2m: Accessor for m2m field 'm2m' clashes with m2m field 'Target2.clashm2m_set'. Add a related_name argument to the definition for 'm2m'.
|
|
|
|
invalid_models.target2: Accessor for field 'foreign_tgt' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'foreign_tgt'.
|
|
|
|
invalid_models.target2: Accessor for field 'foreign_tgt' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'foreign_tgt'.
|
|
|
|
invalid_models.target2: Accessor for field 'foreign_tgt' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'foreign_tgt'.
|
|
|
|
invalid_models.target2: Accessor for field 'clashforeign_set' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'clashforeign_set'.
|
|
|
|
invalid_models.target2: Accessor for field 'clashforeign_set' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'clashforeign_set'.
|
|
|
|
invalid_models.target2: Accessor for field 'clashforeign_set' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'clashforeign_set'.
|
|
|
|
invalid_models.target2: Accessor for m2m field 'm2m_tgt' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'm2m_tgt'.
|
|
|
|
invalid_models.target2: Accessor for m2m field 'm2m_tgt' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'm2m_tgt'.
|
|
|
|
invalid_models.target2: Accessor for m2m field 'm2m_tgt' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'm2m_tgt'.
|
|
|
|
invalid_models.target2: Accessor for m2m field 'm2m_tgt' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'm2m_tgt'.
|
|
|
|
invalid_models.target2: Accessor for m2m field 'm2m_tgt' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'm2m_tgt'.
|
|
|
|
invalid_models.target2: Accessor for m2m field 'clashm2m_set' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'clashm2m_set'.
|
|
|
|
invalid_models.target2: Accessor for m2m field 'clashm2m_set' clashes with related field 'Target.target2_set'. Add a related_name argument to the definition for 'clashm2m_set'.
|
|
|
|
invalid_models.target2: Accessor for m2m field 'clashm2m_set' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'clashm2m_set'.
|
|
|
|
invalid_models.target2: Accessor for m2m field 'clashm2m_set' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'clashm2m_set'.
|
|
|
|
invalid_models.target2: Accessor for m2m field 'clashm2m_set' clashes with related m2m field 'Target.target2_set'. Add a related_name argument to the definition for 'clashm2m_set'.
|
|
|
|
invalid_models.selfclashforeign: Accessor for field 'selfclashforeign_set' clashes with field 'SelfClashForeign.selfclashforeign_set'. Add a related_name argument to the definition for 'selfclashforeign_set'.
|
|
|
|
invalid_models.selfclashforeign: Reverse query name for field 'selfclashforeign_set' clashes with field 'SelfClashForeign.selfclashforeign'. Add a related_name argument to the definition for 'selfclashforeign_set'.
|
|
|
|
invalid_models.selfclashforeign: Accessor for field 'foreign_1' clashes with field 'SelfClashForeign.id'. Add a related_name argument to the definition for 'foreign_1'.
|
|
|
|
invalid_models.selfclashforeign: Reverse query name for field 'foreign_1' clashes with field 'SelfClashForeign.id'. Add a related_name argument to the definition for 'foreign_1'.
|
|
|
|
invalid_models.selfclashforeign: Accessor for field 'foreign_2' clashes with field 'SelfClashForeign.src_safe'. Add a related_name argument to the definition for 'foreign_2'.
|
|
|
|
invalid_models.selfclashforeign: Reverse query name for field 'foreign_2' clashes with field 'SelfClashForeign.src_safe'. Add a related_name argument to the definition for 'foreign_2'.
|
|
|
|
invalid_models.selfclashm2m: Accessor for m2m field 'selfclashm2m_set' clashes with m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'selfclashm2m_set'.
|
|
|
|
invalid_models.selfclashm2m: Reverse query name for m2m field 'selfclashm2m_set' clashes with field 'SelfClashM2M.selfclashm2m'. Add a related_name argument to the definition for 'selfclashm2m_set'.
|
2006-09-07 13:29:56 +00:00
|
|
|
invalid_models.selfclashm2m: Accessor for m2m field 'selfclashm2m_set' clashes with related m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'selfclashm2m_set'.
|
2006-06-27 15:21:43 +00:00
|
|
|
invalid_models.selfclashm2m: Accessor for m2m field 'm2m_1' clashes with field 'SelfClashM2M.id'. Add a related_name argument to the definition for 'm2m_1'.
|
|
|
|
invalid_models.selfclashm2m: Accessor for m2m field 'm2m_2' clashes with field 'SelfClashM2M.src_safe'. Add a related_name argument to the definition for 'm2m_2'.
|
|
|
|
invalid_models.selfclashm2m: Reverse query name for m2m field 'm2m_1' clashes with field 'SelfClashM2M.id'. Add a related_name argument to the definition for 'm2m_1'.
|
|
|
|
invalid_models.selfclashm2m: Reverse query name for m2m field 'm2m_2' clashes with field 'SelfClashM2M.src_safe'. Add a related_name argument to the definition for 'm2m_2'.
|
2006-09-07 13:29:56 +00:00
|
|
|
invalid_models.selfclashm2m: Accessor for m2m field 'm2m_3' clashes with m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_3'.
|
|
|
|
invalid_models.selfclashm2m: Accessor for m2m field 'm2m_3' clashes with related m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_3'.
|
|
|
|
invalid_models.selfclashm2m: Accessor for m2m field 'm2m_3' clashes with related m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_3'.
|
|
|
|
invalid_models.selfclashm2m: Accessor for m2m field 'm2m_4' clashes with m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_4'.
|
|
|
|
invalid_models.selfclashm2m: Accessor for m2m field 'm2m_4' clashes with related m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_4'.
|
|
|
|
invalid_models.selfclashm2m: Accessor for m2m field 'm2m_4' clashes with related m2m field 'SelfClashM2M.selfclashm2m_set'. Add a related_name argument to the definition for 'm2m_4'.
|
|
|
|
invalid_models.selfclashm2m: Reverse query name for m2m field 'm2m_3' clashes with field 'SelfClashM2M.selfclashm2m'. Add a related_name argument to the definition for 'm2m_3'.
|
|
|
|
invalid_models.selfclashm2m: Reverse query name for m2m field 'm2m_4' clashes with field 'SelfClashM2M.selfclashm2m'. Add a related_name argument to the definition for 'm2m_4'.
|
2008-08-19 14:17:24 +00:00
|
|
|
invalid_models.missingrelations: 'rel1' has a relation with model Rel1, which has either not been installed or is abstract.
|
|
|
|
invalid_models.missingrelations: 'rel2' has an m2m relation with model Rel2, which has either not been installed or is abstract.
|
2010-02-22 14:04:13 +00:00
|
|
|
invalid_models.grouptwo: 'primary' is a manually-defined m2m relation through model Membership, which does not have foreign keys to Person and GroupTwo
|
|
|
|
invalid_models.grouptwo: 'secondary' is a manually-defined m2m relation through model MembershipMissingFK, which does not have foreign keys to Group and GroupTwo
|
2008-07-29 12:41:08 +00:00
|
|
|
invalid_models.missingmanualm2mmodel: 'missing_m2m' specifies an m2m relation through model MissingM2MModel, which has not been installed
|
|
|
|
invalid_models.group: The model Group has two manually-defined m2m relations through the model Membership, which is not permitted. Please consider using an extra field on your intermediary model instead.
|
|
|
|
invalid_models.group: Intermediary model RelationshipDoubleFK has more than one foreign key to Person, which is ambiguous and is not permitted.
|
|
|
|
invalid_models.personselfrefm2m: Many-to-many fields with intermediate tables cannot be symmetrical.
|
|
|
|
invalid_models.personselfrefm2m: Intermediary model RelationshipTripleFK has more than two foreign keys to PersonSelfRefM2M, which is ambiguous and is not permitted.
|
|
|
|
invalid_models.personselfrefm2mexplicit: Many-to-many fields with intermediate tables cannot be symmetrical.
|
2008-08-19 14:17:24 +00:00
|
|
|
invalid_models.abstractrelationmodel: 'fk1' has a relation with model AbstractModel, which has either not been installed or is abstract.
|
|
|
|
invalid_models.abstractrelationmodel: 'fk2' has an m2m relation with model AbstractModel, which has either not been installed or is abstract.
|
2008-08-23 16:56:41 +00:00
|
|
|
invalid_models.uniquem2m: ManyToManyFields cannot be unique. Remove the unique argument on 'unique_people'.
|
2010-03-10 15:44:43 +00:00
|
|
|
invalid_models.nonuniquefktarget1: Field 'bad' under model 'FKTarget' must have a unique=True constraint.
|
|
|
|
invalid_models.nonuniquefktarget2: Field 'bad' under model 'FKTarget' must have a unique=True constraint.
|
2010-10-21 21:17:07 +00:00
|
|
|
invalid_models.nonexistingorderingwithsingleunderscore: "ordering" refers to "does_not_exist", a field that doesn't exist.
|
2010-11-09 16:46:42 +00:00
|
|
|
invalid_models.invalidsetnull: 'fk' specifies on_delete=SET_NULL, but cannot be null.
|
|
|
|
invalid_models.invalidsetdefault: 'fk' specifies on_delete=SET_DEFAULT, but has no default value.
|
2010-11-14 23:21:39 +00:00
|
|
|
invalid_models.articleattachment: Model 'UserTaggedObject' must have a GenericForeignKey in order to create a GenericRelation that points to it.
|
2006-05-02 01:31:56 +00:00
|
|
|
"""
|