How about just changing the widget on the deleteable objects to a checkbox widget that displays the fieldname and the checkbox input?
--Brandon On 2007-04-30 (Mon) at 18:21:21 +0200, Mario Graziosi wrote: > > I'm not quite sure it's a database design problem. > > What I'm trying to do is to display a list of database-based items (e.g. > questions) with a "delete" check-box tied to each item. On post, if the > checkbox is checked, I'll delete the corresponding database item. Thus, > the check-box is not tied to any field in the database: it siply holds > the "id" of the item to be deleted. > > I suppose this is a quite common requirement but I can't find a easy and > polite way of building such form with Django newforms. > > Beside that, I'm not using the Django DB engine but, instead of it, I'm > using SqlAlchemy because it can adapt better to my existing legacy database. > > [EMAIL PROTECTED] wrote: > > I'm quite sure you've messed up the database design. You should have > > two classes: one wich is associated with the form(question, for > > example), one with the checkboxes(for example, answers), connected to > > question via ForeignKey. Each question will have answer_set attribute, > > containing all the answers. > > In template, you can use for-loop against queryset, right? so, you can > > use question.answer_set and loop through it in the template. I am not > > sure about syntax, check the documentation in tutorial. > > > > > > > > > > > > > > -- > Mario Graziosi, mailto:[EMAIL PROTECTED] > FG&A srl (http://www.fgasoftware.com/) > [EMAIL PROTECTED]: The agile PBX (http://www.voiceatwork.eu/) > Tel: 02 9350-4780 interno 101, Fax: 02 9139-0172 > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---