Skip to content

Instantly share code, notes, and snippets.

@ronaldgreeff
Created January 28, 2020 11:07
Show Gist options
  • Save ronaldgreeff/96e79944657f36fd8b0f5c3936773354 to your computer and use it in GitHub Desktop.
Save ronaldgreeff/96e79944657f36fd8b0f5c3936773354 to your computer and use it in GitHub Desktop.
class MetaInfo(models.Model):
AVAILABLE_DATATYPES = (('int', 'Integer'),
('floa', 'float'),
('str', 'string'),)
key = models.CharField(max_length=25)
value = models.CharField(max_length=100)
datatype = models.CharField(max_length=4, choices=AVAILABLE_DATATYPES, default='int')
description = models.CharField(max_length=200)
class Meta:
ordering = ['pk',]
def __str__(self):
return "{0}={1}({2})".format(self.key, self.datatype, self.value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment