On 07/06/12 20:14, Alex Gaynor wrote: > > > On Thu, Jun 7, 2012 at 12:17 PM, Andrew Godwin <and...@aeracode.org > <mailto:and...@aeracode.org>> wrote: > > > In particular, I propose: > > - Requiring that all fields expose a method which says how to > reconstruct them. > > Essentially, it returns the positional and keyword arguments you would > have to pass into the constructor to make the field again (as > there's no > way to get them directly). For those familiar with south_field_triple, > it would be a bit like that. > > > This sounds similar to pickling's __getinitargs__, is there anyway we > can reuse some of: > http://docs.python.org/library/pickle.html#object.__getinitargs__
Hmm, it's close, but by not allowing keywords it's going to be very unsightly for something with optional arguments. Additionally, we're going to need to restrict the output from any function like this to values we can serialise as text (basically, repr plus a few custom handlers for things like model instances), and getinitargs doesn't enforce that either. Andrew -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.