python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Custom setting model does not apply until server restarted in django
I'm trying custom setting model to change some settings from admin.
class Setting(models.Model):
is_duel_cart_allowed = models.BooleanField(default=True)
free_cancellation_duration = models.Du...
Rajat Jog
Votes: 0
Answers: 0
In Django, how to create a model that stores proposed changes to another model?
I'm using Python 3.9 and Django 3.2. I have the following model
class Coop(models.Model):
objects = CoopManager()
name = models.CharField(max_length=250, null=False)
types = models.ManyTo...
Dave
Votes: 0
Answers: 1
Django How to use Postgresql's INSERT INTO ... WHERE conditional insert functionality?
Postgresql has a nice syntax for conditionally inserting:
INSERT INTO child (name, parent_id)
SELECT :name, :parent_id
WHERE EXISTS (
SELECT 1
FROM parent
WHERE id = :parent_id
AN...
Matthew Moisen
Votes: 0
Answers: 1
Django how to include all columns from one table, but a only subset of columns in a different table, using tbl.only?
I want to join a child table to the parent table, and return all columns from the child table (child.*), but only specific columns from a parent table (parent.foo, parent.bar), using only but not defe...
Matthew Moisen
Votes: 0
Answers: 1