Hi, > > I have to create an app with django that allows users in front end to > create their own forms with a number variable of fields and a variable > types of field > > User can create many programs with many different fileds. > First, I thought tha 3 tables are good : > - program_form (name / description ...) > - program_fields (field name / form_id / field type ...) > - program_datas (datas written by users / field_id) > > As I don't know django, and I'm also new to python, I cannot see the > "pythonic" way to realize this.
The above 3 tables are a straightforward way to model your "user- defined" forms. Here is a recent blog post that shows you the basics of creating a Django newform whose fields are defined programmatically (i.e. at runtime) rather than at design time: http://guillaume.segu.in/blog/home/116/tip-of-the-day-dynamic-forms-with-django-newforms/ The key is to extend forms.Form with your own Form class, override __init__, and add your dynamic fields to self.fields. -Rajesh D --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---