summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2019-01-06 11:56:40 +0000
committerMagnus Hagander2019-01-10 19:44:35 +0000
commit124027300734b72aceeb527f550c56aff8c847f3 (patch)
treef39d65335a3e3ba0c6b0f2974e818a3d1be9ec92
parenta246a6ee0992eb1b0762742081cd2ffc01d6b7ab (diff)
Replace __unicode__ with __str__
2to3 doesn't do this automatically, probably because weird things can happen if you had both. We know we didn't, so just do a straight replacement.
-rw-r--r--postgresqleu/accounting/admin.py4
-rw-r--r--postgresqleu/accounting/models.py16
-rw-r--r--postgresqleu/adyen/models.py10
-rw-r--r--postgresqleu/braintreepayment/models.py2
-rw-r--r--postgresqleu/confreg/admin.py2
-rw-r--r--postgresqleu/confreg/models.py56
-rw-r--r--postgresqleu/confreg/reporting.py2
-rw-r--r--postgresqleu/confsponsor/models.py10
-rw-r--r--postgresqleu/confwiki/models.py4
-rw-r--r--postgresqleu/countries/models.py6
-rw-r--r--postgresqleu/elections/models.py4
-rw-r--r--postgresqleu/invoices/models.py14
-rw-r--r--postgresqleu/mailqueue/models.py2
-rw-r--r--postgresqleu/membership/models.py6
-rw-r--r--postgresqleu/newsevents/admin.py2
-rw-r--r--postgresqleu/newsevents/models.py6
-rw-r--r--postgresqleu/paypal/models.py2
-rw-r--r--postgresqleu/trustlypayment/models.py6
18 files changed, 77 insertions, 77 deletions
diff --git a/postgresqleu/accounting/admin.py b/postgresqleu/accounting/admin.py
index 5d3cdb16..da75c8d1 100644
--- a/postgresqleu/accounting/admin.py
+++ b/postgresqleu/accounting/admin.py
@@ -35,11 +35,11 @@ class JournalUrlInline(admin.TabularInline):
class JournalEntryAdmin(admin.ModelAdmin):
inlines = [JournalItemInline, JournalUrlInline]
- list_display = ('__unicode__', 'year', 'seq', 'date', 'closed')
+ list_display = ('__str__', 'year', 'seq', 'date', 'closed')
class IncomingBalanceAdmin(admin.ModelAdmin):
- list_display = ('__unicode__', 'year', 'account', 'amount')
+ list_display = ('__str__', 'year', 'account', 'amount')
class ObjectAdmin(admin.ModelAdmin):
diff --git a/postgresqleu/accounting/models.py b/postgresqleu/accounting/models.py
index a261f147..0df19ee8 100644
--- a/postgresqleu/accounting/models.py
+++ b/postgresqleu/accounting/models.py
@@ -19,7 +19,7 @@ class AccountClass(models.Model):
inbalance = models.BooleanField(null=False, blank=False, default=False)
balancenegative = models.BooleanField(null=False, blank=False, default=False)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
@@ -32,7 +32,7 @@ class AccountGroup(models.Model):
accountclass = models.ForeignKey(AccountClass, blank=False, default=False, on_delete=models.CASCADE)
foldable = models.BooleanField(null=False, blank=False, default=False)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
@@ -46,7 +46,7 @@ class Account(models.Model):
availableforinvoicing = models.BooleanField(null=False, blank=False, default=False)
objectrequirement = models.IntegerField(null=False, default=0, choices=ACCOUNT_OBJECT_CHOICES, verbose_name="Object requirements")
- def __unicode__(self):
+ def __str__(self):
return "%s - %s" % (self.num, self.name)
class Meta:
@@ -57,7 +57,7 @@ class Year(models.Model):
year = models.IntegerField(primary_key=True)
isopen = models.BooleanField(null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
if self.isopen:
return "%s *" % self.year
return "%s" % self.year
@@ -71,7 +71,7 @@ class IncomingBalance(models.Model):
account = models.ForeignKey(Account, to_field='num', null=False, blank=False, on_delete=models.CASCADE)
amount = models.DecimalField(max_digits=10, decimal_places=2, null=False, blank=False, validators=[nonzero_validator, ])
- def __unicode__(self):
+ def __str__(self):
return "%s / %s" % (self.year_id, self.account)
class Meta:
@@ -83,7 +83,7 @@ class Object(models.Model):
name = models.CharField(max_length=30, null=False, blank=False)
active = models.BooleanField(null=False, blank=False, default=True)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
@@ -96,7 +96,7 @@ class JournalEntry(models.Model):
date = models.DateField(null=False, blank=False)
closed = models.BooleanField(blank=False, null=False, default=False)
- def __unicode__(self):
+ def __str__(self):
return "%s-%04d (%s)" % (self.year.year, self.seq, self.date)
class Meta:
@@ -127,5 +127,5 @@ class JournalUrl(models.Model):
journal = models.ForeignKey(JournalEntry, null=False, blank=False, on_delete=models.CASCADE)
url = models.URLField(null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return self.url
diff --git a/postgresqleu/adyen/models.py b/postgresqleu/adyen/models.py
index d7d593e3..da6ee146 100644
--- a/postgresqleu/adyen/models.py
+++ b/postgresqleu/adyen/models.py
@@ -9,7 +9,7 @@ class RawNotification(models.Model):
contents = models.TextField(null=False, blank=False)
confirmed = models.BooleanField(null=False, default=False)
- def __unicode__(self):
+ def __str__(self):
return "%s" % self.dat
@@ -34,7 +34,7 @@ class Notification(models.Model):
class Meta:
unique_together = ('pspReference', 'eventCode', 'merchantAccountCode')
- def __unicode__(self):
+ def __str__(self):
return "%s" % self.receivedat
@@ -59,7 +59,7 @@ class TransactionStatus(models.Model):
notes = models.CharField(max_length=1000, null=True, blank=True)
accounting_object = models.CharField(max_length=30, null=True, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.pspReference
class Meta:
@@ -72,8 +72,8 @@ class Refund(models.Model):
transaction = models.OneToOneField(TransactionStatus, on_delete=models.CASCADE)
refund_amount = models.DecimalField(decimal_places=2, max_digits=20, null=False)
- def __unicode__(self):
- return unicode(self.refund_amount)
+ def __str__(self):
+ return str(self.refund_amount)
class ReturnAuthorizationStatus(models.Model):
diff --git a/postgresqleu/braintreepayment/models.py b/postgresqleu/braintreepayment/models.py
index 5125ab37..8f34f54c 100644
--- a/postgresqleu/braintreepayment/models.py
+++ b/postgresqleu/braintreepayment/models.py
@@ -11,7 +11,7 @@ class BraintreeTransaction(models.Model):
method = models.CharField(max_length=100, null=True, blank=True)
accounting_object = models.CharField(max_length=30, null=True, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.transid
diff --git a/postgresqleu/confreg/admin.py b/postgresqleu/confreg/admin.py
index b3bc2558..1e281173 100644
--- a/postgresqleu/confreg/admin.py
+++ b/postgresqleu/confreg/admin.py
@@ -576,7 +576,7 @@ class VolunteerSlotAdminForm(ConcurrentProtectedModelForm):
class VolunteerSlotAdmin(admin.ModelAdmin):
form = VolunteerSlotAdminForm
list_filter = ['conference', ]
- list_display = ('__unicode__', 'title')
+ list_display = ('__str__', 'title')
admin.site.register(ConferenceSeries, ConferenceSeriesAdmin)
diff --git a/postgresqleu/confreg/models.py b/postgresqleu/confreg/models.py
index cd62957f..3ce343ec 100644
--- a/postgresqleu/confreg/models.py
+++ b/postgresqleu/confreg/models.py
@@ -99,7 +99,7 @@ class ConferenceSeries(models.Model):
visible = models.BooleanField(null=False, default=True)
administrators = models.ManyToManyField(User, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
@@ -200,7 +200,7 @@ class Conference(models.Model):
d = dict((a, getattr(self, a) and str(getattr(self, a))) for a in self._safe_attributes)
return d
- def __unicode__(self):
+ def __str__(self):
return self.conferencename
class Meta:
@@ -272,7 +272,7 @@ class RegistrationClass(models.Model):
badgecolor = models.CharField(max_length=20, null=False, blank=True, verbose_name="Badge color", help_text='Badge background color in hex format', validators=[color_validator, ])
badgeforegroundcolor = models.CharField(max_length=20, null=False, blank=True, verbose_name="Badge foreground", help_text='Badge foreground color in hex format', validators=[color_validator, ])
- def __unicode__(self):
+ def __str__(self):
return self.regclass
def colortuple(self):
@@ -317,7 +317,7 @@ class RegistrationDay(models.Model):
('conference', 'day'),
)
- def __unicode__(self):
+ def __str__(self):
return self.day.strftime('%a, %d %b')
def shortday(self):
@@ -345,7 +345,7 @@ class RegistrationType(models.Model):
class Meta:
ordering = ['conference', 'sortkey', ]
- def __unicode__(self):
+ def __str__(self):
if self.cost == 0:
return self.regtype
else:
@@ -379,7 +379,7 @@ class ShirtSize(models.Model):
shirtsize = models.CharField(max_length=32)
sortkey = models.IntegerField(default=100, null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return self.shirtsize
class Meta:
@@ -400,7 +400,7 @@ class ConferenceAdditionalOption(models.Model):
class Meta:
ordering = ['name', ]
- def __unicode__(self):
+ def __str__(self):
# This is what renders in the multichoice checkboxes, so make
# it nice for the end user.
if self.cost > 0:
@@ -453,8 +453,8 @@ class BulkPayment(models.Model):
else:
return "no invoice assigned. SOMETHING IS WRONG!"
- def __unicode__(self):
- return u"Bulk payment for %s created %s (%s registrations, %s%s): %s" % (
+ def __str__(self):
+ return "Bulk payment for %s created %s (%s registrations, %s%s): %s" % (
self.conference,
self.createdat,
self.numregs,
@@ -651,7 +651,7 @@ class Track(models.Model):
json_included_attributes = ['trackname', 'color', 'sortkey', 'incfp']
- def __unicode__(self):
+ def __str__(self):
return self.trackname
@@ -662,7 +662,7 @@ class Room(models.Model):
json_included_attributes = ['roomname', 'sortkey']
- def __unicode__(self):
+ def __str__(self):
return self.roomname
class Meta:
@@ -705,7 +705,7 @@ class Speaker(models.Model):
return (self.photofile is not None and self.photofile != "")
has_photo.boolean = True
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
@@ -722,7 +722,7 @@ class Speaker_Photo(models.Model):
speaker = models.OneToOneField(Speaker, db_column='id', primary_key=True, on_delete=models.CASCADE)
photo = models.TextField(null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return self.speaker.name
def delete(self):
@@ -737,7 +737,7 @@ class ConferenceSessionScheduleSlot(models.Model):
starttime = models.DateTimeField(null=False, blank=False, verbose_name="Start time")
endtime = models.DateTimeField(null=False, blank=False, verbose_name="End time")
- def __unicode__(self):
+ def __str__(self):
return "%s - %s" % (self.starttime, self.endtime)
@@ -802,7 +802,7 @@ class ConferenceSession(models.Model):
def has_feedback(self):
return self.conferencesessionfeedback_set.exists()
- def __unicode__(self):
+ def __str__(self):
return "%s: %s (%s)" % (
self.speaker_list,
self.title,
@@ -863,8 +863,8 @@ class ConferenceSessionFeedback(models.Model):
speaker_feedback = models.TextField(null=False, blank=True, verbose_name='Comments to the speaker')
conference_feedback = models.TextField(null=False, blank=True, verbose_name='Comments to the conference organizers')
- def __unicode__(self):
- return unicode("%s - %s (%s)") % (self.conference, self.session, self.attendee)
+ def __str__(self):
+ return str("%s - %s (%s)") % (self.conference, self.session, self.attendee)
class ConferenceFeedbackQuestion(models.Model):
@@ -875,7 +875,7 @@ class ConferenceFeedbackQuestion(models.Model):
sortkey = models.IntegerField(null=False, default=100)
newfieldset = models.CharField(max_length=100, null=False, blank=True)
- def __unicode__(self):
+ def __str__(self):
return "%s: %s" % (self.conference, self.question)
class Meta:
@@ -889,7 +889,7 @@ class ConferenceFeedbackAnswer(models.Model):
rateanswer = models.IntegerField(null=True)
textanswer = models.TextField(null=False, blank=True)
- def __unicode__(self):
+ def __str__(self):
return "%s - %s: %s" % (self.conference, self.attendee, self.question.question)
class Meta:
@@ -906,7 +906,7 @@ class VolunteerSlot(models.Model):
class Meta:
ordering = ['timerange', ]
- def __unicode__(self):
+ def __str__(self):
return self._display_timerange()
def _display_timerange(self):
@@ -950,7 +950,7 @@ class PrepaidBatch(models.Model):
buyername = models.CharField(max_length=100, null=True, blank=True)
sponsor = models.ForeignKey('confsponsor.Sponsor', null=True, blank=True, verbose_name="Optional sponsor", on_delete=models.CASCADE)
- def __unicode__(self):
+ def __str__(self):
return "%s: %s for %s" % (self.conference, self.regtype, self.buyer)
class Meta:
@@ -965,7 +965,7 @@ class PrepaidVoucher(models.Model):
user = models.ForeignKey(ConferenceRegistration, null=True, blank=True, on_delete=models.CASCADE)
usedate = models.DateTimeField(null=True, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.vouchervalue
class Meta:
@@ -990,7 +990,7 @@ class DiscountCode(models.Model):
sponsor_rep = models.ForeignKey(User, null=True, blank=True, verbose_name="Optional sponsor representative.", help_text="Must be set if the sponsor field is set!", on_delete=models.CASCADE)
is_invoiced = models.BooleanField(null=False, blank=False, default=False, verbose_name="Has an invoice been sent for this discount code.")
- def __unicode__(self):
+ def __str__(self):
return self.code
class Meta:
@@ -1011,7 +1011,7 @@ class AttendeeMail(models.Model):
subject = models.CharField(max_length=100, null=False, blank=False)
message = models.TextField(max_length=8000, null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return "%s: %s" % (self.sentat.strftime("%Y-%m-%d %H:%M"), self.subject)
class Meta:
@@ -1026,8 +1026,8 @@ class PendingAdditionalOrder(models.Model):
invoice = models.ForeignKey(Invoice, null=True, blank=True, on_delete=models.CASCADE)
payconfirmedat = models.DateTimeField(null=True, blank=True)
- def __unicode__(self):
- return u"%s" % (self.reg, )
+ def __str__(self):
+ return "%s" % (self.reg, )
class RefundPattern(models.Model):
@@ -1076,7 +1076,7 @@ class AccessToken(models.Model):
class Meta:
unique_together = (('conference', 'token'), )
- def __unicode__(self):
+ def __str__(self):
return self.token
def _display_permissions(self):
@@ -1092,7 +1092,7 @@ class ConferenceNews(models.Model):
inrss = models.BooleanField(null=False, default=True, verbose_name="Include in RSS feed")
tweeted = models.BooleanField(null=False, blank=False, default=False)
- def __unicode__(self):
+ def __str__(self):
return self.title
class Meta:
diff --git a/postgresqleu/confreg/reporting.py b/postgresqleu/confreg/reporting.py
index 4fa129b6..d37ae2a3 100644
--- a/postgresqleu/confreg/reporting.py
+++ b/postgresqleu/confreg/reporting.py
@@ -15,7 +15,7 @@ class Header(object):
def __init__(self, hdr):
self.hdr = hdr
- def __unicode__(self):
+ def __str__(self):
return self.hdr
diff --git a/postgresqleu/confsponsor/models.py b/postgresqleu/confsponsor/models.py
index 85c19856..51646f04 100644
--- a/postgresqleu/confsponsor/models.py
+++ b/postgresqleu/confsponsor/models.py
@@ -27,7 +27,7 @@ class SponsorshipContract(models.Model):
contractname = models.CharField(max_length=100, null=False, blank=False, verbose_name='Contract name')
contractpdf = FileField(null=False, blank=True, storage=InlineEncodedStorage('sponsorcontract'), upload_to=inlineencoded_upload_path, verbose_name='Contract PDF')
- def __unicode__(self):
+ def __str__(self):
return self.contractname
def clean(self):
@@ -59,7 +59,7 @@ class SponsorshipLevel(models.Model):
canbuyvoucher = models.BooleanField(null=False, blank=False, default=True, verbose_name="Can buy vouchers")
canbuydiscountcode = models.BooleanField(null=False, blank=False, default=True, verbose_name="Can buy discount codes")
- def __unicode__(self):
+ def __str__(self):
return self.levelname
class Meta:
@@ -98,7 +98,7 @@ class SponsorshipBenefit(models.Model):
class_parameters = JSONField(blank=True, null=False)
tweet_template = models.TextField(null=False, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.benefitname
class Meta:
@@ -123,7 +123,7 @@ class Sponsor(models.Model):
signupat = models.DateTimeField(null=False, blank=False)
extra_cc = models.EmailField(null=False, blank=True, verbose_name="Extra information address")
- def __unicode__(self):
+ def __str__(self):
return self.name
@@ -147,7 +147,7 @@ class SponsorMail(models.Model):
subject = models.CharField(max_length=100, null=False, blank=False)
message = models.TextField(max_length=8000, null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return "%s: %s" % (self.sentat.strftime("%Y-%m-%d %H:%M"), self.subject)
class Meta:
diff --git a/postgresqleu/confwiki/models.py b/postgresqleu/confwiki/models.py
index 3a1325af..18f28f3c 100644
--- a/postgresqleu/confwiki/models.py
+++ b/postgresqleu/confwiki/models.py
@@ -44,7 +44,7 @@ class Wikipage(models.Model, DiffableModel):
]
ordering = ('title', )
- def __unicode__(self):
+ def __str__(self):
return "{0} ({1})".format(self.url, self.title)
map_manytomany_for_diff = {
@@ -136,7 +136,7 @@ class Signup(models.Model):
class Meta:
ordering = ('deadline', 'title', )
- def __unicode__(self):
+ def __str__(self):
return self.title
def clean(self):
diff --git a/postgresqleu/countries/models.py b/postgresqleu/countries/models.py
index ed919417..0cec8483 100644
--- a/postgresqleu/countries/models.py
+++ b/postgresqleu/countries/models.py
@@ -34,7 +34,7 @@ class Country(models.Model):
class Admin:
list_display = ('printable_name', 'iso',)
- def __unicode__(self):
+ def __str__(self):
return self.printable_name
@@ -61,7 +61,7 @@ class UsState(models.Model):
class Admin:
list_display = ('name', 'abbrev',)
- def __unicode__(self):
+ def __str__(self):
return self.name
@@ -69,5 +69,5 @@ class UsState(models.Model):
class EuropeCountry(models.Model):
iso = models.OneToOneField(Country, null=False, blank=False, primary_key=True, on_delete=models.CASCADE)
- def __unicode__(self):
+ def __str__(self):
return iso.name
diff --git a/postgresqleu/elections/models.py b/postgresqleu/elections/models.py
index 17e295c9..a331e4ae 100644
--- a/postgresqleu/elections/models.py
+++ b/postgresqleu/elections/models.py
@@ -10,7 +10,7 @@ class Election(models.Model):
isopen = models.BooleanField(null=False, default=False, verbose_name='Voting open')
resultspublic = models.BooleanField(null=False, default=False, verbose_name='Results public')
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
@@ -23,7 +23,7 @@ class Candidate(models.Model):
email = models.EmailField(max_length=200, null=False, blank=False)
presentation = models.TextField(null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return "%s (%s)" % (self.name, self.election)
diff --git a/postgresqleu/invoices/models.py b/postgresqleu/invoices/models.py
index 65d5f63a..c8ad1729 100644
--- a/postgresqleu/invoices/models.py
+++ b/postgresqleu/invoices/models.py
@@ -19,7 +19,7 @@ class InvoiceProcessor(models.Model):
# notified when an invoice has been processed.
classname = models.CharField(max_length=200, null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return self.processorname
@@ -33,7 +33,7 @@ class InvoicePaymentMethod(models.Model):
classname = models.CharField(max_length=200, null=False, blank=False, unique=True)
auto = models.BooleanField(null=False, blank=False, default=True, verbose_name="Used by automatically generated invoices")
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
@@ -206,7 +206,7 @@ class Invoice(models.Model):
else:
return "pending"
- def __unicode__(self):
+ def __str__(self):
return "Invoice #%s" % self.pk
class Meta:
@@ -222,8 +222,8 @@ class VatRate(models.Model):
_safe_attributes = ('vatpercent', 'shortstr', 'shortname', 'name', 'org_name', 'treasurer_email')
- def __unicode__(self):
- return u"{0} ({1}%)".format(self.name, self.vatpercent)
+ def __str__(self):
+ return "{0} ({1}%)".format(self.name, self.vatpercent)
@property
def shortstr(self):
@@ -239,7 +239,7 @@ class InvoiceRow(models.Model):
rowamount = models.DecimalField(decimal_places=2, max_digits=10, null=False, default=0, verbose_name="Amount per item (ex VAT)")
vatrate = models.ForeignKey(VatRate, null=True, on_delete=models.CASCADE)
- def __unicode__(self):
+ def __str__(self):
return self.rowtext
@property
@@ -266,7 +266,7 @@ class InvoiceHistory(models.Model):
class Meta:
ordering = ['time', ]
- def __unicode__(self):
+ def __str__(self):
return self.txt
diff --git a/postgresqleu/mailqueue/models.py b/postgresqleu/mailqueue/models.py
index 1a0642a9..6b002e7e 100644
--- a/postgresqleu/mailqueue/models.py
+++ b/postgresqleu/mailqueue/models.py
@@ -8,5 +8,5 @@ class QueuedMail(models.Model):
# anything, we just push them right in there!
fullmsg = models.TextField(null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return "%s: %s -> %s" % (self.pk, self.sender, self.receiver)
diff --git a/postgresqleu/membership/models.py b/postgresqleu/membership/models.py
index e1a7491d..49f3605c 100644
--- a/postgresqleu/membership/models.py
+++ b/postgresqleu/membership/models.py
@@ -40,7 +40,7 @@ class Member(models.Model):
else:
return True
- def __unicode__(self):
+ def __str__(self):
return "%s (%s)" % (self.fullname, self.user.username)
@@ -49,7 +49,7 @@ class MemberLog(models.Model):
timestamp = models.DateTimeField(null=False)
message = models.TextField(null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return "%s: %s" % (self.timestamp, self.message)
@@ -60,7 +60,7 @@ class Meeting(models.Model):
members = models.ManyToManyField(Member, blank=True)
botname = models.CharField(max_length=50, null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return "%s (%s)" % (self.name, self.dateandtime)
class Meta:
diff --git a/postgresqleu/newsevents/admin.py b/postgresqleu/newsevents/admin.py
index 5c2bd139..09963a32 100644
--- a/postgresqleu/newsevents/admin.py
+++ b/postgresqleu/newsevents/admin.py
@@ -20,7 +20,7 @@ class NewsPosterProfileForm(SelectableWidgetAdminFormMixin, ConcurrentProtectedM
class NewsPosterProfileAdmin(admin.ModelAdmin):
form = NewsPosterProfileForm
- list_display = ('__unicode__', 'rsslink')
+ list_display = ('__str__', 'rsslink')
def rsslink(self, author):
return "/feeds/user/{0}/".format(author.urlname)
diff --git a/postgresqleu/newsevents/models.py b/postgresqleu/newsevents/models.py
index f4334352..a77b8eba 100644
--- a/postgresqleu/newsevents/models.py
+++ b/postgresqleu/newsevents/models.py
@@ -8,8 +8,8 @@ class NewsPosterProfile(models.Model):
fullname = models.CharField(max_length=100, null=False, blank=False, verbose_name="Full name")
canpostglobal = models.BooleanField(null=False, default=False, verbose_name="Can post global news")
- def __unicode__(self):
- return u"{0} ({1})".format(self.fullname, self.urlname)
+ def __str__(self):
+ return "{0} ({1})".format(self.fullname, self.urlname)
class News(models.Model):
@@ -22,7 +22,7 @@ class News(models.Model):
inarchive = models.BooleanField(null=False, default=True, verbose_name="Include in archives")
tweeted = models.BooleanField(null=False, blank=False, default=False)
- def __unicode__(self):
+ def __str__(self):
return self.title
@property
diff --git a/postgresqleu/paypal/models.py b/postgresqleu/paypal/models.py
index e2c96493..78c17ff4 100644
--- a/postgresqleu/paypal/models.py
+++ b/postgresqleu/paypal/models.py
@@ -7,7 +7,7 @@ class SourceAccount(models.Model):
accountname = models.CharField(max_length=16, null=False, blank=False)
lastsync = models.DateTimeField(null=False, blank=False, default=datetime(2009, 1, 1))
- def __unicode__(self):
+ def __str__(self):
return self.accountname
diff --git a/postgresqleu/trustlypayment/models.py b/postgresqleu/trustlypayment/models.py
index 9a84a1f7..7b373bfa 100644
--- a/postgresqleu/trustlypayment/models.py
+++ b/postgresqleu/trustlypayment/models.py
@@ -10,7 +10,7 @@ class TrustlyTransaction(models.Model):
redirecturl = models.CharField(max_length=2000, null=False, blank=False)
orderid = models.BigIntegerField(null=False, blank=False)
- def __unicode__(self):
+ def __str__(self):
return "%s" % self.orderid
@@ -19,7 +19,7 @@ class TrustlyRawNotification(models.Model):
contents = models.TextField(null=False, blank=False)
confirmed = models.BooleanField(null=False, default=False)
- def __unicode__(self):
+ def __str__(self):
return "%s" % self.dat
@@ -34,7 +34,7 @@ class TrustlyNotification(models.Model):
confirmed = models.BooleanField(null=False, default=False)
- def __unicode__(self):
+ def __str__(self):
return "%s" % self.receivedat