I am new in django. I want to get date after some specific number of days or number of weeks in html template file.
my template file code:
{% for factors in c.factor %}
{% for factor_details in factors.factor_values %}
{{factor_details.id}}
{{factor_details.factor_value}}
# here this is given date {{order_detail.oderdate}} and this is number of days and weeks {{factor_details.factor_value}}.
{% endfor %}
{% endfor %}
order Model :
class Order(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, blank=True,on_delete=models.CASCADE)
order_no = models.CharField(max_length=120, blank=True) # AB31DE3
shipping_address = models.ForeignKey(Addresses, related_name="shipping_address",null=True, blank=True,on_delete=models.CASCADE)
billing_address = models.ForeignKey(Addresses, related_name="billing_address",null=True, blank=True,on_delete=models.CASCADE)
cart = models.ForeignKey(Cart,on_delete=models.CASCADE)
shipping_total = models.DecimalField(default=0.00, max_digits=65, decimal_places=2)
totalamount = models.DecimalField(default=0.00, max_digits=65, decimal_places=2)
stripe_id = models.CharField(max_length=120, blank=True)
payment_status = models.CharField(max_length=120, blank=True)
oderdate = models.DateTimeField(auto_now_add=True)
is_active = models.BooleanField(default=True)
factor Model :
class ProductPriceFactor(models.Model):
factor_value = models.CharField(max_length=255)
name = models.CharField(max_length=255)
is_active = models.BooleanField(default=True)
orderdate and factor_values from different model so orderdate from order
model and factor_value from ProductPriceFactor
model. please help me.