On Wed, Jul 22, 2009 at 3:46 AM, Joshua Russo<josh.r.ru...@gmail.com> wrote: > > I have a complex form that where I generate a grid (for lack of a > better term) of fields for data entry. To simplify the template > context I have a dictionaries within dictionaries so I can just use > FOR loops within FOR loops in the template. > > My problem was that, unless I wrapped my fields in a BoundField, I > would only receive the field's object reference output instead of the > rendered widgets. So I added BoundField to the list of available > objects in forms.py and everything is hums along merrily. > > My question is, am I breaking any Django commandments by opening up > the BoundField (other than not monkey patching)?
Firstly, the "Django Commandments" are really just "being Pythonic". Django is just a python library - we don't try to enforce any style beyond that encouraged by the language itself. Monkeypatching is discouraged because Python generally discourages it, not because Django discourages it. Secondly, it's difficult to give an appraisal of a technique when all you have to go by is a vague description. Your explanation is a bit hard to follow - you talk at length about fields, but don't mention the form that holds those fields. Then you talk about the lengths you have gone to in order to expose BoundField ... but don't appear to acknowledge that if you iterate over the fields in a form, what you get are instances of BoundField. I can appreciate that code can get in the way of understanding a broader idea, but sometimes, a small amount of code brings a lot of clarity. Yours Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---