Exemplo n.º 1
0
#!/usr/bin/python3
from models.category import Category
from models.tags import Tag
from models.user import User
from models.article import Article

TA = Tag()
TA.label = "#test1"
TA.save()
CA = Category()
CA.label = "test1"
CA.save()
US = User()
US.password = "******"
US.first_name = "test1 "
US.phone_number = 0000
US.save()

AR = Article()
AR.user_id = US.id
AR.tag_id = TA.id
AR.category_id = CA.id
AR.title = "tets"
AR.description = " walaaaaaaaaaaaaaaaaaaaah test"
AR.content = "nammi test"
AR.version = "test"
AR.promoted = 1
AR.save()
print(TA.to_dict())
print("------------------------------------------------")
print("\n")
Exemplo n.º 2
0
#!/usr/bin/python3
from models.category import Category
from models.tags import Tag
from models.user import User
from models.product import Products
CAT = Category()
CAT.label = "a8888"
TA = Tag()
TA.label = "azzzabi"
PRO = Products()
US = User()
US.email = "AZEAZEAZEAZEAZEAZE"
US.password = "******"
PRO.user_id = US.id
tag_id = TA.id
category_id = CAT.id
title = "zazazaz"
description = "hjdbfjfe"
CAT.save()
TA.save()
US.save()
PRO.save()

print(CAT.to_dict())
print(TA.to_dict())
print(US.to_dict())
print(PRO.to_dict())