Я новичок в Джанго. Я хочу получить дату после определенного количества дней или недель в файле шаблона html.
код файла моего шаблона:
{% 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 %}
Модель заказа:
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)
фактор Модель:
class ProductPriceFactor(models.Model):
factor_value = models.CharField(max_length=255)
name = models.CharField(max_length=255)
is_active = models.BooleanField(default=True)
orderdate и factor_values из другой модели, поэтому orderdate из order
model и factor_value из ProductPriceFactor
model. Помогите мне, пожалуйста.