ballot methode for AssignmentPoll and ApplicationPoll
This commit is contained in:
parent
75b9d6c63d
commit
92d2b1db60
@ -528,6 +528,9 @@ class ApplicationPoll(BasePoll, CountInvalid, CountVotesCast):
|
|||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('application_poll_view', args=[self.id])
|
return reverse('application_poll_view', args=[self.id])
|
||||||
|
|
||||||
|
def ballot(self):
|
||||||
|
return self.application.applicationpoll_set.filter(id__lte=self.id).count()
|
||||||
|
|
||||||
|
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
from openslides.config.signals import default_config_value
|
from openslides.config.signals import default_config_value
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
<h4>{% trans "Vote results" %}:</h4>
|
<h4>{% trans "Vote results" %}:</h4>
|
||||||
{% with application.polls as polls %}
|
{% with application.polls as polls %}
|
||||||
{% if polls|length == 0 %}
|
{% if polls.exists %}
|
||||||
{% if perms.application.can_manage_application %}
|
{% if perms.application.can_manage_application %}
|
||||||
{% if "genpoll" in actions %}
|
{% if "genpoll" in actions %}
|
||||||
<a href='{% url application_gen_poll application.id %}'>
|
<a href='{% url application_gen_poll application.id %}'>
|
||||||
|
@ -143,6 +143,9 @@ class AssignmentPoll(BasePoll, CountInvalid, CountVotesCast, PublishPollMixin):
|
|||||||
CountInvalid.append_pollform_fields(self, fields)
|
CountInvalid.append_pollform_fields(self, fields)
|
||||||
CountVotesCast.append_pollform_fields(self, fields)
|
CountVotesCast.append_pollform_fields(self, fields)
|
||||||
|
|
||||||
|
def ballot(self):
|
||||||
|
return self.assignment.assignmentpoll_set.filter(id__lte=self.id).count()
|
||||||
|
|
||||||
@models.permalink
|
@models.permalink
|
||||||
def get_absolute_url(self, link='view'):
|
def get_absolute_url(self, link='view'):
|
||||||
if link == 'view':
|
if link == 'view':
|
||||||
|
Loading…
Reference in New Issue
Block a user