Skip to content
Browse files

Changed all relevant str() calls to unicode() and added a few transla…

…tion strings
  • Loading branch information...
1 parent 83cd71b commit a882d04b4709322f02abd9729a4c1c232de441bc @hejsan hejsan committed Jan 25, 2012
View
2 contacts_and_people/admin.py
@@ -158,7 +158,7 @@ def clean(self):
# set the title
title = self.cleaned_data["title"] or ""
- link_title = " ".join(name_part for name_part in [str(title), self.cleaned_data["given_name"], self.cleaned_data["surname"]] if name_part)
+ link_title = u" ".join(name_part for name_part in [unicode(title), self.cleaned_data["given_name"], self.cleaned_data["surname"]] if name_part)
# check ExternalLink-related issues
self.cleaned_data["external_url"] = get_or_create_external_link(self.request,
View
6 contacts_and_people/link_schemas.py
@@ -52,7 +52,7 @@ def description(self):
return self.obj.get_website.get_meta_description()
# the following functionality will have to be restored in such a way that we don't return admin messages to the frontend - later
# else:
- # return "<span class='errornote'>The page <em>" + str(self.obj.get_website) + "</em> has no description metadata. If you are responsible for this page, please address this problem <strong>immediately.</strong></span>"
+ # return u"<span class='errornote'>The page <em>" + unicode(self.obj.get_website) + "</em> has no description metadata. If you are responsible for this page, please address this problem <strong>immediately.</strong></span>"
def heading(self):
return "Related pages"
@@ -61,10 +61,10 @@ def url(self):
return self.obj.get_website_url()
def text(self):
- return str(self.obj)# + ": " + self.link_attributes[0]
+ return unicode(self.obj)# + ": " + self.link_attributes[0]
def short_text(self):
- return str(self.obj.short_name)
+ return unicode(self.obj.short_name)
schema.register_wrapper([models.Entity],EntityWrapper)
View
BIN contacts_and_people/locale/is/LC_MESSAGES/django.mo
Binary file not shown.
View
181 contacts_and_people/locale/is/LC_MESSAGES/django.po
@@ -0,0 +1,181 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-01-24 16:49+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+
+#: admin.py:592
+#, python-format
+msgid "The %(name)s \"%(obj)s\" was added successfully."
+msgstr ""
+
+#: admin.py:600
+msgid "You may edit it again below."
+msgstr ""
+
+#: admin.py:605
+msgid "Add user"
+msgstr "Bæta við notanda"
+
+#: cms_plugins.py:18
+msgid "Entity auto page link"
+msgstr "Tengill á sjálfvirka síðu"
+
+#: cms_plugins.py:61
+msgid "Directory"
+msgstr "Skrá"
+
+#: cms_plugins.py:102
+msgid "Member list"
+msgstr "Listi yfir meðlimi"
+
+#: views.py:34
+msgid "All other people"
+msgstr "Allir aðrir"
+
+#: views.py:38
+msgid "People"
+msgstr "Fólk"
+
+#: templates/admin/contacts_and_people/change_form__delete.html:23
+#: templates/admin/contacts_and_people/person/change_form__delete.html:23
+msgid "History"
+msgstr "Saga"
+
+#: templates/admin/contacts_and_people/change_form__delete.html:24
+#: templates/admin/contacts_and_people/person/change_form__delete.html:24
+msgid "View on site"
+msgstr "Skoða á vef"
+
+#: templates/admin/contacts_and_people/change_form__delete.html:35
+#: templates/admin/contacts_and_people/person/change_form__delete.html:34
+msgid "Please correct the error below."
+msgid_plural "Please correct the errors below."
+msgstr[0] "Vinsamlega leiðréttu villuna að neðan"
+msgstr[1] "Vinsamlega leiðréttu villurnar að neðan"
+
+#: templates/admin/contacts_and_people/entity/change_list.html:8
+msgid "Home"
+msgstr "Heim"
+
+#: templates/admin/contacts_and_people/entity/change_list.html:57
+msgid "Successfully moved"
+msgstr "Tókst að færa"
+
+#: templates/admin/contacts_and_people/entity/change_list.html:62
+msgid "An error occured. Please reload the page"
+msgstr "Villa kom upp. Vinsamlegast endurhlaðið síðuna"
+
+#: templates/admin/contacts_and_people/entity/change_list.html:77
+#, python-format
+msgid "Recover deleted %(name)s"
+msgstr "Endurheimta %(name)s sem hefur verið eytt"
+
+#: templates/admin/contacts_and_people/entity/change_list.html:80
+#, python-format
+msgid "Add %(name)s"
+msgstr "Bæta við %(name)s"
+
+#: templates/admin/contacts_and_people/entity/change_list.html:92
+msgid "Entities on:"
+msgstr "Einingar á:"
+
+#: templates/admin/contacts_and_people/entity/change_list.html:109
+msgid "Filter:"
+msgstr "Sía"
+
+#: templates/admin/contacts_and_people/entity/change_list.html:109
+msgid "on"
+msgstr "á"
+
+#: templates/admin/contacts_and_people/entity/change_list.html:109
+msgid "off"
+msgstr "af"
+
+#: templates/admin/contacts_and_people/entity/change_list.html:111
+msgid "Filter"
+msgstr "Sía"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree.html:6
+msgid "title"
+msgstr "titill"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree.html:8
+msgid "actions"
+msgstr "aðgerðir"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree_item.html:10
+msgid "insert above"
+msgstr "setja inn fyrir ofan þessa einingu"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree_item.html:11
+msgid "insert below"
+msgstr "setja inn fyrir neðan þessa einingu"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree_item.html:12
+msgid "insert inside"
+msgstr "setja inn undir þessari einingu"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree_item.html:17
+msgid "Cut"
+msgstr "Klippa"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree_item.html:17
+msgid "cut"
+msgstr "klippa"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree_item.html:21
+msgid "Add Child"
+msgstr "Bæta við einingu undir þessari"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree_item.html:21
+msgid "add"
+msgstr "bæta við"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree_item.html:23
+msgid "Delete"
+msgstr "Eyða"
+
+#: templates/admin/contacts_and_people/entity/change_list_tree_item.html:23
+msgid "delete"
+msgstr "eyða"
+
+#: templates/contacts_and_people/admin/auth/user/add_form.html:5
+msgid ""
+"First, enter a username and password. Then, you'll be able to edit more user "
+"options."
+msgstr "Skráið fyrst notandanafn og lykilorð"
+
+#: templates/contacts_and_people/admin/auth/user/add_form.html:12
+msgid "Username"
+msgstr "Notandanafn"
+
+#: templates/contacts_and_people/admin/auth/user/add_form.html:19
+msgid "has password"
+msgstr "er með lykilorð"
+
+#: templates/contacts_and_people/admin/auth/user/add_form.html:25
+msgid "Password"
+msgstr "Lykilorð"
+
+#: templates/contacts_and_people/admin/auth/user/add_form.html:31
+msgid "Password (again)"
+msgstr "Lykilorð (aftur)"
+
+#: templates/contacts_and_people/admin/auth/user/add_form.html:32
+msgid "Enter the same password as above, for verification."
+msgstr "Sláðu inn sama lykilorð og að ofan, til staðfestingar"
View
18 contacts_and_people/models.py
@@ -90,11 +90,11 @@ class Meta:
def __unicode__(self):
if self.name:
- building_identifier = str(self.site) + ": " + self.name
+ building_identifier = unicode(self.site) + ": " + self.name
elif self.street:
- building_identifier = str(self.site) + ": " + self.number + " " + self.street
+ building_identifier = unicode(self.site) + ": " + self.number + " " + self.street
else:
- building_identifier = str(self.site) + ": " + self.postcode
+ building_identifier = unicode(self.site) + ": " + self.postcode
return building_identifier
def get_absolute_url(self):
@@ -114,7 +114,7 @@ def get_name(self):
elif self.street:
building_identifier = self.number + " " + self.street
else:
- building_identifier = str(self.site) + ": " + self.postcode
+ building_identifier = unicode(self.site) + ": " + self.postcode
return building_identifier
def get_postal_address(self):
@@ -205,7 +205,7 @@ class EntityLite(models.Model):
name = models.CharField(max_length=100, help_text="e.g. Section of Haematology")
def __unicode__(self):
- return str(self.name)
+ return unicode(self.name)
class EntityManager(models.Manager):
@@ -510,7 +510,7 @@ class PersonLite(models.Model):
surname = models.CharField(max_length=50)
def __unicode__(self):
- return str(self.given_name + " " + self.middle_names + " " + self.surname)
+ return unicode(self.given_name + " " + self.middle_names + " " + self.surname)
def __getInitials(self):
if self.given_name <> '' and self.middle_names <> '':
@@ -556,7 +556,7 @@ class Meta:
def __unicode__(self):
title = self.title or ""
- return " ".join(name_part for name_part in [str(title), self.given_name, self.surname] if name_part)
+ return u" ".join(name_part for name_part in [unicode(title), self.given_name, self.surname] if name_part)
def get_absolute_url(self):
if self.external_url:
@@ -683,9 +683,9 @@ class Meta:
def __unicode__(self):
if self.display_role:
- return str(self.entity.short_name) + "-" + str(self.display_role)
+ return unicode(self.entity.short_name) + "-" + unicode(self.display_role)
else:
- return str(self.role)
+ return unicode(self.role)
def save(self):
"""
View
2 contacts_and_people/templates/contacts_and_people/entity_contacts_and_people.html
@@ -40,7 +40,7 @@
<h{{ IN_BODY_HEADING_LEVEL }}>All people A-Z by surname</h{{ IN_BODY_HEADING_LEVEL }}>
<ul class= "index">
{% for initial in initials_list %}
- <li><a href="/people/{{ entity.slug }}/{{initial|lower}}/">{{ initial }}</a></li>
+ <li><a href="/people/{{ entity.slug }}/{{initial|lower|urlencode}}/">{{ initial }}</a></li>
{% endfor %}
</ul>
{% endif %}
View
5 contacts_and_people/templates/contacts_and_people/place_map.html
@@ -15,7 +15,7 @@
var infowindow = null;
function initialize() {
- var latlng = new google.maps.LatLng({{ place.latitude }}, {{place.longitude}});
+ var latlng = new google.maps.LatLng({{ place.latitude|stringformat:"f" }}, {{ place.longitude|stringformat:"f" }});
var myOptions = {
panControl: false,
@@ -46,7 +46,7 @@
{% if p.latitude and p.longitude and p.zoom and p.map %}
- var siteLatLng = new google.maps.LatLng({{p.latitude}}, {{p.longitude}});
+ var siteLatLng = new google.maps.LatLng({{ p.latitude|stringformat:"f" }}, {{ p.longitude|stringformat:"f" }});
latlngbounds.extend(siteLatLng);
@@ -84,6 +84,7 @@
map.fitBounds( latlngbounds );
+
return pMarker;
}
</script>
View
2 contacts_and_people/urls.py
@@ -10,7 +10,7 @@
(r"^place/(?P<slug>[-\w]+)/(?P<active_tab>[-\w]*)/?$", "contacts_and_people.views.place"),
# lists of people in an entity
- (r"^people/(?P<slug>[-\w]+)/(?P<letter>[a-z])/$", "contacts_and_people.views.people"),
+ (r"^people/(?P<slug>[-\w]+)/(?P<letter>\w)/$", "contacts_and_people.views.people"),
(r"^people/(?P<slug>[-\w]+)/$", "contacts_and_people.views.people"),
# main contacts & people page
View
19 contacts_and_people/views.py
@@ -1,3 +1,4 @@
+from django.utils.translation import ugettext_lazy as _
import django.http as http
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
@@ -30,11 +31,11 @@ def contacts_and_people(request, slug=getattr(default_entity, "slug", None)):
people, initials = entity.get_people_and_initials()
# are there Key People to show?
if entity.get_key_people(): # if so we will show a list of people with key roles, then a list of other people
- people_list_heading = "All other people"
+ people_list_heading = _(u"All other people")
# now remove the Key People from the people list
people = [ person for person in people if person not in set([role.person for role in entity.get_key_people()])]
else: # otherwise, just a list of the people with roles
- people_list_heading = "People"
+ people_list_heading = _(u"People")
people = entity.get_roles_for_members(people) # convert the list of Persons into a list of Members
return render_to_response(
@@ -71,14 +72,14 @@ def people(request, slug, letter=None):
main_page_body_file = "includes/people_list_with_index.html"
# meta values - title and meta
meta = {
- "description": "People in %s" % entity,
+ u"description": "People in %s" % entity,
}
- title = "%s: people" % entity
+ title = u"%s: people" % entity
# content values
people, initials = entity.get_people_and_initials()
if letter:
people = entity.get_people(letter)
- title = "%s, people by surname: %s" % (entity, letter.upper())
+ title = u"%s, people by surname: %s" % (entity, letter.upper())
return render_to_response(
"contacts_and_people/arkestra_page.html",
{
@@ -157,13 +158,13 @@ def person(request, slug, active_tab=""):
"tab": "research",
"title": "Research",
"address": "research",
- "meta_description_content": str(person) + "- research interests",
+ "meta_description_content": unicode(person) + "- research interests",
},
"publications": {
"tab": "publications",
"title": "Publications",
"address": "publications",
- "meta_description_content": str(person) + "- publications",
+ "meta_description_content": unicode(person) + "- publications",
},
}
@@ -352,8 +353,8 @@ def ajaxGetMembershipForPerson(request):
else:
is_selected = ""
#return an <option> entry for that membership
- response.write('<option ' + is_selected + ' value="' + str(membership.id) + '">' + \
- str(membership.entity) + ' - ' + str(membership.role) + \
+ response.write('<option ' + is_selected + ' value="' + unicode(membership.id) + '">' + \
+ unicode(membership.entity) + ' - ' + unicode(membership.role) + \
'</option>')
#Done
return response
View
2 housekeeping/clean_plugins.py
@@ -89,7 +89,7 @@ def clean(request, slug = "dryrun"):
modified_soup = True
if modified_soup:
modified= True
- plugin.body = str(soup)
+ plugin.body = unicode(soup)
if execute and modified:
View
6 links/link_schemas.py
@@ -28,7 +28,7 @@ def description(self):
# the following functionality will have to be restored in such a way that we don't return admin messages to the frontend - later
# if not self.obj.get_meta_description():
- # return "<span class='errornote'>The Page <em>" + str(self.obj) + "</em> has no <strong>Description metadata</strong>. If you are responsible for this Page, please address this problem <strong>immediately.</strong></span>"
+ # return "<span class='errornote'>The Page <em>" + unicode(self.obj) + "</em> has no <strong>Description metadata</strong>. If you are responsible for this Page, please address this problem <strong>immediately.</strong></span>"
return self.obj.get_meta_description()
def metadata(self):
@@ -75,9 +75,9 @@ def description(self):
# find the item's folder_path
if file.folder:
folder = file.folder
- path = [str(folder)]
+ path = [unicode(folder)]
while folder.parent:
- path.insert(0, str(folder.parent))
+ path.insert(0, unicode(folder.parent))
folder = folder.parent
folder_path = u" &rsaquo; ".join(path)
else:
View
14 news_and_events/admin.py
@@ -48,7 +48,7 @@ def clean(self):
# must have body or url in order to be published
if not self.instance and self.instance.body.cmsplugin_set.all():
# if not self.cleaned_data["body"]:
- message = "This will not be published until either an external URL or Plugin has been added. Perhaps you ought to do that now."
+ message = u"This will not be published until either an external URL or Plugin has been added. Perhaps you ought to do that now."
messages.add_message(self.request, messages.WARNING, message)
@@ -133,10 +133,10 @@ def clean(self):
if parent.single_day_event:
self.cleaned_data["start_date"] = self.cleaned_data["end_date"] = parent.start_date
self.cleaned_data["single_day_event"] = True
- message = "You didn't say, but I am guessing that this is a single-day event on " + str(self.cleaned_data["start_date"]) + "."
+ message = u"You didn't say, but I am guessing that this is a single-day event on " + unicode(self.cleaned_data["start_date"]) + u"."
messages.add_message(self.request, messages.INFO, message)
else:
- raise forms.ValidationError("I'm terribly sorry, I can't work out when this event is supposed to start. You'll have to enter that information yourself.")
+ raise forms.ValidationError(u"I'm terribly sorry, I can't work out when this event is supposed to start. You'll have to enter that information yourself.")
# 2. go and do the checks in the parent class
super(EventForm, self).clean()
@@ -149,20 +149,20 @@ def clean(self):
self.cleaned_data["single_day_event"] = True
elif not self.cleaned_data["end_date"]:
self.cleaned_data["single_day_event"] = True
- message = "You didn't enter an end date, so I have assumed this is a single-day event"
+ message = u"You didn't enter an end date, so I have assumed this is a single-day event"
messages.add_message(self.request, messages.INFO, message)
elif not self.cleaned_data["single_day_event"]:
if self.cleaned_data["end_date"] < self.cleaned_data["start_date"]:
raise forms.ValidationError('This event appears to end before it starts, which is very silly. Please correct the dates.')
if not self.cleaned_data["start_time"] and self.cleaned_data["end_time"]:
self.cleaned_data["end_time"] = None
- message = "You didn't enter a start time, so I deleted the end time. I hope that's OK."
+ message = u"You didn't enter a start time, so I deleted the end time. I hope that's OK."
messages.add_message(self.request, messages.WARNING, message)
if self.cleaned_data["single_day_event"]:
self.cleaned_data["end_date"] = self.cleaned_data["start_date"]
if not self.cleaned_data["start_time"]:
- message = "You have a lovely smile."
+ message = u"You have a lovely smile."
messages.add_message(self.request, messages.INFO, message)
self.cleaned_data["end_time"] = None
elif self.cleaned_data["end_time"] and self.cleaned_data["end_time"] < self.cleaned_data["start_time"]:
@@ -177,7 +177,7 @@ def clean(self):
# an event without a start date can be assumed to be a series of events
else:
self.cleaned_data["series"] = True
- message = "You didn't enter a start date, so I will assume this is a series of events."
+ message = u"You didn't enter a start date, so I will assume this is a series of events."
messages.add_message(self.request, messages.INFO, message)
self.cleaned_data['start_date'] = self.cleaned_data['end_date'] = self.cleaned_data['start_time'] = self.cleaned_data['end_time'] = None
self.cleaned_data['single_day_event'] = False
View
BIN news_and_events/locale/is/LC_MESSAGES/django.mo
Binary file not shown.
View
52 news_and_events/locale/is/LC_MESSAGES/django.po
@@ -0,0 +1,52 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2012-01-24 16:48+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+
+#: cms_plugins.py:25
+msgid "News & events"
+msgstr "Fréttir og viðburðir"
+
+#: models.py:268
+msgid " to "
+msgstr " - "
+
+#: models.py:376
+msgid "News"
+msgstr "Fréttir"
+
+#: models.py:377
+msgid "Events"
+msgstr "Viðburðir"
+
+#: templates/admin/news_and_events/event/change_list.html:43
+msgid "Successfully moved"
+msgstr "Tókst að færa"
+
+#: templates/admin/news_and_events/event/change_list.html:67
+#, python-format
+msgid "Add %(name)s"
+msgstr "Bæta við %(name)s"
+
+#: templates/admin/news_and_events/event/change_list_tree.html:6
+msgid "title"
+msgstr "titill"
+
+#: templates/admin/news_and_events/event/change_list_tree.html:8
+msgid "actions"
+msgstr "aðgerðir"
View
7 news_and_events/models.py
@@ -1,3 +1,4 @@
+from django.utils.translation import ugettext_lazy as _
from datetime import datetime
from datetime import date as pythondate
@@ -264,7 +265,7 @@ def get_dates(self):
if self.single_day_event:
dates = nice_date(start_date, end_date_format)
else:
- dates = nice_date(start_date, start_date_format) + " to " + nice_date(end_date, end_date_format)
+ dates = nice_date(start_date, start_date_format) + unicode(_(u" to ")) + nice_date(end_date, end_date_format)
return dates
else:
return "Series"
@@ -372,8 +373,8 @@ class NewsAndEventsPlugin(CMSPlugin, ArkestraGenericPluginOptions):
)
display = models.CharField("Show", max_length=25,choices = DISPLAY, default = "news events")
show_previous_events = models.BooleanField()
- news_heading_text = models.CharField(max_length=25, default="News")
- events_heading_text = models.CharField(max_length=25, default="Events")
+ news_heading_text = models.CharField(max_length=25, default=_(u"News"))
+ events_heading_text = models.CharField(max_length=25, default=_(u"Events"))
try:
mptt.register(Event)
View
16 news_and_events/views.py
@@ -40,9 +40,9 @@ def news_and_events(request, slug=getattr(default_entity, "slug", None)):
instance.type = "main_page"
meta = {"description": "Recent news and forthcoming events",}
- title = str(entity) + " news & events"
+ title = unicode(entity) + u" news & events"
if getattr(settings, "MULTIPLE_ENTITY_MODE"):
- pagetitle = str(entity) + " news & events"
+ pagetitle = unicode(entity) + u" news & events"
else:
pagetitle = "News & events"
CMSNewsAndEventsPlugin().render(context, instance, None)
@@ -72,8 +72,8 @@ def previous_events(request, slug=getattr(default_entity, "slug", None)):
instance.limit_to = None
meta = {"description": "Archive of previous events",}
- title = str(entity) + " previous events"
- pagetitle = str(entity) + " previous events"
+ title = unicode(entity) + u" previous events"
+ pagetitle = unicode(entity) + u" previous events"
CMSNewsAndEventsPlugin().render(context, instance, None)
@@ -102,8 +102,8 @@ def all_forthcoming_events(request, slug=getattr(default_entity, "slug", None)):
CMSNewsAndEventsPlugin().render(context, instance, None)
meta = {"description": "All forthcoming events",}
- title = str(entity) + " forthcoming events"
- pagetitle = str(entity) + " forthcoming events"
+ title = unicode(entity) + u" forthcoming events"
+ pagetitle = unicode(entity) + u" forthcoming events"
context.update({
"entity":entity,
@@ -131,8 +131,8 @@ def news_archive(request, slug=getattr(default_entity,"slug", None)):
CMSNewsAndEventsPlugin().render(context, instance, None)
meta = {"description": "Archive of news items",}
- title = str(entity) + " - news archive"
- pagetitle = str(entity) + " - news archive"
+ title = unicode(entity) + u" - news archive"
+ pagetitle = unicode(entity) + u" - news archive"
context.update({
"entity":entity,
View
20 vacancies_and_studentships/views.py
@@ -37,8 +37,8 @@ def vacancies_and_studentships(request, slug=getattr(default_entity, "slug", Non
instance.type = "main_page"
meta = {"description": "Vacancies and studentships",}
- title = str(entity) + " vacancies & studentships"
- pagetitle = str(entity) + " vacancies & studentships"
+ title = unicode(entity) + u" vacancies & studentships"
+ pagetitle = unicode(entity) + u" vacancies & studentships"
CMSVacanciesPlugin().render(context, instance, None)
@@ -69,8 +69,8 @@ def archived_vacancies(request, slug=getattr(default_entity, "slug", None)):
instance.limit_to = None
meta = {"description": "Archive of vacancies",}
- title = str(entity) + " archived vacancies"
- pagetitle = str(entity) + " archived vacancies"
+ title = unicode(entity) + u" archived vacancies"
+ pagetitle = unicode(entity) + u" archived vacancies"
context.update({
"entity":entity,
@@ -99,8 +99,8 @@ def all_current_vacancies(request, slug=getattr(default_entity, "slug", None)):
CMSVacanciesPlugin().render(context, instance, None)
meta = {"description": "All current vacancies",}
- title = str(entity) + " current vacancies"
- pagetitle = str(entity) + " current vacancies"
+ title = unicode(entity) + u" current vacancies"
+ pagetitle = unicode(entity) + u" current vacancies"
context.update({
"entity":entity,
@@ -127,8 +127,8 @@ def archived_studentships(request, slug=getattr(default_entity, "slug", None)):
CMSVacanciesPlugin().render(context, instance, None)
meta = {"description": "Archive of studentships",}
- title = str(entity) + " archived studentships"
- pagetitle = str(entity) + " archived studentships"
+ title = unicode(entity) + u" archived studentships"
+ pagetitle = unicode(entity) + u" archived studentships"
context.update({
"entity":entity,
@@ -155,8 +155,8 @@ def all_current_studentships(request, slug=getattr(default_entity, "slug", None)
CMSVacanciesPlugin().render(context, instance, None)
meta = {"description": "All current studentships",}
- title = str(entity) + " current studentships"
- pagetitle = str(entity) + " current studentships"
+ title = unicode(entity) + u" current studentships"
+ pagetitle = unicode(entity) + u" current studentships"
context.update({
"entity":entity,
View
8 video/models.py
@@ -83,16 +83,16 @@ def abs_directory_path(self):
def filename(self):
# e.g. "video.dv"
- return os.path.basename(str(self.source.file))
+ return os.path.basename(unicode(self.source.file))
def directory(self):
# e.g. "filer_private/2010/11/23"
print ">> self ", self
print ">> self.source ", self.source
print ">> self.source.file ", self.source.file
- print ">> str(self.source.file)", str(self.source.file)
- print ">> os.path.dirname(str(self.source.file))", os.path.dirname(str(self.source.file))
- return os.path.dirname(str(self.source.file))
+ print ">> unicode(self.source.file)", unicode(self.source.file)
+ print ">> os.path.dirname(unicode(self.source.file))", os.path.dirname(unicode(self.source.file))
+ return os.path.dirname(unicode(self.source.file))
def encode(self):
print

0 comments on commit a882d04

Please sign in to comment.
Something went wrong with that request. Please try again.