ScaffoldScript is dead; long live FormGen!

Using this script: http://code.djangoproject.com/wiki/FormGenScript

in this manner: python formGen.py -a MyApp -m Category

will turn this model:

class Category(models.Model):
   category = models.CharField(maxlength=50, unique=True)
   createdOn = models.DateField(auto_now_add=True)
   modifiedOn = models.DateField(auto_now=True)
   test = models.ManyToManyField(auth.User, verbose_name='This is a
test field', related_name='test')
   test2 = models.OneToOneField(auth.User, verbose_name='test2',
related_name='test2')

Into this form:

class CategoryForm(forms.Form):
   category = forms.CharField()
   createdon = forms.DateField()
   modifiedon = forms.DateField()
   test2 = forms.ChoiceField()
   this_is_a_test_field = forms.MultipleChoiceField()


Not the greatest example but you get the idea. I've found it useful
for when I need to tweak a couple of fields (which isn't easy without
defining the whole form).

Enjoy,

Felix

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to