-
Notifications
You must be signed in to change notification settings - Fork 0
/
create.py
25 lines (24 loc) · 1.14 KB
/
create.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from app import db
from app.models import *
from datetime import datetime
import uuid
db.create_all()
admin = Publisher(name="admin",mobile=1,email="[email protected]",website="localhost:5000",about="admin",category="admin")
ngo1 = NGO(name="a_ngo",mobile=9999999999,email="[email protected]",website="www.ngowebsite.com",about="about ngo",category="ngo category",country="IN")
pub1 = Publisher(name="a_publisher",mobile=9999999991,email="[email protected]",website="www.pubwebsite.com",about="about pub",category="pub category")
pub2 = Publisher(name="marthacooks",mobile=9873344813,email="[email protected]",website="www.marthacooks.com",about="about martha",category="cooking")
payment1 = PaymentInfo(name="user1", email="[email protected]",amount=100)
payment1.publisher_paid_to=pub1
payment1.ngo_paid_to = ngo1
payment1.timestamp = datetime.now()
payment2 = PaymentInfo(name="user1", email="[email protected]",amount=25.5)
payment2.publisher_paid_to=pub1
payment2.ngo_paid_to = ngo1
payment2.timestamp = datetime.now()
db.session.add(admin)
db.session.add(ngo1)
db.session.add(pub1)
db.session.add(pub2)
db.session.add(payment1)
db.session.add(payment2)
db.session.commit()