Commit edee20ee authored by Arnaud Fabre's avatar Arnaud Fabre
Browse files

edits on groups

parent a231f56e
...@@ -29,11 +29,12 @@ class Command(BaseCommand): ...@@ -29,11 +29,12 @@ class Command(BaseCommand):
# Group creation # Group creation
try: try:
mgroup = MGroup(group_ptr=mandate.group) mgroup = MGroup.objects.get(group_ptr=mandate.group)
except MGroup.DoesNotExist: except MGroup.DoesNotExist:
mgroup = MGroup(group_ptr=mandate.group) mgroup = MGroup(group_ptr=mandate.group)
mgroup.__dict__.update(mandate.group.__dict__) mgroup.__dict__.update(mandate.group.__dict__)
mgroup.save() mgroup.save()
#print(mgroup)
mmandate.mgroup = mgroup mmandate.mgroup = mgroup
mmandate.save() mmandate.save()
...@@ -47,4 +48,3 @@ class Command(BaseCommand): ...@@ -47,4 +48,3 @@ class Command(BaseCommand):
print('Groups') print('Groups')
for i, mgroup in enumerate(MGroup.objects.all()): for i, mgroup in enumerate(MGroup.objects.all()):
mgroup.update_active() mgroup.update_active()
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<p> <p>
{{ mandate.begin_date }} to {{ mandate.end_date }} <br> {{ mandate.begin_date }} to {{ mandate.end_date }} <br>
<a href="{{ mandate|by_mandate_url }}"> <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> </a>
<br> <br>
Constituency : {{ mandate.constituency.name }} <br> Constituency : {{ mandate.constituency.name }} <br>
......
...@@ -17,6 +17,7 @@ def representatives_index(request): ...@@ -17,6 +17,7 @@ def representatives_index(request):
def representative_by_name(request, name): def representative_by_name(request, name):
representative = get_object_or_404( representative = get_object_or_404(
MRepresentative, full_name=name) MRepresentative, full_name=name)
return render( return render(
request, request,
'legislature/representative_view.html', 'legislature/representative_view.html',
...@@ -26,7 +27,6 @@ def representative_by_name(request, name): ...@@ -26,7 +27,6 @@ def representative_by_name(request, name):
def representative_view(request, num): def representative_view(request, num):
representative = get_object_or_404(MRepresentative, pk=num) representative = get_object_or_404(MRepresentative, pk=num)
return render( return render(
request, request,
'legislature/representative_view.html', 'legislature/representative_view.html',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment