Combines a Shared Model with a Translations Model by taking the Translations Model and setting it onto the Shared Model‘s translations cache.


Returns the cached translation from an instance or None.


Returns a manager for a normal model that is aware of translations and can filter over translated fields on translated models related to this normal model.

class nani.utils.SmartGetFieldByName

Smart version of the standard get_field_by_name() on the options (meta) of Django models that raises a more useful exception when one tries to access translated fields with the wrong manager.

__init__(self, real)
__call__(self, meta, name)
nani.utils.permissive_field_by_name(self, name)

Returns the field from the Shared Model or Translations Model, if it is on either.

Project Versions

Previous topic


Next topic

This Page