Questions & Answers

15
votes
1
answers
701
views

What's the best practice for Django model inheritance: Abstract vs Multi-table?

I'm working on a Django project and encountering an issue with Django models. Here's my current implementation: # models.py # views.py from django.shortcuts import render from .models import Article def …
abaditaye Newbie asked 1 week, 4 days ago
27
votes
2
answers
78
views

What's the difference between Django signals and overriding model save() method?

I'm working on a Django project and encountering an issue with Django views. Here's my current implementation: # models.py # views.py from django.shortcuts import render from .models import Article def …
abaditaye Newbie asked 1 week, 4 days ago
3
votes
2
answers
749
views

How do I properly use select_related() and prefetch_related() in Django?

I'm working on a Django project and encountering an issue with Django REST API. Here's my current implementation: # models.py class Article(models.Model): title = models.CharField(max_length=200) author = models.ForeignKey(User, on_delete=models.CASCADE) def …
abadi Bronze asked 1 week, 4 days ago