Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #27887 > unrolled thread

modeling complex data with sqlalchemy

Started by"Littlefield, Tyler" <tyler@tysdomain.com>
First post2012-08-25 14:47 -0600
Last post2012-08-25 14:47 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  modeling complex data with sqlalchemy "Littlefield, Tyler" <tyler@tysdomain.com> - 2012-08-25 14:47 -0600

#27887 — modeling complex data with sqlalchemy

From"Littlefield, Tyler" <tyler@tysdomain.com>
Date2012-08-25 14:47 -0600
Subjectmodeling complex data with sqlalchemy
Message-ID<mailman.3815.1345928212.4697.python-list@python.org>
Hello all:
I had a quick question.
In my game, I have an is-a setup, where all objects contain data like an 
id for sqlalchemy, a name, a description and a list of contents.
In order to add functionality to an object, you add components. So for 
example, a player would have the Player and Living component associated 
with the basic object. It's sort of a way to give myself a way to add 
functionality without having a lot of multiple inheritance.
This creates a problem for me though, since it looks like each component 
would have it's own table. How would you go about modeling the 1:n 
relationship between entity and each component?
Also, I'm going to have a location property on the object, which is 
basically it's location (a reference to another Entity), or None if it 
has no parent. How would you set that up in SA so that location gets 
translated to an ID and then translated back to the required object?
Might there be another easier way to model all this data? It looks like 
this database could get rather large, extremely quickly.

-- 
Take care,
Ty
http://tds-solutions.net
The aspen project: a barebones light-weight mud engine:
http://code.google.com/p/aspenmud
He that will not reason is a bigot; he that cannot reason is a fool; he that dares not reason is a slave.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web