Created
October 9, 2015 16:32
-
-
Save dusan87/176138450f69d268d1cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Design General model according example that is given. | |
The idea is to have item and characteristic models. | |
Where we can store characteristics such a RAM: 4gb and add to an Item. | |
""" | |
from django.db import models | |
class Characteristic(models.Model): | |
attribute = models.CharField("key", max_length=255) | |
value = models.CharField(max_lenght=255) | |
class Item(models.Model): | |
product = models.CharField(max_length=255) | |
characteristics = models.ManyToManyField('Characteristic') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment