mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Simplified Field.contribute_to_class().
This commit is contained in:
committed by
Mariusz Felisiak
parent
98296f86b3
commit
dbe436a9a9
@@ -732,10 +732,7 @@ class Field(RegisterLookupMixin):
|
|||||||
"""
|
"""
|
||||||
self.set_attributes_from_name(name)
|
self.set_attributes_from_name(name)
|
||||||
self.model = cls
|
self.model = cls
|
||||||
if private_only:
|
cls._meta.add_field(self, private=private_only)
|
||||||
cls._meta.add_field(self, private=True)
|
|
||||||
else:
|
|
||||||
cls._meta.add_field(self)
|
|
||||||
if self.column:
|
if self.column:
|
||||||
# Don't override classmethods with the descriptor. This means that
|
# Don't override classmethods with the descriptor. This means that
|
||||||
# if you have a classmethod and a field with the same name, then
|
# if you have a classmethod and a field with the same name, then
|
||||||
|
|||||||
Reference in New Issue
Block a user