import time
from os import system, name
def main():
sec = 0
minutes = 0
hour = 0
while True:
hour_high = hour//10
hour_low = hour%10
min_high = minutes//10
min_low = minutes%10
sec_high = sec//10
sec_low = sec%10
timestring = f'{hour_high}{hour_low}:{min_high}{min_low}:{sec_high}{sec_low}'
system('cls')
print(timestring)
sec+=1
time.sleep(1)
if sec == 60:
minutes+=1
sec = 0
if minutes == 60:
hour+=1
minutes = 0
if __name__ == '__main__':
main()
from django.contrib import admin
from .models import WorkingBase
from .models import Blacklist
admin.site.register(WorkingBase) # Первое подключение WorkingBase
admin.site.register(Blacklist)
class WorkingBaseAdmin(admin.ModelAdmin):
list_display=('title', 'price3')
search_fields=('title')
admin.site.register(WorkingBase) # Второе подключение WorkingBase
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()