mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Refs #16508 -- Renamed the current "virtual" fields to "private".
The only reason why GenericForeignKey and GenericRelation are stored separately inside _meta is that they need to be cloned for every model subclass, but that's not true for any other virtual field. Actually, it's only true for GenericRelation.
This commit is contained in:
parent
47fbbc33de
commit
c339a5a6f7
14 changed files with 86 additions and 39 deletions
|
@ -64,8 +64,8 @@ class StartsWithRelation(models.ForeignObject):
|
|||
from_opts = self.remote_field.model._meta
|
||||
return [PathInfo(from_opts, to_opts, (to_opts.pk,), self.remote_field, False, False)]
|
||||
|
||||
def contribute_to_class(self, cls, name, virtual_only=False):
|
||||
super(StartsWithRelation, self).contribute_to_class(cls, name, virtual_only)
|
||||
def contribute_to_class(self, cls, name, private_only=False):
|
||||
super(StartsWithRelation, self).contribute_to_class(cls, name, private_only)
|
||||
setattr(cls, self.name, ReverseManyToOneDescriptor(self))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue