Skip to content

Instantly share code, notes, and snippets.

@specialunderwear
Created April 22, 2019 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save specialunderwear/444b5b6022406d744ab5200c45134c8f to your computer and use it in GitHub Desktop.
Save specialunderwear/444b5b6022406d744ab5200c45134c8f to your computer and use it in GitHub Desktop.
from django.db import models
class ThroughFooBars(models.Model):
foo = models.ForeignKey('ThroughFoo', models.DO_NOTHING)
bar = models.ForeignKey('ThroughBar', models.DO_NOTHING)
order = models.PositiveIntegerField()
class Meta:
managed = False
db_table = 'through_foo_bars'
unique_together = (('foo', 'bar'),)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment