The message must contain author(unauthenticated user) email and text, create date and update date.
if request.method == 'POST':
if 'bannedphrase' in request.POST: # Имя кнопки
bannedphraseform = BannedPhraseForm(request.POST, prefix='banned')
if bannedphraseform.is_valid():
bannedphraseform.save()
expectedphraseform = ExpectedPhraseForm(prefix='expected')
elif 'expectedphrase' in request.POST:
expectedphraseform = ExpectedPhraseForm(request.POST, prefix='expected')
if expectedphraseform.is_valid():
expectedphraseform.save()
bannedphraseform = BannedPhraseForm(prefix='banned')
else:
bannedphraseform = BannedPhraseForm(prefix='banned')
expectedphraseform = ExpectedPhraseForm(prefix='expected')# Вызвать напрямую
var = ModelDeal.STATUS_CHOISES
# Создать метод класса
@classmethod
def return_choises(cls):
return cls.STATUS_CHOISES
***
var = ModelDeal.return_choises()@register.filter
def get_active_portfolio_items(client):
return Portfolio.objects.filter(client=client, active=True){% for port in i|get_active_portfolio_items%}
{{ port}}
{% endfor %} function add_to_cart(id) {
let token = '{{csrf_token}}';
$.ajax({
headers: { "X-CSRFToken": token },
url: '/add-to-cart/',
type: 'POST',
data: {'id':id},
success: function(data) {
get_cart()
},
failure: function(data) {
console.log('Не успешно');
}
});
}for line in range(1,10):
for place in range(1,50):
print(f'Билет на {line}-й ряд, {place}-е место')