Exemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     database.create_tables((
         Poll,
         Password,
         Candidate,
         Vote,
     ))
Exemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     database.create_tables((Currency, Balance, LotoDraw, LotoGrid))
     Currency.get_or_create(symbol=DISCORD_MONEY_SYMBOL,
                            name=DISCORD_MONEY_NAME)
     LotoDraw.get_or_create(defaults=dict(value=DISCORD_LOTO_START))
     self.currencies = {}
     self.balances = {}
     self.messages = {}
     self.seeds = []
     self._pay_wage.start()
     self._rate_money.start()
     self._draw_loto.start()
Exemplo n.º 3
0
from base import database
from user import User
from state import State
from city import City
from place import Place
from place_book import PlaceBook
from amenity import Amenity
from place_amenity import PlaceAmenities
from review import Review
from review_user import ReviewUser
from review_place import ReviewPlace

# connect to database specified in base
database.connect()

# populate databases with tables
database.create_tables([User,
                        State,
                        City,
                        Place,
                        PlaceBook,
                        Amenity,
                        PlaceAmenities,
                        Review,
                        ReviewUser,
                        ReviewPlace], safe=True)
Exemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     database.create_tables((Birthday, ))
     self._check_birthday.start()
Exemplo n.º 5
0
from app.xcat_api import app
from base.database import create_tables

if __name__ == '__main__':
    create_tables()
    app.run(host="0.0.0.0")
Exemplo n.º 6
0
# This script creates all tables from each model defined before: User, State, City, Place, PlaceBook, Amenity, PlaceAmenities

from base import database
from user import User
from state import State
from city import City
from place import Place
from place_book import PlaceBook
from amenity import Amenity
from place_amenity import PlaceAmenities

database.connect()

database.create_tables([User, State, City, Place, PlaceBook, Amenity, PlaceAmenities], safe=True)

test_record=User(email='foo', password='******', first_name='foo',last_name='bar')
test_record.save()