Changes between Version 14 and Version 15 of DynamicModels
- Timestamp:
- Jun 28, 2008, 4:34:48 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DynamicModels
v14 v15 114 114 #!python 115 115 >>> fields = { 116 ... 'first_name': models.CharField(max length=255),117 ... 'last_name': models.CharField(max length=255),116 ... 'first_name': models.CharField(max_length=255), 117 ... 'last_name': models.CharField(max_length=255), 118 118 ... '__str__': lambda self: '%s %s' (self.first_name, self.last_name), 119 119 ... } … … 144 144 145 145 class App(models.Model): 146 name = models.CharField(max length=255)147 module = models.CharField(max length=255)146 name = models.CharField(max_length=255) 147 module = models.CharField(max_length=255) 148 148 149 149 def __str__(self): … … 152 152 class Model(models.Model): 153 153 app = models.ForeignKey(App, related_name='models') 154 name = models.CharField(max length=255)154 name = models.CharField(max_length=255) 155 155 156 156 def __str__(self): … … 176 176 class Field(models.Model): 177 177 model = models.ForeignKey(Model, related_name='fields') 178 name = models.CharField(max length=255)179 type = models.CharField(max length=255, validator_list=[is_valid_field])178 name = models.CharField(max_length=255) 179 type = models.CharField(max_length=255, validator_list=[is_valid_field]) 180 180 181 181 def get_django_field(self): … … 192 192 class Setting(models.Model): 193 193 field = models.ForeignKey(Field, related_name='settings') 194 name = models.CharField(max length=255)195 value = models.CharField(max length=255)194 name = models.CharField(max_length=255) 195 value = models.CharField(max_length=255) 196 196 197 197 class Meta: