Passage à python 3 - strings

This commit is contained in:
Martin Pépin 2016-07-08 23:04:34 +02:00 committed by Basile Clement
parent 21b8b6042f
commit b3c45afb49
3 changed files with 8 additions and 4 deletions

View file

@ -1,5 +1,7 @@
# coding: utf-8
from __future__ import unicode_literals
from django import forms
from django.forms.models import BaseInlineFormSet
from bda.models import Spectacle
@ -33,7 +35,7 @@ class TokenForm(forms.Form):
class SpectacleModelChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):
return u"%s le %s (%s) à %.02f" % (obj.title, obj.date_no_seconds(),
return "%s le %s (%s) à %.02f" % (obj.title, obj.date_no_seconds(),
obj.location, obj.price)

View file

@ -213,7 +213,7 @@ class PetitCoursAttributionCounterAdmin(admin.ModelAdmin):
def reset(self, request, queryset):
queryset.update(count=0)
reset.short_description = u"Remise à zéro du compteur"
reset.short_description = "Remise à zéro du compteur"
class PetitCoursDemandeAdmin(admin.ModelAdmin):

View file

@ -1,5 +1,7 @@
# coding: utf-8
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
@ -169,8 +171,8 @@ class EventStatusFilterForm(forms.Form):
class UserProfileForm(forms.ModelForm):
first_name = forms.CharField(label=_(u'Prénom'), max_length=30)
last_name = forms.CharField(label=_(u'Nom'), max_length=30)
first_name = forms.CharField(label=_('Prénom'), max_length=30)
last_name = forms.CharField(label=_('Nom'), max_length=30)
def __init__(self, *args, **kw):
super(UserProfileForm, self).__init__(*args, **kw)