Skip to content

Instantly share code, notes, and snippets.

@jMyles
Created February 13, 2015 03:46
Show Gist options
  • Save jMyles/2bdcc288e7fca764e540 to your computer and use it in GitHub Desktop.
Save jMyles/2bdcc288e7fca764e540 to your computer and use it in GitHub Desktop.
class Incident(models.Model):
owner = models.ForeignKey(User)
class IncidentData(models.Model):
key = models.CharField(max_length=255)
value = models.CharField(max_length=255)
incident = models.ForeignKey(Incident)
## Or, if you want to have manager-level control for the IncidentData:
class IncidentDataType(models.Model):
key = models.CharField(max_length=255)
class IncidentData(models.Model):
key = models.ForeignKey(IncidentDataType)
value = models.CharField(max_length=255)
incident = models.ForeignKey(Incident)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment