28👍
✅
Temporarily comment out foreign keys to break the circular dependency. It looks like you could do this by commenting out Hospital.doctor
. Remove the existing migrations and run makemigrations
to recreate them.
Finally, uncomment the foreign keys, and run makemigrations
again. You should end up with migrations without any circular dependencies.
0👍
Should be useful if you add your Calendar model. However don’t use the inheritance without abstract modal.
class Person(models.Model):
...
class Meta:
abstract = True
- Google Oauth2.0 web application's "Authorized redirect URIs" must end with a public top-level domain (such as .com or .org)?
- UnicodeEncodeError:'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256)
- Passing an object created with SubFactory and LazyAttribute to a RelatedFactory in factory_boy
- Django Inner Join Queryset
- Django Rest Ordering custom
0👍
Like you might have defined them as something below:
new_field = models.ForeignKey(ForeignModel, ...)
Instead do this:
new_field = models.ForeignKey("ForeignModel", ...)
- How to customize django rest auth password reset email content/template
- Using django models across apps?
- How to use Pagination in a Non-Generic View/Viewset?
0👍
- Delete your existing virtual environment and create a new one.
- In your models files, comment out all
ForeignKey
fields. - Run migrations and migrate
- Uncomment the
ForeignKey
fields you commented - Again run migrations and migrate
👤Asif
- How to customize django rest auth password reset email content/template
- Multiple User Types For Auth in Django
Source:stackexchange.com