3 ms·
This doesn't match my experience.
by andybak 3y ago
This doesn't match my experience.
- jgalt212 3y agoso you do your online and offline database operations using the Django ORM?
- andybak 3y agoI'm not sure I understand what you mean by online and offline in this context?
- jgalt212 3y agodo you have CRUD code running on the web app, and offline / batch jobs where both sets of jobs / functions / processes modify the same database that Django wants to ORM and your data scientists and ETL folks don't want to do Django ORM - or ORM at all.
- andybak 3y agoThe original comment was: > The Django ORM is close to useless if your database is not generated by the web app to which I replied > not in my experience I have a legacy database derived from an outside source which is running in production and all my code interacts with it via the Django ORM.
- jgalt212 3y ago> I have a legacy database derived from an outside source which is running in production and all my code interacts with it via the Django ORM. And I'm sure the Django ORM works fine for you if you're only doing read operations and the legacy database schema never migrates.
- andybak 3y agoWe do write to the database and the schema does change. In out case we don't write to the same tables but that's only because data is overwritten nightly for the tables with an external source. Assuming a situation where that wasn't happening, writing data wouldn't be a problem. As for schema changes - you just have to decide who is in charge of the schema. In this case the authoratative source would be outside of Django so you just set those tables to managed=False - the only manual task is to update your models.py when the external schema changes.