Hacker News new | ask | show | jobs
by Alex3917 2853 days ago
Yeah anyone who did this in a codebase I manage would be on their way to looking for a new job. Trying to save a couple lines of code by relying on undocumented private API functions is seriously not acceptable, especially when there are multiple other ways of doing this.

Good blog post though.

1 comments

This is not about "trying to save a couple lines of code" at all. Sometimes you want to gives the customer the ability to customize the app however they want and sometimes this is needed in order to do that. E.g. custom profile fields, building custom forms themselves (like Google Forms), etc.
> Sometimes you want to gives the customer the ability to customize the app however they want and sometimes this is needed in order to do that.

What's wrong with using a JSONField with a different Cerberus validator for each client, and then using a Django form (and possibly some custom admin template code) to make it possible for the client to perform CRUD operations in the admin?

I personally would still just build a React front end and do the CRUD operations via REST endpoints, but if you really want to use the Django Admin then that's a much better way to do it than monkey patching the migrations system.