Exemplo n.º 1
0
 def get(self, request):
     profile = request.user.profile
     data = {'requestions_with_logs': self.get_logs_for_profile(profile),
             'personal_data_logs': self.get_personal_data_logs(profile),
             'plugin_menu_items': get_plugin_menu_items(),
             'plugin_logs': get_plugin_logs(profile)}
     return self.render_to_response(data)
Exemplo n.º 2
0
 def get_context_data(self, **kwargs):
     profile = kwargs.get('profile')
     form = EmailAddForm()
     profile_change_form = SocialProfilePublicForm(instance=profile)
     pdata_form = PersonalDataForm(instance=profile)
     # На текущий момент поддерживается только один документ
     # поэтому показываем на странице только документ с наименьшим id
     user_documents = profile.personaldocument_set.order_by('id')
     if user_documents.exists():
         document_form = PersonalDocumentForm(instance=user_documents[0])
     else:
         document_form = PersonalDocumentForm(
             initial={'profile': profile.id})
     context = {
         'params': kwargs,
         'profile': profile,
         'form': form,
         'profile_change_form': profile_change_form,
         'pdata_form': pdata_form,
         'doc_form': document_form,
         'plugin_menu_items': get_plugin_menu_items(),
         'profile_additions': get_profile_additions(),
     }
     vkontakte_associations = profile.user.social_auth.filter(provider='vkontakte-oauth2')
     if vkontakte_associations:
         context.update({'vkontakte_association': vkontakte_associations[0]})
     return context
Exemplo n.º 3
0
 def get_context_data(self, **kwargs):
     districts_all = District.objects.all()
     return {
         'profile': kwargs.get('profile'),
         'sadiks_location_data': get_json_sadiks_location_data(),
         'plugin_menu_items': get_plugin_menu_items(),
         'areas_all': Area.objects.all().select_related('district'),
         'districts_all': districts_all,
         'use_districts': USE_DISTRICTS,
     }
Exemplo n.º 4
0
 def get_context_data(self, **kwargs):
     profile = kwargs.get('profile')
     form = EmailAddForm()
     profile_change_form = SocialProfilePublicForm(instance=profile)
     context = {
         'params': kwargs,
         'profile': profile,
         'form': form,
         'profile_change_form': profile_change_form,
         'plugin_menu_items': get_plugin_menu_items(),
         'profile_additions': get_profile_additions(),
     }
     vkontakte_associations = profile.user.social_auth.filter(provider='vkontakte-oauth2')
     if vkontakte_associations:
         context.update({'vkontakte_association': vkontakte_associations[0]})
     return context
Exemplo n.º 5
0
    def get_context_data(self, requestion, **kwargs):

        pref_sadiks_ids = requestion.pref_sadiks.all().values_list('id', flat=True)

        context = {
            'requestion': requestion,
            'areas_all': Area.objects.all(),
            'profile': requestion.profile,
            'NOT_APPEAR_STATUSES': [STATUS_NOT_APPEAR, STATUS_NOT_APPEAR_EXPIRE],
            'STATUS_DISTIRIBUTED': STATUS_DISTRIBUTED,
            'STATUS_REQUESTER_NOT_CONFIRMED': STATUS_REQUESTER_NOT_CONFIRMED,
            'sadiks_location_data': get_json_sadiks_location_data(),
            'pref_sadiks_ids': pref_sadiks_ids,
            'areas_ids': simplejson.dumps([
                req for req in requestion.areas.all().values_list(
                    'id', flat=True)]),
            'can_change_benefits': self.can_change_benefits(requestion),
            'can_change_requestion': self.can_change_requestion(requestion),
            'plugin_menu_items': get_plugin_menu_items(),
        }

        context.update(kwargs)
        context.update(self.get_queue_data(requestion))
        return context