Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user_identity = request.POST.get('user_id')
- contact_list = Contact.objects.filter(receiver_id = user_identity).order_by('-last_updated')
- contact_list_senders = contact_list.values_list('sender_id', flat=True)
- customer_list = Customer.objects.filter(customer_id__in=contact_list_senders)
- zipped_data = zip(contact_list, customer_list)
- class Contact(models.Model):
- contact_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
- related_complete_order = models.ForeignKey(landingpages.models.CompleteOrderList)
- receiver_id = models.CharField(max_length=244, blank=False, null=False)
- sender_id = models.CharField(max_length=244, blank=False, null=False)
- last_updated = models.DateTimeField()
- created = models.DateTimeField(auto_now_add=True)
- class Customer(models.Model):
- customer_id = models.CharField(max_length=244, blank=False, null=False)
- first_name = models.CharField(max_length=244, blank=True, null=True)
- last_name = models.CharField(max_length=244, blank=True, null=True)
- email = models.CharField(max_length=244, blank=False, null=False)
- enrollment_method = models.CharField(max_length=244, blank=True, null=False)
- account_balance = models.DecimalField(default=0000.00, max_digits=6, decimal_places=2)
- reserved_balance = models.DecimalField(default=0000.00, max_digits=6, decimal_places=2)
- modified = models.DateTimeField(auto_now_add=True)
- created = models.DateTimeField(auto_now_add=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement