Преглед изворни кода

neue Felder: Fläche; Architektur

Juan Carlos пре 4 година
родитељ
комит
854d2859f1
3 измењених фајлова са 11 додато и 9 уклоњено
  1. 4 2
      marktplatz/forms.py
  2. 5 6
      marktplatz/models.py
  3. 2 1
      marktplatz/templates/marktplatz/product_detail.html

+ 4 - 2
marktplatz/forms.py

@@ -300,7 +300,7 @@ class WohnprojektForm(ProductForm):
     class Meta:
         model = Wohnprojekt
         fields = ProductForm.product_fields + (
-         'eigentum', 'inseratstext', 'altneu', 'schwerpunkt', 'wohnbaufoerderung', 'artmodell', 'bautraeger', 'aerwachsene', 'akinder', 'awohnungen', 'wohnflaeche', 'gewerbeflaechen', 'gemeinschaftsflaeche', 'sonstige_flaechen', 'kflaechen', 'gemeinschaftr', 'kgemeinschaftr', 'sonderwohnformen', 'raumangebot', 'kraumangebot', 'parbeiten', 'karbeiten', 'bauweise', 'zielgruppen', 'gprojekte', 'oekologie', 'freiraumangebote', 'gaestwohnungen', 'urbanem',
+         'eigentum', 'inseratstext', 'altneu', 'schwerpunkt', 'wohnbaufoerderung', 'artmodell', 'bautraeger', 'architektur', 'aerwachsene', 'akinder', 'awohnungen', 'wohnflaeche', 'gewerbeflaechen', 'gemeinschaftsflaeche', 'sonstige_flaechen', 'flaeche', 'kflaechen', 'gemeinschaftr', 'kgemeinschaftr', 'sonderwohnformen', 'raumangebot', 'kraumangebot', 'parbeiten', 'karbeiten', 'bauweise', 'zielgruppen', 'gprojekte', 'oekologie', 'freiraumangebote', 'gaestwohnungen', 'urbanem',
          )
 
     def __init__(self,*args, **kwargs):
@@ -338,6 +338,7 @@ class WohnprojektForm(ProductForm):
              'schwerpunkt',
              'wohnbaufoerderung',
              'bautraeger',
+             'architektur',
 
               Div(
                   Div('aerwachsene',  css_class='col-sm-6 col-6'),
@@ -353,7 +354,8 @@ class WohnprojektForm(ProductForm):
                   Div('gemeinschaftsflaeche', css_class='col-sm-3 col-3'),
                   Div('sonstige_flaechen', css_class='col-sm-3 col-3'),
                   css_class='form-row  row'),
-                'kflaechen',
+              'flaeche',
+              'kflaechen',
              ),
               Div(
                 Div('gemeinschaftr',  css_class='col-sm-6 col-6'),

+ 5 - 6
marktplatz/models.py

@@ -168,9 +168,6 @@ class Product(models.Model):
     # title = CharField('Product Title',max_length = 100,null = True, blank=True)
     # year = IntegerField('Year of Completion',null = True, blank=True, help_text="")
     # owner = CharField(max_length = 300,null = True,blank=True, help_text="")
-    # teaser_txt = TextField(blank = True, max_length = 1050, help_text="")
-    # header = CharField(max_length = 900 , help_text="",null = True, blank=True)
-    # description_txt = TextField(max_length = 3000 ,null = True, blank=True, help_text="")
     # class_cid = CharField(null = True,max_length = 3, blank=True, help_text="")
     sumbitted = CharField(null = True,max_length = 10, blank=True, help_text="")
     date_submitted = DateField(auto_now_add=True, help_text="")
@@ -329,6 +326,7 @@ class Wohnprojekt(Product):
     wohnbaufoerderung = CharField    ( 'Wohnbauförderung',    max_length = 256,   choices=WOHNBAUFOERDERUNG, help_text="Wähle aus der Liste aus!", null = True, blank=True )
     artmodell         = TextField    ( 'Art des Modells',    max_length = 2048,   help_text="Klicke ins Feld, wähle aus der Liste aus, was am ehesten zutrifft und bearbeite den Text!", null = True, blank=True )
     bautraeger        = TextField    ( 'Bauträger',    max_length = 1024, help_text="Klicke ins Feld, wähle aus der Liste aus!", null = True, blank=True )
+    architektur       = CharField    ( 'Architektur',    max_length = 1024, help_text="z.B. Entwurf, Planung, Ausführung", null = True, blank=True )
     aerwachsene       = IntegerField ( 'Anzahl an Erwachsenen', help_text="Wenn du keine genauen Zahlen hast, gib eine Schätzung ab.", validators=[MinValueValidator(0), MaxValueValidator(9999)], default = 0, null = True, blank=False )
     akinder           = IntegerField ( 'Anzahl an Kinder', help_text="Wenn du keine genauen Zahlen hast, gib eine Schätzung ab.", validators=[MinValueValidator(0), MaxValueValidator(9999)], default = 0,  null = True, blank=False )
     @property
@@ -339,9 +337,10 @@ class Wohnprojekt(Product):
     gewerbeflaechen        = IntegerField( 'Gewerbeflächen', help_text="in Quadratmetern; wenn du keine Zahlen hast, dann lass das Feld frei.", validators=[MinValueValidator(0)], default = 0, null = True,  )
     gemeinschaftsflaeche   = IntegerField( 'Gemeinschaftsflächen', help_text="in Quadratmetern; wenn du keine Zahlen hast, dann lass das Feld frei.", validators=[MinValueValidator(0)], default = 0, null = True,  )
     sonstige_flaechen      = IntegerField( 'Sonstige Flächen', help_text="in Quadratmetern; wenn du keine Zahlen hast, dann lass das Feld frei.", validators=[MinValueValidator(0)], default = 0, null = True,  )
-    @property
-    def flaeche(self):
-            return self.wohnflaeche + self.gewerbeflaechen + self.gemeinschaftsflaeche + self.sonstige_flaechen
+    flaeche                = IntegerField( 'Gesamte Nutzfläche', help_text="in Quadratmetern; wenn du keine Zahlen hast, dann lass das Feld frei.", validators=[MinValueValidator(0)], default = 0, null = True,  )
+    # @property
+    # def flaeche(self):
+    #         return self.wohnflaeche + self.gewerbeflaechen + self.gemeinschaftsflaeche + self.sonstige_flaechen
     kflaechen          = CharField         ( 'Weitere Flächen', max_length = 2048, help_text="Hier kannst du genauere Angaben machen. Beispiel: Unsere Gewerbefläche besteht aus einem Coworking-Raum.", null = True, blank=True )
     gemeinschaftr      = MultiSelectField  ( 'Gemeinschaftsräume',    max_length = 1024,   choices=GEMEINSCHAFTR, help_text="Mehrfachnennungen sind möglich.", null = True, blank=True )
     kgemeinschaftr     = CharField         ( 'Gemeinschaftsräume - Sonstiges', max_length = 2048, help_text="Gibt es noch andere/weitere Gemeinschaftsräume, die nicht in der Liste stehen?", null = True, blank=True )

+ 2 - 1
marktplatz/templates/marktplatz/product_detail.html

@@ -219,6 +219,7 @@
 
 					<p>{{ product.wohnprojekt.get_altneu_display }}, {{ product.wohnprojekt.bauweise }}</p>
 					<p><strong>Bautr&auml;ger</strong>: {{ product.wohnprojekt.bautraeger }}</p>
+					<p>{% if product.wohnprojekt.architektur  %}<strong>{% field_name product.wohnprojekt 'architektur' %}:</strong>  {{  product.wohnprojekt.architektur  }}{% endif %}</p>
 					<p>{% if product.wohnprojekt.wohnbaufoerderung  %}<strong>{% field_name product.wohnprojekt 'wohnbaufoerderung' %}:</strong>  {{ product.wohnprojekt.wohnbaufoerderung }}{% endif %}</p>
 					<p>im Haus Wohnen ca {{ product.wohnprojekt.aerwachsene }} Erwachsene und {{  product.wohnprojekt.akinder }} Kinder.
 						Anzahl der Mitglieder: {{ product.wohnprojekt.amitglieder }}
@@ -229,7 +230,7 @@
 			    <p>{% if product.wohnprojekt.gewerbeflaechen  %}<strong>{% field_name product.wohnprojekt 'gewerbeflaechen' %}:</strong>  {{ product.wohnprojekt.gewerbeflaechen }} m<sup>2</sup>{% endif %}</p>
 			    <p>{% if product.wohnprojekt.gemeinschaftsflaeche  %}<strong>{% field_name product.wohnprojekt 'gemeinschaftsflaeche' %}:</strong>  {{ product.wohnprojekt.gemeinschaftsflaeche }} m<sup>2</sup>{% endif %}</p>
 			    <p>{% if product.wohnprojekt.sonstige_flaechen  %}<strong>{% field_name product.wohnprojekt 'sonstige_flaechen' %}:</strong>  {{ product.wohnprojekt.sonstige_flaechen }} m<sup>2</sup>{% endif %}</p>
-			    <p>{% if product.wohnprojekt.flaeche  %}<strong>Fläche:</strong>  {{ product.wohnprojekt.flaeche }} m<sup>2</sup>{% endif %}</p>
+			    <p>{% if product.wohnprojekt.flaeche  %}<strong>{% field_name product.wohnprojekt 'flaeche' %}:</strong>  {{ product.wohnprojekt.flaeche }} m<sup>2</sup>{% endif %}</p>
 					<p>{% if product.wohnprojekt.kflaechen  %}<strong>{% field_name product.wohnprojekt 'kflaechen' %}:</strong>  {{ product.wohnprojekt.kflaechen }} m<sup>2</sup>{% endif %}</p>
 					<p>{% if product.wohnprojekt.parbeiten  %}Im Haus arbeiten ca {{ product.wohnprojekt.parbeiten }} Personen.{% endif %}
 						{% if product.wohnprojekt.karbeiten  %}{{ product.wohnprojekt.karbeiten }}{% endif %}</p>