Skip to content

Instantly share code, notes, and snippets.

@eugene-goldberg
Created January 27, 2015 03:28
Show Gist options
  • Save eugene-goldberg/f3159284f513f5a88282 to your computer and use it in GitHub Desktop.
Save eugene-goldberg/f3159284f513f5a88282 to your computer and use it in GitHub Desktop.
models
models:
class Blueprint(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=120)
description = models.TextField()
# workloads = models.ManyToManyField('Workload', db_constraint=False)
# workloads = models.ManyToManyField('self', null=True)
class Meta:
ordering = ["name", ]
class Workload(models.Model):
id = models.AutoField(primary_key=True)
blueprints = models.ManyToManyField('Blueprint', db_constraint=False, null=True, blank=True)
name = models.CharField(max_length=120)
description = models.TextField()
image = models.CharField(max_length=120)
flavor = models.CharField(max_length=120)
class Meta:
ordering = ["name", ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment