commit
007dfcd49f
17 changed files with 170 additions and 114 deletions
@ -0,0 +1,19 @@ |
||||
from django.contrib.sites.models import Site |
||||
from django.views.generic.base import ContextMixin |
||||
|
||||
|
||||
class BaseMixin(ContextMixin): |
||||
def get_context_data(self, **kwargs): |
||||
context = super().get_context_data(**kwargs) |
||||
|
||||
pk = self.kwargs.get('pk') |
||||
|
||||
if pk: |
||||
context['pk'] = pk |
||||
|
||||
context['domain'] = Site.objects.get_current().domain |
||||
|
||||
return context |
||||
|
||||
|
||||
# import code; code.interact(local=dict(globals(), **locals())) |
||||
@ -1,9 +1,9 @@ |
||||
{{ user }} |
||||
{{ request.user }} |
||||
|
||||
|
||||
<h2>Мои проекты</h2> |
||||
|
||||
{% for proj in user.projects.all %} |
||||
{% for proj in request.user.projects.all %} |
||||
<h3>{{ proj }}</h3> |
||||
<h5>{{ proj.order }}</h5> |
||||
{% endfor %} |
||||
|
||||
@ -1,11 +1,6 @@ |
||||
{% extends '_layout.html' %} |
||||
|
||||
{% load staticfiles %} |
||||
{% extends 'partials/base.html' %} |
||||
|
||||
{% block content %} |
||||
<div ng-controller='TestCtrl as test'> |
||||
<ul ng-repeat='user in test.users'> |
||||
<li>{( user.first_name )}</li> |
||||
</ul> |
||||
</div> |
||||
<h1>project: {{ project }}</h1> |
||||
<h1>object: {{ object }}</h1> |
||||
{% endblock %} |
||||
|
||||
Loading…
Reference in new issue