def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['questions'] = self.object.get_ds_cau_hoi() return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) project = self.get_object() content = [] for ploc in project.projectlocatie_set.all(): for loc in ploc.meetlocatie_set.all(): pos = loc.latlon() content.append({ 'id': loc.id, 'name': loc.name, 'lat': pos.y, 'lon': pos.x, 'info': render_to_string('data/meetlocatie_info.html', {'object': loc}) }) context['content'] = json.dumps(content) context['apikey'] = settings.GOOGLE_MAPS_API_KEY context['maptype'] = 'SATELLITE' context['zoom'] = 14 return context
def get_context_data(self, **kwargs): create_action(self.request.user, 'USER_CREATED') context = DetailView.get_context_data(self, **kwargs) if self.object != self.request.user: context['chat'] = self.object.get_chat_with(self.request.user) context['deal'] = VirtualDeal.combinated(self.object, me_=self.request.user)[0] return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) category_slug = self.request.GET.get('cat', None) category = get_category_by_slug(category_slug) context['category'] = category context['next_project'] = self.get_object().next(category_slug) context['previous_project'] = self.get_object().previous(category_slug) return context
def get_context_data(self, **kwargs): user = self.request.user context = DetailView.get_context_data(self, **kwargs) listing = kwargs['object'] if user.is_authenticated: partner = listing.user context['deal'] = VirtualDeal.by_user(user, partner) context['chat'] = listing.get_chat_with_partner(partner) return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) # lay ngan hang de thi tuong ung voi doi_tuong va mon_thi ngan_hang = NganHangDeThiTuLuan.objects.filter(doi_tuong=self.object.doi_tuong, mon_thi=self.object.mon_thi) context['ds_bo_de'] = ngan_hang return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['khthi'] = self.object.khthi context['thi_sinh'] = self.object.thi_sinh context['khthi_dangthi'] = KHTHI_DANGTHI return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) # lay ngan hang de thi tuong ung voi doi_tuong va mon_thi ngan_hang = NganHangDeThiTuLuan.objects.filter( doi_tuong=self.object.doi_tuong, mon_thi=self.object.mon_thi) context['ds_bo_de'] = ngan_hang return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['can_bid'] = self.object.can_bid(self.request.user) context['can_accept'] = self.object.can_accept(self.request.user) if context['can_bid']: context['push_form'] = BidForm(self.object.pushs) context['pull_form'] = BidForm(self.object.partner_pushs) context['chat'] = self.object.chat return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) today_date = datetime.now() context['date'] = today_date.strftime("%d/%m/%Y") context['sheet_form'] = SheetForm(initial={"customer": self.object}) context['request_form'] = RequestForm( initial={"customer": self.object}) context['sheets'] = Sheet.objects.filter(customer=self.object) context['requests'] = Request.objects.filter(customer=self.object) return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) # get remaining time dathi_duration = timezone.now().hour*60 + timezone.now().minute dathi_duration = dathi_duration - (self.object.khthi.tg_thi_batdau.hour*60 + self.object.khthi.tg_thi_batdau.minute) remaining_time = self.object.khthi.tg_thi - dathi_duration context['questions'] = self.object.get_ds_cauhoi() context['traloi'] = self.object.get_traloi().values() context['socaudatraloi'] = len(self.object.get_traloi()) context['soluongcauhoi'] = len(self.object.get_ds_cauhoi()) context['remaining_time'] = remaining_time return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) device = self.get_object() ec = util.last_ec(device) wl = util.last_waterlevel(device) for pos in ('EC1', 'EC2'): depth = wl['nap'] - ec[pos]['sensor'].elevation() ec[pos]['depth'] = depth * 100 ec[pos]['dry'] = depth <= 0 context['lastec'] = ec context['lastwl'] = wl try: context['battery'] = device.battery_status() except: pass return context
def get_context_data(self, **kwargs): ctx = DetailView.get_context_data(self, **kwargs) ctx["answers2"] = Answer.objects.all().filter(question=ctx["object"]) ans = [] for a1 in ctx["answers2"]: d1 = {} d1["ans"] = a1 likes = Like.objects.all().filter(answer=a1) uLiked = False for L1 in likes: if L1.like_by == self.request.user: uLiked = True d1["likes"] = likes d1["uLiked"] = uLiked ans.append(d1) ctx["answers2"] = ans return ctx
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['pdf'] = True return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['ligne'] = Ligne.objects.all() context['product'] = Product.objects.all() context['formline'] = QuotationFormLine return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['form'] = ProfileForm() return context
def get_context_data(self, **kwargs): forms = MultiFormView.construct_forms(self) data = DetailView.get_context_data(self, object=self.object) data.update(forms) data['EMAIL_TAGS'] = EMAIL_TAGS return data
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) obj = kwargs['object'] context['comment_form'] = CommentForm() context['comments'] = obj.comments.all() return context
def get_context_data(self, **kwargs): kwargs = DetailView.get_context_data(self, **kwargs) kwargs = InlineMixin.get_context_data(self, **kwargs) return kwargs
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['print'] = 'print' in self.request.GET context['content_object_url'] = self.content_object_url() return context
def get_context_data(self, **kwargs): kwargs['form'] = ChatMessageForm(self.request.POST) return DetailView.get_context_data(self, **kwargs)
def get_context_data(self, **kwargs): kwargs = DetailView.get_context_data(self, **kwargs) kwargs = InlineMixin.get_context_data(self, **kwargs) return kwargs
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['lineDetail'] = Line.objects.all().filter( quotation=self.object) return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['testruns'] = TestRun.objects.filter(milestone=self.object) return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self) context["detail_lignes"] = Ligne.objects.filter(proposal = self.object) return context
def get_context_data(self,**kwargs): context = DetailView.get_context_data(self, **kwargs) current_profile = self.request.user.profil context['reco_list'] = Profil.objects.filter(geom__distance_lte=(current_profile.geom, D(km=100))) return context
def get_context_data( self, **kwargs ): ctx=DetailView.get_context_data( self, **kwargs ) ctx.update({ 'bootstrapData': json.dumps(bootstrapSerializer( self.object )), }) return ctx
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['deals_2d'] = VirtualDeal.combinated(*self.object.users.all(), me_=self.request.user) context['chat'] = self.object.chat return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context['questions'] = self.object.get_ds_cau_hoi() return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) if self.kwargs.get('cas',None): context.update({'cas':self.kwargs.get('cas',None)}) return context
def get_context_data(self, **kwargs): context = DetailView.get_context_data(self, **kwargs) context["users"] = User.objects.all() context["categories"] = Category.objects.all() return context