Re: object_list in html

2018-02-26 Thread Alan
That worked! Many thanks! On 23 February 2018 at 17:38, Dylan Reinhold wrote: > I would add an is_running flag into the context_data > > def get_context_data(self, **kwargs): > data = super().get_context_data(**kwargs) > data['is_running'] = Submission.objects.filter(juser=se

Re: object_list in html

2018-02-23 Thread Dylan Reinhold
I would add an is_running flag into the context_data def get_context_data(self, **kwargs): data = super().get_context_data(**kwargs) data['is_running'] = Submission.objects.filter(juser=self.request.user jstatus='Running').exists() return data Then in your template {

Re: object_list in html

2018-02-23 Thread Alan
Hi Constantine, from my views.py: class status(ListView): model = Submission template_name = 'status.html' def get_queryset(self): return Submission.objects.filter(juser=self.request.user). exclude(jstatus='Deleted') If I could create a parameter say runFlag (True of Fal

Re: object_list in html

2018-02-22 Thread Costja Covtushenko
Hi Alan, How did you receive that `object_list`? You should filter it based on you user and ‘Running’ inside the view. And then just check if it has count > 0. I hope that does have sense to you. Regards, Constantine C. > On Feb 22, 2018, at 7:34 PM, Alan wrote: > > Hi there, > > I am using

object_list in html

2018-02-22 Thread Alan
Hi there, I am using Django 2 with Python 3.5 I have this query, simple, in mysql: select * from submit_submission where jstatus = 'Running' and juser = 'jonhdoe'; Basically, I have a table that tracks the jobs I am running. In my html, I'd like to replace this part (in red): {% if *object_li