replace __unicode__ with __str__ here and there, remove camp title from event boxes on schedule overview

This commit is contained in:
Thomas Steen Rasmussen 2017-01-31 23:39:49 +01:00
parent dcbf9b6992
commit 4cd344601a
4 changed files with 17 additions and 17 deletions

View file

@ -64,7 +64,7 @@ class Camp(CreatedUpdatedModel, UUIDModel):
if errors:
raise ValidationError(errors)
def __unicode__(self):
def __str__(self):
return "%s - %s" % (self.title, self.tagline)
@property

View file

@ -15,7 +15,7 @@ class EventType(CreatedUpdatedModel):
color = models.CharField(max_length=50)
light_text = models.BooleanField(default=False)
def __unicode__(self):
def __str__(self):
return self.name
@ -31,7 +31,7 @@ class Event(CreatedUpdatedModel):
ordering = ['title']
unique_together = (('camp', 'slug'), ('camp', 'title'))
def __unicode__(self):
def __str__(self):
return '%s (%s)' % (self.title, self.camp.title)
def save(self, **kwargs):
@ -54,7 +54,7 @@ class EventInstance(CreatedUpdatedModel):
class Meta:
ordering = ['when']
def __unicode__(self):
def __str__(self):
return '%s (%s)' % (self.event, self.when)
def __clean__(self):
@ -107,7 +107,7 @@ class Speaker(CreatedUpdatedModel):
ordering = ['name']
unique_together = (('camp', 'name'), ('camp', 'slug'))
def __unicode__(self):
def __str___(self):
return '%s (%s)' % (self.name, self.camp)
def save(self, **kwargs):

View file

@ -13,7 +13,7 @@
style="background-color: {{ eventinstance.event.event_type.color }}; border: 0; color: {% if eveninstance.event.event_type.light_text %}white{% else %}black{% endif %};">
<small>{{ eventinstance.when.lower|date:"H:i" }} - {{ eventinstance.when.upper|date:"H:i" }}</small>
<br />
{{ event }}
{{ event.title }}
<br />
{% if event.speakers.exists %}<i>by {{ event.speakers_list }}{% endif %}</i>
</a>

View file

@ -35,7 +35,7 @@ class CustomOrder(CreatedUpdatedModel):
default=False,
)
def __unicode__(self):
def __str__(self):
return 'custom order id #%s' % self.pk
@property
@ -114,7 +114,7 @@ class Order(CreatedUpdatedModel):
objects = OrderQuerySet.as_manager()
def __unicode__(self):
def __str__(self):
return 'shop order id #%s' % self.pk
def get_number_of_items(self):
@ -233,7 +233,7 @@ class ProductCategory(CreatedUpdatedModel, UUIDModel):
slug = models.SlugField()
public = models.BooleanField(default=True)
def __unicode__(self):
def __str__(self):
return self.name
def save(self, **kwargs):
@ -267,10 +267,10 @@ class Product(CreatedUpdatedModel, UUIDModel):
'(Format: YYYY-MM-DD HH:MM) | Only one of start/end is required'
)
)
objects = ProductQuerySet.as_manager()
def __unicode__(self):
def __str__(self):
return '{} ({} DKK)'.format(
self.name,
self.price,
@ -311,7 +311,7 @@ class EpayCallback(CreatedUpdatedModel, UUIDModel):
payload = JSONField()
md5valid = models.BooleanField(default=False)
def __unicode__(self):
def __str__(self):
return 'callback at %s (md5 valid: %s)' % (self.created, self.md5valid)
@ -349,7 +349,7 @@ class CreditNote(CreatedUpdatedModel):
)
sent_to_customer = models.BooleanField(default=False)
def __unicode__(self):
def __str__(self):
return 'creditnote#%s - %s DKK (sent to %s: %s)' % (
self.id,
self.amount,
@ -372,7 +372,7 @@ class Invoice(CreatedUpdatedModel):
pdf = models.FileField(null=True, blank=True, upload_to='invoices/')
sent_to_customer = models.BooleanField(default=False)
def __unicode__(self):
def __str__(self):
if self.order:
return 'invoice#%s - shop order %s - %s - total %s DKK (sent to %s: %s)' % (
self.id,
@ -403,7 +403,7 @@ class CoinifyAPIInvoice(CreatedUpdatedModel):
invoicejson = JSONField()
order = models.OneToOneField('shop.Order')
def __unicode__(self):
def __str__(self):
return "coinifyinvoice for order #%s" % self.order.id
@ -413,7 +413,7 @@ class CoinifyAPICallback(CreatedUpdatedModel):
order = models.ForeignKey('shop.Order')
valid = models.BooleanField(default=False)
def __unicode__(self):
def __str__(self):
return 'order #%s callback at %s' % (self.order.id, self.created)
@ -439,7 +439,7 @@ class Ticket(CreatedUpdatedModel, UUIDModel):
checked_in = models.BooleanField(default=False)
def __unicode__(self):
def __str__(self):
return 'Ticket {user} {product}'.format(
user=self.order.user,
product=self.product