Refactor products view(s) per new master pattern.
Finally!
This commit is contained in:
parent
254c68034a
commit
583548cad5
12 changed files with 421 additions and 394 deletions
|
@ -106,8 +106,12 @@ class TerseRecipientsFieldRenderer(formalchemy.FieldRenderer):
|
|||
recipients = self.raw_value
|
||||
if not recipients:
|
||||
return ''
|
||||
recips = filter(lambda r: r.recipient is not self.request.user, recipients)
|
||||
message = self.field.parent.model
|
||||
recips = [r for r in recipients if r.recipient is not self.request.user]
|
||||
recips = sorted([r.recipient.display_name for r in recips])
|
||||
if len(recips) < len(recipients) and (
|
||||
message.sender is not self.request.user or not recips):
|
||||
recips.insert(0, 'you')
|
||||
if len(recips) < 5:
|
||||
return ', '.join(recips)
|
||||
return "{}, ...".format(', '.join(recips[:4]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue