Skip to content

Instantly share code, notes, and snippets.

@vladimirmyshkovski
Created October 20, 2018 08:15
Show Gist options
  • Save vladimirmyshkovski/28e46aa7e289dfa007bcaa5c679a1040 to your computer and use it in GitHub Desktop.
Save vladimirmyshkovski/28e46aa7e289dfa007bcaa5c679a1040 to your computer and use it in GitHub Desktop.
class Publisher(CBModel):
class Meta:
abstract = True
doc_type = 'publisher'
id_prefix = 'pub'
bucket = "MAIN_BUCKET"
name = models.CharField(max_length=45, null=True, blank=True)
class Book(CBModel):
class Meta:
abstract = True
doc_type = 'book'
id_prefix = 'bk'
bucket = "MAIN_BUCKET"
name = models.CharField(max_length=45, null=True, blank=True)
pages = models.IntegerField()
publisher = ModelReferenceField(Publisher)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment