from advertisements_app models import Advertisement def multiply func

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
from advertisements_app.models import Advertisement
def multiply(func):
def new_func():
for _ in range(15):
func()
return new_func()
@multiply
def create_advertisement():
for number in range(10):
name = f'Объявление {number}'
new_advertisement = Advertisement(title=name)
new_advertisement.save()