I am curious if a related interface can be used to create user connection requests. I would like to apply this in django-parler , a multilingual application for Django.
For example, when "slug" is a translated field, I would like to have:
MyModel.objects.filter(slug="foo")
for work like:
MyModel.objects.fiter(translations__slug="foo")
under the hood. Is this possible with the relatedField class API, for example?
I noticed that there are several API hooks in the RelatedField
class, such as m2m_reverse_field_name()
, m2m_target_field_name()
, m2m_column_name()
, extra_filters()
etc. which are used in GenericRelation
and django-taggit TaggableManager
, but I have no idea , how it works.
NB Field access to instances is covered in django-parler , and I would like to extend it to ORM requests.
source share