开发者

build forms to create database record types

i've been doing some research, but have not found what i am looking for, so thought i would ask in case it does not exist !

what i want is a web-form driven framework within which i can create record types and associated forms for web presentation.

I want those record types to define the database structure so that i can then load information into the structure and perform operations on it.

essentially a self-modifying database, with the front end webforms being driven from the database.

as a simple example, lets say i wanted to create a record type called 'person'.

on the form for this new record type 'person', i would add fields lik开发者_Go百科e 'name', 'age', height', 'weight' etc all from standard field types (integer, char etc).

i would then want the app to create a table with that structure, into which i could add records either through the web form / gui or via some sort of table load from csv etc.

lets say create a record in person with values of 'mark', '44', '190cm' , ' 210kgs'

i would then want to create one or more scenarios (another table type/format).

lets say scenarios like 'diets'

diets would have 'name', 'field','status','effect', 'timeline'

lets say create a record in that diet table with values 'low carb','weight','>180kgs','-10%','8 weeks'

(effecively these are 'rules' which can be applied to the person table)

so i would then want logic to create an output table with the effect of applying that scenario to the records in the person table.

Now, the question is i know its possible to write an app to do this, and create forms, and create a database with tables, but what I want is a dynamic database, driven by forms, with these 'scenarios' that can be defined and applied to the dynamic tables..

so is there a framework or combination of components which could do this ?

if anyone knows the 'Remedy' helpdesk app, you could build forms and business logic in the gui which created tables itself and you could then drive the app from the gui. the gui was stored / driven from the database.

any help welcome !

if anyone knows a combination of tools or frameworks that can do this, I'd be interested in employing them to assist !

regards Mark


I'm not sure of any frameworks to help do stuff like this, but here's the typical document that people are pointed to:

http://code.djangoproject.com/wiki/DynamicModels

Obviously, this makes everything a lot more work. Typically, you create the tables once (python manage.py syncdb) and don't need to worry about more tables being created. However, if you use this approach, syncdb will not work, and you will need to create the tables on your own.

Really, though, this isn't what Django was designed to do, so it's obviously not going to provide you too many shortcuts along the way. A CMS like Drupal might be able to do what you need it to do, as one of the goals of Drupal was to allow users to at runtime create new types easily.

I guess really at this point you should be thinking about what you're trying to do, and seeing if django isn't your hammer that makes everything look like a nail.


What you're looking for is a form builder. A short overview of available packages are here:

https://www.djangopackages.com/grids/g/form-builder/

From that point of view, "django-fobi" (https://pypi.python.org/pypi/django-fobi) is likely what you're looking for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜