Пример #1
0
 def obligee_set_details_live(self, obligee_pks):
     obligee_pks = obligee_pks.split(u',') if obligee_pks else []
     obligees = [
         try_except(lambda: Obligee.objects.get(pk=pk), None)
         for pk in obligee_pks
     ]
     return admin_obj_format_join(u'\n', obligees, u'{tag} {obj.name}')
Пример #2
0
 def assigned_to_field(self, message):
     inforequests = message.inforequest_set.order_by_pk()
     if inforequests:
         return admin_obj_format_join(u', ', inforequests)
     elif message.type == Message.TYPES.INBOUND and message.processed:
         query = dict(email=message.pk, type=InforequestEmail.TYPES.UNDECIDED)
         url = u'%s?%s' % (reverse(u'admin:inforequests_inforequestemail_add'), urlencode(query))
         btn = format_html(u'<li><a href="{0}">{1}</a></li>', url, u'Assign to Inforequest')
         res = format_html(u'<ul class="object-tools">{0}</ul>', btn)
         return res
     else:
         return u'--'
Пример #3
0
 def obligee_set_details_live(self, obligee_pks):
     obligee_pks = obligee_pks.split(u',') if obligee_pks else []
     obligees = [try_except(lambda: Obligee.objects.get(pk=pk), None) for pk in obligee_pks]
     return admin_obj_format_join(u'\n', obligees, u'{tag} {obj.name}')
Пример #4
0
 def email_assigned_to_live(self, email):
     inforequests = email.inforequest_set.all() if email else []
     return admin_obj_format_join(u', ', inforequests)
Пример #5
0
 def assigned_to_column(self, message):
     inforequests = message.inforequest_set.order_by_pk()
     return admin_obj_format_join(u', ', inforequests)
Пример #6
0
 def email_assigned_to_live(self, email):
     inforequests = email.inforequest_set.all() if email else []
     return admin_obj_format_join(u', ', inforequests)