mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-06-27 22:03:21 +03:00
Add missing docs to LocalizedField.contribute_to_class
This commit is contained in:
parent
093a9d58f2
commit
3fcaece894
@ -91,9 +91,18 @@ class LocalizedField(HStoreField):
|
|||||||
|
|
||||||
super(LocalizedField, self).__init__(*args, **kwargs)
|
super(LocalizedField, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
def contribute_to_class(self, cls, name, **kwargs):
|
def contribute_to_class(self, model, name, **kwargs):
|
||||||
super(LocalizedField, self).contribute_to_class(cls, name, **kwargs)
|
"""Adds this field to the specifed model.
|
||||||
setattr(cls, self.name, self.descriptor_class(self))
|
|
||||||
|
Arguments:
|
||||||
|
cls:
|
||||||
|
The model to add the field to.
|
||||||
|
|
||||||
|
name:
|
||||||
|
The name of the field to add.
|
||||||
|
"""
|
||||||
|
super(LocalizedField, self).contribute_to_class(model, name, **kwargs)
|
||||||
|
setattr(model, self.name, self.descriptor_class(self))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_db_value(cls, value, *_):
|
def from_db_value(cls, value, *_):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user