From a72832842b12708e10370f7340b02de2c01c894b Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Wed, 4 Jul 2012 11:00:58 +0200 Subject: [PATCH] #267 fixt typo. syncdb is required --- openslides/agenda/forms.py | 2 +- openslides/agenda/models.py | 34 +++++++++---------- .../agenda/templates/agenda/item_row.html | 4 +-- .../agenda/templates/agenda/widget.html | 2 +- openslides/application/models.py | 2 +- openslides/application/views.py | 2 +- openslides/assignment/models.py | 12 +++---- openslides/assignment/views.py | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/openslides/agenda/forms.py b/openslides/agenda/forms.py index 2de5af684..acd07ccaf 100644 --- a/openslides/agenda/forms.py +++ b/openslides/agenda/forms.py @@ -25,7 +25,7 @@ class ItemForm(ModelForm, CssClassMixin): parent = TreeNodeChoiceField(queryset=Item.objects.all(), label=_("Parent item"), required=False) class Meta: model = Item - exclude = ('closed', 'weight', 'releated_sid') + exclude = ('closed', 'weight', 'related_sid') def genweightchoices(): diff --git a/openslides/agenda/models.py b/openslides/agenda/models.py index 36e5df50b..bcf2f1229 100644 --- a/openslides/agenda/models.py +++ b/openslides/agenda/models.py @@ -42,27 +42,27 @@ class Item(MPTTModel, SlideMixin): closed = models.BooleanField(default=False, verbose_name=_("Closed")) weight = models.IntegerField(default=0, verbose_name=_("Weight")) parent = TreeForeignKey('self', null=True, blank=True, related_name='children') - releated_sid = models.CharField(null=True, blank=True, max_length=64) + related_sid = models.CharField(null=True, blank=True, max_length=64) - def get_releated_slide(self): - return get_slide_from_sid(self.releated_sid, True) + def get_related_slide(self): + return get_slide_from_sid(self.related_sid, True) - def get_releated_type(self): - return self.get_releated_slide().prefix + def get_related_type(self): + return self.get_related_slide().prefix - def print_releated_type(self): + def print_related_type(self): """ - Print the type of the releated item. + Print the type of the related item. For use in Template - ??Why does {% trans item.print_releated_type|capfirst %} not work?? + ??Why does {% trans item.print_related_type|capfirst %} not work?? """ - return _(self.get_releated_type().capitalize()) + return _(self.get_related_type().capitalize()) def get_title(self): - if self.releated_sid is None: + if self.related_sid is None: return self.title - return self.get_releated_slide().get_agenda_title() + return self.get_related_slide().get_agenda_title() def slide(self): """ @@ -75,8 +75,8 @@ class Item(MPTTModel, SlideMixin): 'items': self.get_children(), 'template': 'projector/AgendaSummary.html', } - elif self.releated_sid: - data = self.get_releated_slide().slide() + elif self.related_sid: + data = self.get_related_slide().slide() else: data = { 'item': self, @@ -142,12 +142,12 @@ class Item(MPTTModel, SlideMixin): * delete """ if link == 'view': - if self.releated_sid: - return self.get_releated_slide().get_absolute_url(link) + if self.related_sid: + return self.get_related_slide().get_absolute_url(link) return reverse('item_view', args=[str(self.id)]) if link == 'edit': - if self.releated_sid: - return self.get_releated_slide().get_absolute_url(link) + if self.related_sid: + return self.get_related_slide().get_absolute_url(link) return reverse('item_edit', args=[str(self.id)]) if link == 'delete': return reverse('item_delete', args=[str(self.id)]) diff --git a/openslides/agenda/templates/agenda/item_row.html b/openslides/agenda/templates/agenda/item_row.html index a4bb9b353..caff874e9 100644 --- a/openslides/agenda/templates/agenda/item_row.html +++ b/openslides/agenda/templates/agenda/item_row.html @@ -19,8 +19,8 @@
{% endif %} {{ item }} - {% if item.releated_sid %} - ({{ item.print_releated_type }}) + {% if item.related_sid %} + ({{ item.print_related_type }}) {% endif %} {% if perms.agenda.can_manage_agenda %} diff --git a/openslides/agenda/templates/agenda/widget.html b/openslides/agenda/templates/agenda/widget.html index 0a243579e..eed65fbb8 100644 --- a/openslides/agenda/templates/agenda/widget.html +++ b/openslides/agenda/templates/agenda/widget.html @@ -32,7 +32,7 @@ {% for p in item.get_ancestors %}   {% endfor %} - {{ item }}{% if item.releated_sid %} ({{ item.print_releated_type }}){% endif %} + {{ item }}{% if item.related_sid %} ({{ item.print_related_type }}){% endif %} {% if not item.is_leaf_node %} {% endif %} diff --git a/openslides/application/models.py b/openslides/application/models.py index 7f358bd9f..172182f6a 100644 --- a/openslides/application/models.py +++ b/openslides/application/models.py @@ -415,7 +415,7 @@ class Application(models.Model, SlideMixin): 'You can not delete it.') - for item in Item.objects.filter(releated_sid=self.sid): + for item in Item.objects.filter(related_sid=self.sid): item.delete() super(Application, self).delete() diff --git a/openslides/application/views.py b/openslides/application/views.py index e759b329f..b731704c6 100644 --- a/openslides/application/views.py +++ b/openslides/application/views.py @@ -683,7 +683,7 @@ class CreateAgendaItem(RedirectView): def pre_redirect(self, request, *args, **kwargs): self.application = Application.objects.get(pk=kwargs['application_id']) - self.item = Item(releated_sid=self.application.sid) + self.item = Item(related_sid=self.application.sid) self.item.save() def get_redirect_url(self, **kwargs): diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index 03f3ef99f..d9828e273 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -112,12 +112,12 @@ class Assignment(models.Model, SlideMixin): def vote_results(self): """ returns a table represented as a list with all candidates from all - releated polls and their vote results. + related polls and their vote results. """ vote_results_dict = {} - # All polls releated to this assigment + # All polls related to this assigment polls = self.poll_set.all() - # All PollOption-Objects releated to this assignment + # All PollOption-Objects related to this assignment options = [] for poll in polls: options += poll.get_options() @@ -130,13 +130,13 @@ class Assignment(models.Model, SlideMixin): for poll in polls: try: polloption = poll.get_options().get(candidate=candidate) - # candidate is releated to this poll + # candidate is related to this poll votes = {} for vote in polloption.get_votes(): votes[vote.value] = vote.get_weight() vote_results_dict[candidate].append(votes) except AssignmentOption.DoesNotExist: - # candidate not in releated to this poll + # candidate not in related to this poll vote_results_dict[candidate].append(None) return vote_results_dict @@ -145,7 +145,7 @@ class Assignment(models.Model, SlideMixin): return self.name def delete(self): - for item in Item.objects.filter(releated_sid=self.sid): + for item in Item.objects.filter(related_sid=self.sid): item.delete() super(Assignment, self).delete() diff --git a/openslides/assignment/views.py b/openslides/assignment/views.py index bc6ff8a34..f8058c543 100644 --- a/openslides/assignment/views.py +++ b/openslides/assignment/views.py @@ -463,7 +463,7 @@ class CreateAgendaItem(RedirectView): def pre_redirect(self, request, *args, **kwargs): self.assignment = Assignment.objects.get(pk=kwargs['assignment_id']) - self.item = Item(releated_sid=self.assignment.sid) + self.item = Item(related_sid=self.assignment.sid) self.item.save() def get_redirect_url(self, **kwargs):