Thursday, July 30, 2015

Re: How to add fields to an existing model dynamically? Also how to modify existing field of a model dynamically?

IMHO (maybe i'm wrong) i think that its not quite good modify your database structure dynamically to often, maybe you must to think a better design of your model.
I'm working on a Health bussiness in Argentina and never need to change the database structure to modify a medical form. (for now)


Now, for your exclusive problem, maybe using south (just like the project you say) you can do the changes to your database dinamically.

Regards!

--
Rafael E. Ferrero

2015-07-30 5:01 GMT-03:00 SriPrad <brs.pradeep@gmail.com>:
Hi,
I am new to Django and Python!.
I am using Django 1.8.3 along with Python 3.2 and using sqlite as the database.
I am trying to setup a site using Django wherein the model is created dynamically( For eg: a Medical form)
The fields of the form are stored in db and the model created dynamically (reference: https://github.com/willhardy/dynamic-models)
The admin guys can modify the fields of this medical form from the admin site. At this time, I would like to modify the model to match the schema modifications done by admin guys.
I understand prior  to Django 1.7, there was django.db.models.loading module that helped in this.

With the current version of Django, how can I add/modify/delete the fields of the dynamic model dynamically?

Your help and suggestions are most welcome.

Regards,
Srinivasa Pradeep

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/6a62db2f-5dd7-417c-9d6b-fbbed6b5a149%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/CAJJc_8VQ6WgvmN5sr%3DFLpge%2B7MujOGqk9TC5%3DSQhRerkkv%2Bgaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment