mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Renamed Field.rel attribute to remote_field
Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
This commit is contained in:
parent
f9c70bb3a1
commit
8f30556329
62 changed files with 601 additions and 598 deletions
|
@ -178,8 +178,8 @@ class FieldDeconstructionTests(TestCase):
|
|||
# Test basic pointing
|
||||
from django.contrib.auth.models import Permission
|
||||
field = models.ForeignKey("auth.Permission")
|
||||
field.rel.to = Permission
|
||||
field.rel.field_name = "id"
|
||||
field.remote_field.model = Permission
|
||||
field.remote_field.field_name = "id"
|
||||
name, path, args, kwargs = field.deconstruct()
|
||||
self.assertEqual(path, "django.db.models.ForeignKey")
|
||||
self.assertEqual(args, [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue