On Fri, 2006-04-28 at 13:52 +0000, Jason Davies wrote: > > Malcolm Tredinnick wrote: > > On Thu, 2006-04-27 at 09:19 -0700, Jason Davies wrote: [...] > > > How about passing an optional name_prefix parameter to these > > > validators, which would allow them to look up things like > > > all_data[name_prefix + other_field_name]? name_prefix would be > > > something like 'foo.0.' or 'foo.1.' when edit_inline is used. > >[...] > > So I think your solution is exactly the same as the one I suggest above, > > just triggered from a different place. It seems harder to set up the > > calling section (your method) to pass in the optional name parameter, > > too, rather than setting the option on the validator. But maybe I'm > > missing something. > > I'm not sure your solution will work properly, since validators still > need some way of knowing what "position" is in "model.position.field" > when they're called. Currently they are only passed (field_data, > all_data) as parameters. How about passing a field_name parameter too, > then the validator can mess around with stripping dots and so on if > needed?
Yes, that's kind of implicit in my description. Sorry, should have mentioned it. The problem is not just the field we are checking currently, though. It is also the other fields that may be used for auxiliary checks (such as "required if other field empty"). I am trying to get a feel for what people want to do in general, without trying to delve too deep into the implementation yet. In any case, looks like this might have to wait until after magic-removal is merged. Except for you and I, there have been no other responses. People are busy; it can wait. Thanks for your thinking, anyway. It's helpful. Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~----------~----~----~----~------~----~------~--~---