hvad.descriptors
¶
-
class
hvad.descriptors.
NULL
¶ A pseudo type used internally to distinguish between
None
and no value given.
BaseDescriptor¶
TranslatedAttribute¶
-
class
hvad.descriptors.
TranslatedAttribute
¶ Standard descriptor for translated fields on the Shared Model.
-
name
¶ The name of this attribute
-
opts
¶ The options (meta) of the model.
-
__get__
(self, instance, instance_type=None)¶ Gets the attribute from the translation object using
BaseDescriptor.translation()
. If no instance is given (used from the model instead of an instance) it returns the default value from the field.
-
__set__
(self, instance, value)¶ Sets the value on the attribute on the translation object using
BaseDescriptor.translation()
if an instance is given, if no instance is given, raises anAttributeError
.
-
__delete__
(self, instance)¶ Deletes the attribute on the translation object using
BaseDescriptor.translation()
if an instance is given, if no instance is given, raises anAttributeError
.
-
LanguageCodeAttribute¶
-
class
hvad.descriptors.
LanguageCodeAttribute
¶ The language code descriptor is different than the other fields, since it’s readonly. The getter is inherited from
TranslatedAttribute
.-
__set__
(self, instance, value)¶ Raises an attribute error.
-
__delete__
(self, instance)¶ Raises an attribute error.
-