Removed old poll code snippets. Fixed #3179.
This commit is contained in:
parent
ed0b1cef54
commit
f4c30da4a2
@ -432,10 +432,6 @@ class AssignmentPoll(RESTModelMixin, CollectDefaultVotesMixin,
|
|||||||
def get_percent_base_choice(self):
|
def get_percent_base_choice(self):
|
||||||
return config['assignments_poll_100_percent_base']
|
return config['assignments_poll_100_percent_base']
|
||||||
|
|
||||||
def append_pollform_fields(self, fields):
|
|
||||||
fields.append('description')
|
|
||||||
super().append_pollform_fields(fields)
|
|
||||||
|
|
||||||
def get_slide_context(self, **context):
|
def get_slide_context(self, **context):
|
||||||
return super().get_slide_context(poll=self)
|
return super().get_slide_context(poll=self)
|
||||||
|
|
||||||
|
@ -78,12 +78,6 @@ class CollectDefaultVotesMixin(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
def append_pollform_fields(self, fields):
|
|
||||||
fields.append('votesvalid')
|
|
||||||
fields.append('votesinvalid')
|
|
||||||
fields.append('votescast')
|
|
||||||
super(CollectDefaultVotesMixin, self).append_pollform_fields(fields)
|
|
||||||
|
|
||||||
def get_percent_base_choice(self):
|
def get_percent_base_choice(self):
|
||||||
"""
|
"""
|
||||||
Returns one of the strings of the percent base.
|
Returns one of the strings of the percent base.
|
||||||
@ -189,32 +183,6 @@ class BasePoll(models.Model):
|
|||||||
values.append(vote)
|
values.append(vote)
|
||||||
return values
|
return values
|
||||||
|
|
||||||
def get_vote_form(self, **kwargs):
|
|
||||||
"""
|
|
||||||
Returns the form for one option of the poll.
|
|
||||||
"""
|
|
||||||
from openslides.poll.forms import OptionForm
|
|
||||||
return OptionForm(extra=self.get_vote_objects_with_values(kwargs['formid']),
|
|
||||||
**kwargs)
|
|
||||||
|
|
||||||
def get_vote_forms(self, **kwargs):
|
|
||||||
"""
|
|
||||||
Returns a list of forms for the poll.
|
|
||||||
"""
|
|
||||||
forms = []
|
|
||||||
for option in self.get_options():
|
|
||||||
form = self.get_vote_form(formid=option.id, **kwargs)
|
|
||||||
form.option = option
|
|
||||||
forms.append(form)
|
|
||||||
return forms
|
|
||||||
|
|
||||||
def append_pollform_fields(self, fields):
|
|
||||||
"""
|
|
||||||
Appends additional field to a given list of fields. By default it
|
|
||||||
appends nothing.
|
|
||||||
"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def print_value(value, percent_base=0):
|
def print_value(value, percent_base=0):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user