Beispiel #1
0
def populate():
    print('Populating bkName ... ', end='')
    Book.objects.all().delete()
    i = 1
    for bkName in bkNames:
        book = Book()
        book.bkName = bkName
        book.authorName = 'at' + str(i)
        book.publisher = 'pub' + str(i)
        book.pubversion = 1
        book.price = i * 100
        book.inventory = 10
        i += 1
        book.save()

    print('done')