diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-03-28 17:15:41 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-03-28 17:15:41 +0200 | 
| commit | dde2a98a71a9fac53c8077bb14ef42b5d5eca3ed (patch) | |
| tree | 8bd4f9867205fab313ed9a936609520bd0f30a64 | |
| parent | 5b0c6cbcae1785926c39f126eecfdf418054ba27 (diff) | |
| download | Ishtar-dde2a98a71a9fac53c8077bb14ef42b5d5eca3ed.tar.bz2 Ishtar-dde2a98a71a9fac53c8077bb14ef42b5d5eca3ed.zip  | |
Not compulsory fields - database (refs #309)
| -rw-r--r-- | ishtar/furnitures/models.py | 23 | ||||
| -rw-r--r-- | ishtar/furnitures/views.py | 1 | 
2 files changed, 13 insertions, 11 deletions
diff --git a/ishtar/furnitures/models.py b/ishtar/furnitures/models.py index 5069df262..212794503 100644 --- a/ishtar/furnitures/models.py +++ b/ishtar/furnitures/models.py @@ -545,10 +545,12 @@ class DatingQuality(GeneralType):  class Dating(models.Model):      period = models.ForeignKey(Period, verbose_name=_(u"Period")) -    start_date = models.IntegerField(_(u"Start date")) -    end_date = models.IntegerField(_(u"End date")) -    dating_type = models.ForeignKey(DatingType, verbose_name=_(u"Dating type")) -    quality = models.ForeignKey(DatingQuality, verbose_name=_(u"Quality")) +    start_date = models.IntegerField(_(u"Start date"), blank=True, null=True) +    end_date = models.IntegerField(_(u"End date"), blank=True, null=True) +    dating_type = models.ForeignKey(DatingType, verbose_name=_(u"Dating type"), +                                    blank=True, null=True) +    quality = models.ForeignKey(DatingQuality, verbose_name=_(u"Quality"), +                                blank=True, null=True)      class Meta:          verbose_name = _(u"Dating") @@ -557,7 +559,7 @@ class Dating(models.Model):      def __unicode__(self):          return u"%s (%d-%d)" % (self.period, self.start_date, self.end_date) -class Unit(GeneralType) : +class Unit(GeneralType):      order = models.IntegerField(_(u"Order"))      parent = models.ForeignKey("Unit", verbose_name=_(u"Parent unit"),                                 blank=True, null=True) @@ -576,15 +578,16 @@ class ContextRecord(BaseHistorizedItem, OwnPerms):                                 related_name='context_record')      label = models.CharField(_(u"Label"), max_length=200)      description = models.TextField(_("Description"), blank=True, null=True) -    lenght = models.IntegerField(_(u"Lenght")) -    width = models.IntegerField(_(u"Width")) -    thickness = models.IntegerField(_(u"Thickness")) -    depth = models.IntegerField(_(u"Depth")) +    length = models.IntegerField(_(u"Length"), blank=True, null=True) +    width = models.IntegerField(_(u"Width"), blank=True, null=True) +    thickness = models.IntegerField(_(u"Thickness"), blank=True, null=True) +    depth = models.IntegerField(_(u"Depth"), blank=True, null=True)      location = models.CharField(_(u"Location"), blank=True, null=True,       max_length=200,       help_text=_(u"A short description of the location of the context record"))      datings = models.ManyToManyField(Dating) -    units = models.ManyToManyField(Unit) +    unit = models.ForeignKey(Unit, verbose_name=_(u"Unit"), related_name='+', +                             blank=True, null=True)      has_furniture = models.NullBooleanField(u"Has furniture?", blank=True,                                              null=True)      filling = models.TextField(_(u"Filling"), blank=True, null=True) diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py index 1af2e3991..d1c5dfe52 100644 --- a/ishtar/furnitures/views.py +++ b/ishtar/furnitures/views.py @@ -425,7 +425,6 @@ def new_item(model):                  if '_select_' in dct['parent_pk']:                      parents = dct['parent_pk'].split('_')                      dct['parent_pk'] = "_".join([parents[0]] + parents[2:]) -                print dct                  return render_to_response('window.html', dct,                                    context_instance=RequestContext(request))          else:  | 
