Category "django-models"

django manytomany - get value from through

I have a manytomany field between 2 models: class userProfile(models.Model): boughtCoupons = models.ManyToManyField(Coupon, through='UserCoupons') class U

How to make a query on related_name field?

I have to models connected by a ForeignKey class User(AbstractUser): ... and class PrivateMessage(models.Model): user_from = models.ForeignKey(

Create several instances out of a related model in Django

In university as a part of a project we have to develop a liga system with Django. I have my basic app running and also my models are already set up. from djang

How to get the objects from child model to a django template?

I have created child ('Bid') model related to a parent(Post) model in my Django project. I also created a BidForm which I have added in my B_Bid.view so that ty

Can I make a django model object immutable?

There are places in my code where I want to temporarily change some of the attributes on a model object without changing the data in the database. Obviously Dja

Django Rest framework, how to include '__all__' fields and a related field in ModelSerializer ?

I have two models, one with M2M relation and a related name. I want to include all fields in the serializer and the related field. models.py: class Pizza(mode