News for hackers. Stuff that matters.
Re:Software development topics I've changed my mind on after... by Izkata on Thursday February 06, 2025 @09:11AM (#42962478)
The default test runner creates the test database automatically yes, but you can create Django model objects without touching the database, just use the class like a constructor and don't save it: Person(name="Foo", age=30)
Re:Software development topics I've changed my mind on after... by globular-toast on Thursday February 06, 2025 @09:55AM (#42962931)
OK, now try that with my ridiculously simple TodoList example, e.g. `TodoList(items=["item", "item2"])`. You can't do it! Nor can you construct an empty list then add items to it etc.
Re:Software development topics I've changed my mind on after... by Izkata on Thursday February 06, 2025 @10:36AM (#42963355)
This is how ArrayField works in the postgres-specific fields: https://docs.djangoproject.com/en/5.1/ref/contrib/postgres/f...

Or falling back to a more generic JsonField elsewhere: https://docs.djangoproject.com/en/5.1/ref/models/fields/#jso...

Re:Software development topics I've changed my mind on after... by globular-toast on Thursday February 06, 2025 @02:18PM (#42965545)
Well yeah, but you could have just used a document store at that point. If you start using JSON field you open up the problems with document databases (namely you can't really do many to many). In any case, postgres being awesome is something you get without any ORM!