I have Listing and CustomUser models that are in many-to-many relation ship. I don’t have explicit model for the join table.
users/models.py:
class CustomUser(AbstractUser):
listings/models.py:
from django.db import models
from users.models import CustomUser
class Listings(models.Model):
bookmarks = models.ManyToManyField(CustomUser, related_name="bookmarked_listings", blank=True)
I want the table name to be listing_bookmarks and the name of the relation from CustomUser side to be bookmarked_listings. How do I define a table name and different reverse relation name for ManyToManyField?
I don’t think that setting related_name for table name makes sense.