|
@@ -42,7 +42,7 @@ from newsletter.forms import *
|
|
|
from newsletter.views import *
|
|
from newsletter.views import *
|
|
|
from post_office import mail
|
|
from post_office import mail
|
|
|
|
|
|
|
|
-from marktplatz.models import *
|
|
|
|
|
|
|
+from .models import *
|
|
|
from .forms import *
|
|
from .forms import *
|
|
|
from .utils import *
|
|
from .utils import *
|
|
|
|
|
|
|
@@ -808,7 +808,7 @@ class ErnaehrungsProjektUpdateView(ProductUpdateView):
|
|
|
|
|
|
|
|
class EnergyProjektUpdateView(ProductUpdateView):
|
|
class EnergyProjektUpdateView(ProductUpdateView):
|
|
|
model = EnergyProjekt
|
|
model = EnergyProjekt
|
|
|
- form_class = EnergyForm
|
|
|
|
|
|
|
+ form_class = EnergyForm
|
|
|
|
|
|
|
|
|
|
|
|
|
class addImageView(LoginRequiredMixin, FormView):
|
|
class addImageView(LoginRequiredMixin, FormView):
|
|
@@ -976,14 +976,21 @@ class UsersProducts(LoginRequiredMixin, generic.ListView):
|
|
|
def get_queryset(self):
|
|
def get_queryset(self):
|
|
|
contact = Contact.objects.get(user=self.request.user)
|
|
contact = Contact.objects.get(user=self.request.user)
|
|
|
|
|
|
|
|
- return Product.objects.filter(contact=contact)
|
|
|
|
|
|
|
+ wohnprojekte = Wohnprojekt.objects.filter(contact=contact)
|
|
|
|
|
+ mobilitaetsprojekte = MobilitaetsProjekt.objects.filter(contact=contact)
|
|
|
|
|
+ ernaehrungsprojekte = ErnaehrungsProjekt.objects.filter(contact=contact)
|
|
|
|
|
+ energyprojekte = EnergyProjekt.objects.filter(contact=contact)
|
|
|
|
|
+
|
|
|
|
|
+ projekte = list(itertools.chain(wohnprojekte, mobilitaetsprojekte, ernaehrungsprojekte, energyprojekte))
|
|
|
|
|
+
|
|
|
|
|
+ return projekte
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs):
|
|
def get_context_data(self, **kwargs):
|
|
|
- context = super().get_context_data(**kwargs)
|
|
|
|
|
- contact = Contact.objects.get(user=self.request.user)
|
|
|
|
|
|
|
+ context = super().get_context_data(**kwargs)
|
|
|
|
|
+ contact = Contact.objects.get(user=self.request.user)
|
|
|
|
|
|
|
|
- context['user'] = self.request.user
|
|
|
|
|
- return context
|
|
|
|
|
|
|
+ context['user'] = self.request.user
|
|
|
|
|
+ return context
|
|
|
|
|
|
|
|
class MediaView(LoginRequiredMixin, TemplateView):
|
|
class MediaView(LoginRequiredMixin, TemplateView):
|
|
|
template_name = 'marktplatz/media_overview.html'
|
|
template_name = 'marktplatz/media_overview.html'
|