emencia / django-blog-lotus

A weblog application with Django.
https://django-blog-lotus.readthedocs.io/
MIT License
5 stars 1 forks source link

Implement natural keys #76

Open sveetch opened 6 months ago

sveetch commented 6 months ago

Is your feature request related to a problem? Please describe. There is currently no way to use Natural keys with Lotus object serialization.

It is not a functional issue but it is almost necessary to dump Lotus datas, since its models have many relational fields.

Describe the solution you'd like This is easy as add get_by_natural_key() to managers and get_by_natural_key() to Model, so Django is instructed how it can deserialize/serialize objects using natural keys. Obviously this is only for models that uniqueness constraints.