--
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEqej2NDE8gqBEoSym1gA5DLD7Ygjo6MbN66mdwWDQ_Xd0%3DudA%40mail.gmail.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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/58bc0187-4b71-4b37-9a4b-6f5120c65277%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEqej2PaENLbicxC62fAn5_fLYWh8KEC_fxpoOjO%2BDwcAXKDgg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHn91odraETEDbcXyapRy_q6ue6QGkMctoK3XqHkOjXuC%2B0SDg%40mail.gmail.com.
Thanks for all your replies and helpful suggestions. To answer some of your questions -1. Where is the data coming from? - It is textual data in a spec/spreadsheet. The data is a lot of meta data (name and one or more values) for describing attributes of scanned documents. There is what I would call a "base set" of data, which means it is what we can think of now based on a review of a representative set of documents. However, as new documents are imported into the application, there may be other types of metadata with multiple values that will have to be created on the fly (hence the need for the admin forms to add meta date in the future). The import function I need is a one-off function. We need it as we develop the models and test them against various documents. Sometimes it is easier to just delete the database and rebuild it when we are developing the app than to back out certain migrations. So a simple way to populate the metadata for development purposes, and then one time when we go into production is what we are looking for. Currently, we have 24 metadata names, and each one can have one to 20 values.
2. The manage.py loaddata is an appealing option. However, it will take further effort to convert the spreadsheet data to any of the formats for this option. I think a csv file reader is more suitable for our purposes.
3. I will have to think about the validation concepts. These are simple name-value pairs, so it is not clear what I am validating against, unless it is detecting duplicates.
4. I am also looking into a spreadsheet -> csv file > mysql load data as perhaps the easiest way to complete this project. The spreadsheet is easy to create and update the metadata with the least effort, and then it is pretty automatic from the spreadsheet to the database.I am open to other suggestions!
--
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...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciU_Rz84C-rKMeQRjA85FyM_%2B2Tc8hLFT6Zxwf7cwntnCA%40mail.gmail.com.
"If you dump data directly in to models or the database, then you risk dumping in data that hasn't been evaluated by your application which may produce subtle bugs of the worst kind where things work in dev and break in prod because your input channel is different."If this is happening its because you have poor validation on your model clean(s). You should NEVER just rely on a form to check data for you (at least beyond very basic sanitation); that logic properly belongs with the model. We import direct from spreadsheets to models (note - NOT direct to the database) because we make use of such logic.