M
M
mts20502016-09-03 18:17:33
Django
mts2050, 2016-09-03 18:17:33

Program for creating e-mail letters?

Where do you create email templates.
Found a program: MailStyler.
Maybe there are similar programs with more functionality?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rostislav Grigoriev, 2016-07-06
Shumway

At least two solutions. One is to write the desired status in the url, the other is to pass it as a GET parameter.
In the first case it will be like this:

# в urls.py
# ...
url('^mypage/(?P<status_num>[1-3])$', ClientListView.as_view()),
# ...
# в views.py

class ClientListView(ClientTemplateListView):

  def get_queryset(self,):
    self.client = Client.objects.filter(status=self.kwargs['status_num'])
    return self.client

Accordingly, if you pass GET parameters via a link like /mypage?status_num=2
class ClientListView(ClientTemplateListView):

  def get_queryset(self,):
    self.client = Client.objects.filter(status=self.request.GET.get('status_num'))
    return self.client

There is no validation for the GET parameter in the example, because that's a different question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question