python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Django add a field to a model based on another model
I have a model for a product:
class Product(models.Model):
name = models.CharField(verbose_name=_("Name"), max_length=120)
slug = AutoSlugField(populate_from="name", verbo...
Nikita Maksimov
Votes: 0
Answers: 1
Django migrations: base data with tests
I am adding some base data to database with Django's database migrations. Base data consists of predefined values of types which are accessible to all users. There is also possibility to create custom...
TCFDS
Votes: 0
Answers: 0
dj-stripe referencing a non-existent migration
I have a django model where I have a OneToOneField to djstripe's Customer. When I run makemigrations a migration is created with the following dependency:
dependencies = [ ('djstripe', '0011_alter_inv...
Bridge
Votes: 0
Answers: 1
Django migrations - how to apply newly applied rules to previously saved model instances?
Let's say I have the following model and I have already some instances of the model saved in the database -
class Comment(models.Model):
comment_text = models.CharField(max_length=255)
Now, if I ...

Farhan M.
Votes: 0
Answers: 1