from spline.lib.plugin import PluginBase
from spline.lib.plugin import PluginBase, PluginLink, Priority
-import spline.model as model
-import spline.model.meta as meta
-
import splinext.gts.controllers.gts
-import splinext.gts.model
def add_routes_hook(map, *args, **kwargs):
"""Hook to inject some of our behavior into the routes configuration."""
gts = splinext.gts.controllers.gts.GTSController,
)
- def model(self):
- return [
- splinext.gts.model.GTSPokemon,
- ]
-
- def template_dirs(self):
- return [
- (resource_filename(__name__, 'templates'), Priority.NORMAL)
- ]
-
def hooks(self):
return [
('routes_mapping', Priority.NORMAL, add_routes_hook),
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.sql import func
-from spline import model
from spline.model import meta
from spline.lib.base import BaseController, render
from spline.lib import helpers as h
-
-from splinext.gts.model import GTSPokemon
+from splinext.gts import model as gts_model
log = logging.getLogger(__name__)
# Check for an existing Pokémon
# TODO support multiple!
try:
- stored_pokemon = meta.Session.query(model.GTSPokemon) \
+ stored_pokemon = meta.Session.query(gts_model.GTSPokemon) \
.filter_by(pid=pid) \
.one()
# We've got one! Cool, send it back. The game will ask us to
Returns 0x0001.
"""
- meta.Session.query(model.GTSPokemon).filter_by(pid=pid).delete()
+ meta.Session.query(gts_model.GTSPokemon).filter_by(pid=pid).delete()
meta.Session.commit()
return '\x01\x00'
pokemon_save = PokemonSave(data, encrypted=True)
# Create a record...
- stored_pokemon = model.GTSPokemon(
+ stored_pokemon = gts_model.GTSPokemon(
pid=pid,
pokemon_blob=pokemon_save.as_struct,
)