Skip to content

Instantly share code, notes, and snippets.

@xpostudio4
Created April 14, 2015 21:56
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 xpostudio4/2e652375abffc55901bf to your computer and use it in GitHub Desktop.
Save xpostudio4/2e652375abffc55901bf to your computer and use it in GitHub Desktop.
class MyCommonlyUsedModel(models.Model):
class Meta:
managed = False
db_table = 'app_largetable'
f1 = models.Field(...)
f2 = models.Field(...)
# A model that allows the migrations framework to also manage the table
# Not sure if this actually works, but would allow for a more DRY approach
class MyManagedModel(MyCommonlyUsedModel):
class Meta:
managed = True
tb_table = 'app_largetable'
deferred_f3 = models.Field(...)
deferred_f4 = models.Field(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment