I think we use a similar idea for serializing and communicating between 
distributed systems.  On our rest serializes, we set a property called 
lookup_fields. However, if it was standard to use a metadata property from 
the model, it might allow for some third party libraries to standardize.

On Sunday, December 21, 2014 9:31:22 AM UTC-5, Torsten Bronger wrote:
>
> Hallöchen! 
>
> Brian Faherty writes: 
>
> > [...] 
> > 
> > The solution I propose is a meta field on the model that allows 
> > you to set natural keys there. 
>
> FWIW, we currently have attached to our models 
>
>     class MyMeta: 
>         identifying_field = "number" 
>
> as a means to set something like "poor man's primary key".  Thus, I 
> think we would benefit from such a setting.  (By the way, we did use 
> natural keys first -- but it was slower, didn't allow for 
> introspection, and resulted in uglier code.)  I could explain our 
> use case if asked for. 
>
> Django discourages to set explicit primary keys.  In case of MT 
> inheritance, it didn't even work for us (maybe we were too stupid). 
> There is nothing wrong with that.  But then, it would be helpful to 
> have this poor man's PK instead. 
>
> Tschö, 
> Torsten. 
>
> -- 
> Torsten Bronger    Jabber ID: torsten...@jabber.rwth-aachen.de 
> <javascript:> 
>                                   or http://bronger-jmp.appspot.com 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/fd678911-70e8-41be-b5d8-925c6992f551%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to