Exemplo n.º 1
0
from app import db
from models.Category import Category
from models.Listing import Listing
from models.User import User, UserSchema
from models.CartItem import CartItem

db.drop_all_tables(with_all_data=True)
db.create_tables()

with db_session():

    user_schema = UserSchema()

    user1 = User(username='******',
                 email='*****@*****.**',
                 password_hash=user_schema.generate_hash('pass'))

    user2 = User(username='******',
                 email='*****@*****.**',
                 password_hash=user_schema.generate_hash('pass'))

    user3 = User(username='******',
                 email='*****@*****.**',
                 password_hash=user_schema.generate_hash('pass'))

    user4 = User(username='******',
                 email='*****@*****.**',
                 password_hash=user_schema.generate_hash('pass'))

    user5 = User(username='******',
                 email='*****@*****.**',
Exemplo n.º 2
0
from app import db
from models.Event import Event
from models.Format import Format
from models.User import User, UserSchema


db.drop_all_tables(with_all_data=True)
db.create_tables()

with db_session():
    schema = UserSchema()
    sensei = User(
        username='******',
        image='https://i.imgur.com/w7qm5UP.png',
        email='*****@*****.**',
        password_hash=schema.generate_hash('pineapples')
    )


    five_a_side = Format(name='5-a-side')
    seven_a_side = Format(name='7-a-side')


    Event(
        name='Planet Futsal',
        image='https://i.imgur.com/jWd3gQb.jpg',
        venue='38 IBM Haruna St, Utako, Abuja',
        user=sensei,
        format=five_a_side,
        latitude=9.062720,
        longitude=7.439199
Exemplo n.º 3
0
from pony.orm import db_session
from app import db
from models.Farm import Farm, Comment
from models.Product import Product
from models.User import User, UserSchema

db.drop_all_tables(with_all_data=True)
db.create_tables()

with db_session():
    schema = UserSchema()
    dragan = User(username='******',
                  email='*****@*****.**',
                  password_hash=schema.generate_hash('pass'))
    fruit = Product(name='Fruit')
    vine = Product(name='Vine')
    honey = Product(name='Honey')
    meat = Product(name='Meat')
    fish = Product(name='Fish')
    dairy = Product(name='Dairy')
    vegetables = Product(name='Vegetables')
    eggs = Product(name='Eggs')
    destilery = Product(name='Destilery')
    brewery = Product(name='Brewery')

    my_farm = Farm(
        name='Happy Farm',
        country='UK',
        region='Kent',
        address='Maidstone Rd, Paddock Wood, Tonbridge TN12 6PY',
        products=[brewery, fish],
Exemplo n.º 4
0
from app import db
from models.User import User, UserSchema
from models.Landmark import Landmark
from models.Story import Story

# We delete all tables in our database
db.drop_all_tables(with_all_data=True)
db.create_tables() # We create tables in our database


with db_session():
    schema = UserSchema()
    alikurtulus = User(
        username='******',
        email='*****@*****.**',
        password_hash=schema.generate_hash('sda')
    )

    Story(
     cityname='Lisbon',
     title='Lisbon was great holiday',
     user=alikurtulus,
     description="Lisbon is, in my opinion, one of the best cities to spend a weekend and a perfect place to experience one of Europe’s smaller capitals – but don’t let the word ‘smaller’ fool you! Lisbon packs a hefty punch with great places to see, eat and places to totally ‘let your hair down’…",
     date='12.08.2018',
     image='https://handluggageonly.co.uk/wp-content/uploads/2015/09/DSC02292.jpg'
    )
    Story(
     cityname='Madrid',
     title='Madrid was dream holiday',
     user=alikurtulus,
     description="Madrid is often overshadowed by its northerly neighbor Barcelona. There seems little reason for this, though—with delicious food, affordable living, and deluxe shopping, the capital of Spain deserves its own spotlight of fame! Discover what many locals already know and love about their city—plentiful rooftop bars, nonstop nightclubs, fantastic museum exhibitions, and luscious green parks. Check out all of my tips in the ultimate ",