Generic way to create forms (not admin forms)

32 views
Skip to first unread message

Subodh Nijsure

unread,
Sep 16, 2014, 1:24:13 AM9/16/14
to django...@googlegroups.com
Hi,


In my application I have situation where I would like users to define
elements in a form -- things like buttons, text input fields, radio
buttons etc.

And save those forms as templates, and then at later time instantiate
that user-defined form and save data associated with that form.

( Basically I want to create very slimmed down version of what
applications such as pronto-form, jotform (www.jotform.com) or wufoo
forms. )

I know in general I can define JSON schema that I store that can store
how UI elements are to be stored and parse this UI element and create
HTML elements.

In this case I will store store the JSON in django table , also value
associated with form instance as new forms are instantiated.

I am looking at - http://plugins.jquery.com/dform/ or
http://www.alpacajs.org/ has anyone worked with similar things under
django are there any words of wisdom or other components I should look
at?


-Subodh

Collin Anderson

unread,
Sep 17, 2014, 11:06:48 AM9/17/14
to django...@googlegroups.com
 We store the field structure using JSON and then use that information to construct a django ModelField (so django can render the html and do validation).

If you just want to be able to create HTML form elements (without backend validation), I think storing them as HTML is the way to go, rather than somehow translating them to JSON and back. If needed, you can store extra information using class="" or data-*="".

Mario Gudelj

unread,
Sep 17, 2014, 4:29:31 PM9/17/14
to django...@googlegroups.com

Look at how mezzanine CMS does it. I think Stephen called it form for forms at one stage. It uses standard relational schema for everything.

On 18/09/2014 1:07 am, "Collin Anderson" <cmawe...@gmail.com> wrote:
 We store the field structure using JSON and then use that information to construct a django ModelField (so django can render the html and do validation).

If you just want to be able to create HTML form elements (without backend validation), I think storing them as HTML is the way to go, rather than somehow translating them to JSON and back. If needed, you can store extra information using class="" or data-*="".

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/678735de-3d19-4dfe-a317-7d9305da9691%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages