ui-cs383 / Freedom-Galaxy

Primary repository for the FitG
1 stars 6 forks source link

ORM Issue #46

Closed andyleejordan closed 10 years ago

andyleejordan commented 10 years ago

Hey @hall5714, @rangera and @b-cumber figured you should see this traceback we're getting after trying to start a game:

Traceback (most recent call last):
  File "Intro_Screen.py", line 187, in <module>
    main()
  File "Intro_Screen.py", line 98, in main
    New_Dumb_GUI.main(client, gamesetup)
  File "/Users/andrew/Documents/school/software_engineering/project/client-team/New_Dumb_GUI.py", line 39, in main
    characterlist = client.root.get_state(game_id = gameid, object_type="Character")["response"]["character"]
  File "/Users/andrew/.virtualenvs/fitg-client/lib/python2.7/site-packages/rpyc/core/netref.py", line 196, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
  File "/Users/andrew/.virtualenvs/fitg-client/lib/python2.7/site-packages/rpyc/core/netref.py", line 71, in syncreq
    return conn.sync_request(handler, oid, *args)
  File "/Users/andrew/.virtualenvs/fitg-client/lib/python2.7/site-packages/rpyc/core/protocol.py", line 438, in sync_request
    raise obj
rpyc.core.vinegar/sqlalchemy.exc.InvalidRequestError: Could not find a FROM clause to join from.  Tried joining to <class 'orm.Planet'>, but got: Can't find any foreign key relationships between 'characters' and 'planets'.

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/rpyc/core/protocol.py", line 300, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "/usr/local/lib/python2.7/dist-packages/rpyc/core/protocol.py", line 532, in _handle_call
    return self._local_objects[oid](*args, **dict(kwargs))
  File "/public/GitHub/Freedom-Galaxy/fitg/backend/service.py", line 88, in exposed_get_state
    result = self.actions.game.get_object(session, game_id, object_type, object_id)
  File "/public/GitHub/Freedom-Galaxy/fitg/backend/actions/game.py", line 124, in get_object
    items = session.query(orm_name).join(orm.Planet, orm.Game).filter(orm.Game.id == game_id).all()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 1676, in join
    from_joinpoint=from_joinpoint)
  File "<string>", line 1, in <lambda>
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 51, in generate
    fn(self, *args[1:], **kw)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 1809, in _join
    outerjoin, create_aliases, prop)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 1845, in _join_left_to_right
    self._join_to_left(left, right, onclause, outerjoin)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 1968, in _join_to_left
    "Tried joining to %s, but got: %s" % (right, ae))
InvalidRequestError: Could not find a FROM clause to join from.  Tried joining to <class 'orm.Planet'>, but got: Can't find any foreign key relationships between 'characters' and 'planets'.
hallister commented 10 years ago

Well that was my silly mistake. I'll take a closer look.

andyleejordan commented 10 years ago

Haha it happens.