Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TAlone
memopol
Commits
edee20ee
Commit
edee20ee
authored
Mar 27, 2015
by
Arnaud Fabre
Browse files
edits on groups
parent
a231f56e
Changes
3
Hide whitespace changes
Inline
Side-by-side
legislature/management/commands/legislature_updates_models.py
View file @
edee20ee
...
...
@@ -29,11 +29,12 @@ class Command(BaseCommand):
# Group creation
try
:
mgroup
=
MGroup
(
group_ptr
=
mandate
.
group
)
mgroup
=
MGroup
.
objects
.
get
(
group_ptr
=
mandate
.
group
)
except
MGroup
.
DoesNotExist
:
mgroup
=
MGroup
(
group_ptr
=
mandate
.
group
)
mgroup
.
__dict__
.
update
(
mandate
.
group
.
__dict__
)
mgroup
.
save
()
#print(mgroup)
mmandate
.
mgroup
=
mgroup
mmandate
.
save
()
...
...
@@ -47,4 +48,3 @@ class Command(BaseCommand):
print
(
'Groups'
)
for
i
,
mgroup
in
enumerate
(
MGroup
.
objects
.
all
()):
mgroup
.
update_active
()
legislature/templates/legislature/representative_view.html
View file @
edee20ee
...
...
@@ -31,7 +31,7 @@
<p>
{{ mandate.begin_date }} to {{ mandate.end_date }}
<br>
<a
href=
"{{ mandate|by_mandate_url }}"
>
<strong>
{{ mandate.group.kind }}
</strong>
:
<em>
{{ mandate.group.name }} ({{ mandate.group.abbreviation }})
</em>
<strong>
{{ mandate.group.kind }}
</strong>
:
<em>
{{ mandate.group.name }} ({{ mandate.group.abbreviation }})
</em>
</a>
<br>
Constituency : {{ mandate.constituency.name }}
<br>
...
...
legislature/views.py
View file @
edee20ee
...
...
@@ -17,6 +17,7 @@ def representatives_index(request):
def
representative_by_name
(
request
,
name
):
representative
=
get_object_or_404
(
MRepresentative
,
full_name
=
name
)
return
render
(
request
,
'legislature/representative_view.html'
,
...
...
@@ -26,7 +27,6 @@ def representative_by_name(request, name):
def
representative_view
(
request
,
num
):
representative
=
get_object_or_404
(
MRepresentative
,
pk
=
num
)
return
render
(
request
,
'legislature/representative_view.html'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment