Procházet zdrojové kódy

removed old fields

Juan Carlos před 4 roky
rodič
revize
23592f6cbf

+ 10 - 13
marktplatz/models.py

@@ -165,21 +165,18 @@ class Product(models.Model):
     contact         = ForeignKey(Contact, null = True,on_delete=models.SET_NULL, help_text="")
 
 
-    title = CharField('Product Title',max_length = 100,null = True, blank=True)
-    country = CountryField(blank=True,multiple=True, help_text="")
-    city = CharField(max_length = 100,null = True, blank=True, help_text="")
-    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="")
-    #cid = IntegerField(null = True,blank=True, help_text="")
-    class_cid = CharField(null = True,max_length = 3, blank=True, help_text="")
+    # 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="")
-
-    photo = CharField(max_length=500, null=True, blank=True, help_text="")
-    videocts = CharField(max_length=500, null=True, blank=True, help_text="")
+    #
+    # photo = CharField(max_length=500, null=True, blank=True, help_text="")
+    # videocts = CharField(max_length=500, null=True, blank=True, help_text="")
     # category = ManyToManyField(Category,  help_text="",null = True, blank=True)
     # credits = ForeignKey(Credit, null = True, blank=True, on_delete=models.SET_NULL, help_text="")
     #interaction = ForeignKey(Interaction, null = True,on_delete = models.SET_NULL, help_text="")

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

@@ -83,9 +83,7 @@
 				<div class="col-sm-6">
 
 
-					<h1 class="titlepro" style="">{{ product.name }}
-					      <small class="text-muted">{% if product.year %} {{ product.year }}, {% endif %}  {% for country in product.country %} {{ country.name }}, {% endfor %} {% if product.city %} {{ product.city }} {% endif %}</small>
-					</h1>
+					<h1 class="titlepro" style="">{{ product.name }}</h1>
 
 					<p class="lead kur">{% if product.claim %}{{ product.claim }}{% endif %}</p>
 

+ 1 - 3
marktplatz/templates/marktplatz/product_detail_card.html

@@ -66,9 +66,7 @@
 
 				<div class="col-sm-6">
 
-					<h2 class="titlepro" style="margin-top: 7px; font-weight: bold">{{ product.name }}
-					      <small class="text-muted">{% if product.year %} {{ product.year }}, {% endif %}  {% for country in product.country %} {{ country.name }}, {% endfor %} {% if product.city %} {{ product.city }} {% endif %}</small>
-					</h2>
+					<h2 class="titlepro" style="margin-top: 7px; font-weight: bold">{{ product.name }} </h2>
 
 					<p class="lead kur"> {{ product.claim }}</p>
 

+ 0 - 19
marktplatz/templates/marktplatz/product_overview.html

@@ -1,6 +1,5 @@
 {% extends "base_generic.html" %}
 {% load tags %}
-{% load countries %}
 {% load static %}
 {% load compress %}
 {% load crispy_forms_tags %}
@@ -24,24 +23,6 @@ $(document).ready(function(){
 
     });
 
-    {% for year in year_list %}
-/*
-    $("[id='{{year}}']").click(function(){
-        $(".card").show();
-        $("button").removeClass("mark");
-
-        $(".card").not(".{{year}}").hide();
-        $("[id='{{year}}']").addClass("mark");
-
-        if($(".card").filter(":visible").length < 1){
-            $("#how").fadeIn(200)
-        } else{
-           $("#how").fadeOut(10)
-        }
-
-    });
-*/
-    {% endfor %}
 
     $(".btn-toggle").click (function(elem){
 

+ 0 - 2
marktplatz/templates/marktplatz/votes_cid.html

@@ -51,7 +51,6 @@ $('form').submit(function () {
              {% endfor %}
         </td>
         <td scope="col"> {% get_avg Product %}</td>
-        <td scope="col"> <input type="text" id="{{ Product.pk }}cid" name="{{ Product.pk }}.cid" placeholder="{{Product.class_cid}}"> </td>
         <td scope="col"> <input type="text" id="{{ Product.pk }}sub" name="{{ Product.pk }}.sub" placeholder="{{Product.sumbitted}}"> </td>
 
     </tr>
@@ -68,4 +67,3 @@ $('form').submit(function () {
     <p>You are not authorized to view this page. </p>
 {% endif %}
     {% endblock %}
-

+ 0 - 9
marktplatz/templatetags/tags.py

@@ -107,15 +107,6 @@ def get_avg(Product):
 
     return votes.aggregate(Avg('vote'))['vote__avg']
 
-@register.simple_tag
-def get_countries(Product_list):
-    countries = {''}
-    for Product in Product_list:
-
-       if not countries.__contains__(Product.country):
-           countries.add(Product.country)
-
-    return countries
 
 @register.simple_tag
 def get_vote_class(Product, user):

+ 2 - 12
marktplatz/views.py

@@ -31,7 +31,7 @@ from django.forms import BaseModelFormSet
 from django.forms import modelformset_factory, inlineformset_factory
 from django.forms.models import model_to_dict
 from django_file_form.uploader import FileFormUploader
-from django_countries import countries
+# from django_countries import countries
 from django.template import Context, Template
 from django.conf import settings
 
@@ -309,19 +309,13 @@ class ProductsView(generic.ListView):
             context = super().get_context_data(**kwargs)
             user =self.request.user
             context['user'] = user
-            used_countries = []
             orts = {}
-            years = {''}
+
             raum_agebote = {}
 
 
             for product in context['wohnprojekt_list']:
 
-                if not years.__contains__(product.year):
-                    years.add(product.year)
-                for country in product.country:
-                    if not used_countries.__contains__(country):
-                        used_countries.append(country)
                 # if not used_orts.__contains__(  product.get_ort_display()  ):
                 if not product.ort in orts:
                     orts[product.ort] = product.get_ort_display()
@@ -331,10 +325,6 @@ class ProductsView(generic.ListView):
                         raum_agebote[raum] = product.raumangebot.choices[raum]
 
 
-
-            years.remove('')
-            context['year_list'] = years
-            context['count_list'] = used_countries
             context['frei_list'] = Product.FREI
             context['frei_list'][0] =  ('JAJA', 'Wohnung frei')
             context['status_list'] = Product.STATUS