Пример #1
0
 def build_extra_context(self, extra_context):
     extra_context = extra_context or {}
     User = get_user_model()
     if not self.users_fields:
         self.users_fields = json.dumps(get_simple_fields(User))
     extra_context['field_data'] = self.users_fields
     return extra_context
Пример #2
0
    def test_get_simple_fields(self):
        from drip.utils import get_simple_fields

        simple_fields = get_simple_fields(self.User)
        self.assertTrue(
            bool([sf for sf in simple_fields if 'profile' in sf[0]]),
        )
Пример #3
0
    def build_extra_context(self, extra_context):
        from drip.utils import get_simple_fields
        extra_context = extra_context or {}

        from introductions.models import Introduction
        extra_context['field_data'] = json.dumps(get_simple_fields(Introduction))
        return extra_context
Пример #4
0
    def test_get_simple_fields(self):
        from drip.utils import get_simple_fields

        simple_fields = get_simple_fields(self.User)
        self.assertTrue(bool([sf for sf in simple_fields if "profile" in sf[0]]))
Пример #5
0
 def build_extra_context(self, extra_context):
     from drip.utils import get_simple_fields
     extra_context = extra_context or {}
     extra_context['field_data'] = json.dumps(get_simple_fields(User))
     return extra_context
Пример #6
0
 def build_extra_context(self, extra_context):
     from drip.utils import get_simple_fields
     extra_context = extra_context or {}
     User = get_user_model()
     extra_context['field_data'] = json.dumps(get_simple_fields(User))
     return extra_context
Пример #7
0
 def change_view(self, request, object_id, extra_context=None):
     from drip.utils import get_fields, get_simple_fields
     extra_context = extra_context or {}
     extra_context['field_data'] = json.dumps(get_simple_fields(User))
     return super(DripAdmin, self).change_view(request, object_id, extra_context=extra_context)
Пример #8
0
    def test_get_simple_fields(self):
        from drip.utils import get_simple_fields

        simple_fields = get_simple_fields(get_user_model())
        self.assertTrue(bool([sf for sf in simple_fields if 'profile' in sf[0]]))