One question I'd ask would be why you wouldn't just save the files either 
on disk or even in the database (using the  BLOB datatype) if it absolutely 
had to be in the database... then if you needed to manipulate/display/read 
them at a later date you would just load the files in question. 

If you really need to save the data in the database using a django model, 
take a look at MDID's solution in rooibos.data.models 
<https://github.com/vrchost/rooibos/blob/master/rooibos/data/models.py>, 
especially the Record 
<https://github.com/vrchost/rooibos/blob/3a6baf66a000aa3c2078d67808db75cc24cad3db/rooibos/data/models.py#L135>
 
(which would be a row in the excel spreadsheet) and the Field 
<https://github.com/vrchost/rooibos/blob/3a6baf66a000aa3c2078d67808db75cc24cad3db/rooibos/data/models.py#L505>
 
(which would be a cell) models -- this isn't a copy/paste solution because 
the MDID app is more complicated than you want (it allows arbitrary 
metadata which may or may not be part of an established standard like 
Dublin Core, etc. to be stored as part of a record, and allows each field 
to be listed as an equivalent to another), but this implementation works 
with MySQL, and performance shouldn't be too bad, although if you wanted to 
implement good search capabilities you'll probably need to look at Solr or 
some other indexing solution. 

Good luck!


On Monday, July 2, 2018 at 3:48:46 PM UTC-4, hardik dadhich wrote:
>
> Hello,
> Can anyone tell me how can I make dynamic Django model fields? I mean to 
> say that I want to save excel file data in Django model using MySQL. and 
> excel column can vary. The user can upload 100 column table or he can be 
> upload 1000 column table in the database. so it is possible to add 
> dynamically in db. 
>
> Any help would be appreciated.
> Thanks in advance!
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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/fe124fed-2924-4b5d-b86a-aeca431e0a11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to