2 from __future__
import absolute_import
, division
7 import pokedex
.db
.tables
as tables
8 from pokedex
.struct
import SaveFilePokemon
9 from pylons
import config
, request
, response
, session
, tmpl_context
as c
, url
10 from pylons
.controllers
.util
import abort
, redirect
11 from sqlalchemy
.orm
.exc
import NoResultFound
13 from spline
.model
import meta
14 from spline
.lib
.base
import BaseController
, render
15 from spline
.lib
import helpers
as h
16 from splinext
.gts
import model
as gts_model
17 import splinext
.pokedex
.db
as db
19 log
= logging
.getLogger(__name__
)
21 class GTSBrowseController(BaseController
):
24 u
"""Show a list of all Pokémon currently uploaded to the GTS."""
26 gts_pokemons
= meta
.Session
.query(gts_model
.GTSPokemon
).all()
29 for gts_pokemon
in gts_pokemons
:
30 savefile
= SaveFilePokemon(gts_pokemon
.pokemon_blob
)
31 savefile
.use_database_session(db
.pokedex_session
)
32 c
.savefiles
.append(savefile
)
34 return render('/gts/list.mako')