Issue
Is it possible to load data from a (in this case MySQL) table to be used in Django without the need for a model to be present?
I'm working on a site, which, for one aspect makes use of a table of data which has been bought from a third party. The columns of interest are likely to remain stable, however the structure of the table could change with subsequent updates to the data set. The table is also massive (in terms of columns) - so I'm not keen on typing out each field in the model one-by-one. I'd also like to leave the table intact - so coming up with a model which represents the set of columns I am interested in is not really an ideal solution.
Ideally, I want to have this table in a database somewhere (possibly separate to the main site database) and access its contents directly using SQL.
Solution
You can always execute raw SQL directly against the database: see the docs.
Answered By - Daniel Roseman
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.