post_save signal vs model's save()

2022-02-16 Thread Alan Evangelista
Hi! I have a Django model for a dynamic application whose questions depend on data previously provided by the user. I also have a Django model for each question/answer in this application. There is a front-end that calls the back-end to "auto-save" whenever a question is answered. When the use

Renaming Django model without breaking existing migrations

2021-08-12 Thread Alan Evangelista
I want to rename a model in Django 3.2, keep my existing migrations and be able to both migrate a db with the old table name and create a db from scratch. I've started by renaming the model class and all references to it in the code. As "./manage.py makemigrations" did not automatically create a m

Wrong ordering of many-to-many fields with explicit intermediary model in Django admin

2023-11-01 Thread Alan Evangelista
Hi, all. I have a Submission model with a many-to-many relationship with a Market model and explicitly defined a SubmissionMarket model as intermediary model. I have defined Submission inlines in a ModelAdmin class (used by Django admin) and defined the markets field as the first one in the fie

Postgres failure when trying to remove check constraint

2024-10-04 Thread Alan Evangelista
Hi, everyone. I have the following db model: class Template(models.Model): max_documents = models.PositiveIntegerField(default=1) is_comparison = models.BooleanField(default=False) ... class Meta: constraints = [ models.CheckConstraint( check=mo

Re: Postgres failure when trying to remove check constraint

2024-10-05 Thread Alan Evangelista
constrain and it worked fine. On Fri, Oct 4, 2024, 10:52 Alan Evangelista wrote: > Hi, everyone. > > I have the following db model: > > class Template(models.Model): > max_documents = models.PositiveIntegerField(default=1) > is_comparison = models.Boole