Просмотр исходного кода

begleitet von realitylab, raumangebote

Juan Carlos 5 лет назад
Родитель
Сommit
4564119776
3 измененных файлов с 14 добавлено и 35 удалено
  1. 1 0
      marktplatz/models.py
  2. 2 34
      marktplatz/templates/marktplatz/product_overview.html
  3. 11 1
      marktplatz/views.py

+ 1 - 0
marktplatz/models.py

@@ -357,6 +357,7 @@ class Wohnprojekt(Product):
     freiraumangebote   = CharField         ( 'Freiraumangebote',  max_length = 64, choices=FREIANGEBOT, help_text="Freiraumangebote", null = True, blank=True )
     gaestwohnungen     = IntegerField      ( 'Anzahl an Gästewohnungen', help_text="Anzahl an Gästewohnungen", validators=[MinValueValidator(0)], default = 0 )
 
+    
 
 
 class Link(models.Model):

+ 2 - 34
marktplatz/templates/marktplatz/product_overview.html

@@ -347,7 +347,6 @@ $(document).ready(function(){
       <button class="border-thin mybtn btn-toggle {{elem.0}}" data-toggler='{{elem.0}}' style="margin-bottom: 2px; ">#{{elem.1}}</button>
       {% endfor %}
 
-      {{  raum_agebote_dict }}
       <button class="border-thin mybtn btn-toggle begleitet_true" data-toggler='begleitet_true' style="margin-bottom: 2px; " style="">#Begleitet von RealityLab</button>
       <button class="border-thin mybtn " style="margin-bottom: 2px; ">{% include "marktplatz/modal-sa.html" %}</button>
 
@@ -410,7 +409,7 @@ $(document).ready(function(){
   {% for product in wohnprojekt_list %}
 
   <!-- rounded-0 border-0 -->
-  <div class="card  {{product.ort}} {{product.status}} {{product.frei}} {{product.altneu}} {% if product.mitmachen %}begleitet_true{% endif %}{% if product.frei == 'JAJA' %} mab-card-container-highlight {% endif %}   ">
+  <div class="card  {{product.ort}} {{product.status}} {{product.frei}} {{product.altneu}} {% for key in product.raumangebot %}{{key}} {% endfor %} {% if product.mitmachen %}begleitet_true{% endif %}{% if product.frei == 'JAJA' %} mab-card-container-highlight {% endif %}   ">
   <div id="product_{{product.pk}}_card" class="flipcard">
     <div class="mab-card-face mab-card-face--front toogle-overflow">
       <!--  -->
@@ -445,42 +444,11 @@ $(document).ready(function(){
             <button id='product_{{product.pk}}_{{product.ort}}' data-toggler='{{product.ort}}' class="border-thin mybtn btn-toggle {{product.ort}}" style="">#{{product.get_ort_display}}</button>
             <button id='product_{{product.pk}}_{{product.altneu}}' data-toggler='{{product.altneu}}' class="border-thin mybtn btn-toggle {{product.altneu}}" style="">#{{product.get_altneu_display}}</button>
 
-            {{  product.raumangebot }}
-            {{  product.raumangebot.get_list }}
-            <p>.............</p>
-            <!--
-            {{  product.get_raumangebot_display }} -->
-            <!-- {{  product.raumangebot.choices }} -->
-
-            <p>0:
-            {{  product.raumangebot.0 }}
-            {{  product.raumangebot.get_display }}
-            {{  product.raumangebot.0.display }}
-            {{  product.raumangebot.0.get_display }}
-            </p>
-            {{  product.get_raumangebot_display }}
-            <p>----</p>
-
-            {% for a  in product.get_raumangebot_display %}
-              {{ a }}
-            {% endfor %}
-
-
-
-            {% for value,text in product.raumangebot.fields %}
-              <strong class="{{ value }}">{{ value }} -- {{ text }}</strong>
-             {% endfor %}
 
-            <<p>***</p>
-
-            {% for key in product.raumangebot %}
-              {{key }} -- {{ key.get_display }}.
-            {% endfor %}
 
-            <p>aaaaaa</p>
 
             {% for key in product.raumangebot %}
-            <button class="border-thin mybtn btn-toggle {{key}}" data-toggler='{{key}}' style="margin-bottom: 2px; ">#{{key}}</button>
+            <button class="border-thin mybtn btn-toggle {{key}}" data-toggler='{{key}}' style="margin-bottom: 2px; ">#{{  product.raumangebot.choices|get_item:key}}</button>
             {% endfor %}
 
             {% for key, value in product.raumangebot.field.choices %}

+ 11 - 1
marktplatz/views.py

@@ -282,6 +282,16 @@ class ProductsView(generic.ListView):
             years = {''}
             for product in context['wohnprojekt_list']:
                 print ( type (product.raumangebot) )
+                print (  repr(product.raumangebot)  )
+                # print (  dir(product.raumangebot)  )
+                print (  "----"  )
+                print (  product.raumangebot.__dict__  )
+                print (  "xxxx"  )
+                dir(MultiSelectField)
+
+                print (  dir(product.raumangebot.choices )  )
+                # print (  product.get_raumangebot_display  )
+
                 # print ( product.raumangebot.max_length )
                 #
                 # print ( product.raumangebot.to_python() )
@@ -301,7 +311,7 @@ class ProductsView(generic.ListView):
                     # print(raum.get_display() )
 
                     if not (raum in raum_agebote):
-                        raum_agebote[raum] = raum
+                        raum_agebote[raum] = product.raumangebot.choices[raum]