I have a model like this
class Orders(models.Model):
company = models.ForeignKey(Company, on_delete=models.CASCADE)
The logic is the companies to send offers to get the specific travel. When you send an offer you will not have access to that travel anymore untill the base company accept or reject your offer.
So when the specific company logged in I want to show them if they sent an offer or not. The company name is saved in the user that is logged in.
What I tried to do is this
class Order(models.Model):
@property
def has_sent_offer(self):
Offer.objects.filter(order=self.pk, company=request.user.company)
But in the models.py I don't have access to request.user