db.models.ManyToManyField.swappable

ManyToManyField.swappable Controls the migration framework’s reaction if this ManyToManyField is pointing at a swappable model. If it is True - the default - then if the ManyToManyField is pointing at a model which matches the current value of settings.AUTH_USER_MODEL (or another swappable model setting) the relationship will be stored in the migration using a reference to the setting, not to the model directly. You only want to override this to be False if you are sure your model should alw

db.models.ManyToManyField.related_query_name

ManyToManyField.related_query_name Same as ForeignKey.related_query_name.

db.models.ManyToManyField.related_name

ManyToManyField.related_name Same as ForeignKey.related_name.

db.models.ManyToManyField.symmetrical

ManyToManyField.symmetrical Only used in the definition of ManyToManyFields on self. Consider the following model: from django.db import models class Person(models.Model): friends = models.ManyToManyField("self") When Django processes this model, it identifies that it has a ManyToManyField on itself, and as a result, it doesn’t add a person_set attribute to the Person class. Instead, the ManyToManyField is assumed to be symmetrical – that is, if I am your friend, then you are my friend

db.models.ManyToManyField.db_constraint

ManyToManyField.db_constraint Controls whether or not constraints should be created in the database for the foreign keys in the intermediary table. The default is True, and that’s almost certainly what you want; setting this to False can be very bad for data integrity. That said, here are some scenarios where you might want to do this: You have legacy data that is not valid. You’re sharding your database. It is an error to pass both db_constraint and through.

db.models.ManyToManyField.limit_choices_to

ManyToManyField.limit_choices_to Same as ForeignKey.limit_choices_to. limit_choices_to has no effect when used on a ManyToManyField with a custom intermediate table specified using the through parameter.

db.models.ManyToManyField.db_table

ManyToManyField.db_table The name of the table to create for storing the many-to-many data. If this is not provided, Django will assume a default name based upon the names of: the table for the model defining the relationship and the name of the field itself.

db.models.ManyToManyField

class ManyToManyField(othermodel, **options) [source] A many-to-many relationship. Requires a positional argument: the class to which the model is related, which works exactly the same as it does for ForeignKey, including recursive and lazy relationships. Related objects can be added, removed, or created with the field’s RelatedManager.

db.models.Lookup.rhs

rhs The right-hand side - what lhs is being compared against. It can be a plain value, or something that compiles into SQL, typically an F() object or a QuerySet.

db.models.Lookup.process_rhs()

process_rhs(compiler, connection) [source] Behaves the same way as process_lhs(), for the right-hand side.