http://code.djangoproject.com/browser/django/trunk/tests/ regressiontests/forms/tests.py#L3055
It turns out that this would be a *considerably* more useful function if I could select which attributes would get prefixed. For most CSS work, one would not want the name to be unique; for most script work, one does want the id to be unique. Right now, both attributes get nailed, which makes them far less useful in distinguishing things 2- dimensionally (by row and by field group). On 07-Jun-11, at 3:21 PM, Malcolm Tredinnick wrote: > > On Mon, 2007-06-11 at 15:10 -0700, David Priest wrote: >> D-oh! Look at this, a recent (?) dev version handles this for me: >> >> self.subforms.append( SimpleItemForm(item, prefix='line_%s' % >> n) ) >> >> This prefixes the IDs for each form field with line_N. (Oddly, it >> then uses a hyphen to separate my prefix. I had expected an >> underscore.) The names come out as line_1-FieldName. >> >> It's then child's play to tell which datum belong to which >> field. :) Happy, happy! > > At the risk of asking a silly question, where did you find that code? > There is no line like that in either trunk or newforms-admin. You > may be > relying on something that isn't in the standard distribution here. > > There will be similar functionality in newforms-admin (and eventually > trunk), but it's not fully implemented yet. > > Regards, > Malcolm > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---