madhav
unread,Aug 2, 2008, 9:58:43 AM8/2/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
I have a peculiar problem. I am having a pet project, where I will be
dealing with Vehicles,Routes,Halts. You can imagine, its a kind of
google-maps mashup. The problem I faced is when building the models
for the maps part.
My assumption was like any route will be just like a collection of
Halts, and each halt will be having a position with respect to the
Route it belongs to. So there will be finite set of Halts. Many routes
share halts and each halt may fall at different positions(in different
routes). My Route class is like:
class Route(models.Model):
code = models.CharField(max_length=6,
blank=False,unique=True,db_index=True)
halt = models.ForeignKey(Stop)
halt_position = models.IntegerField(default=1,blank=False)
objects = RouteManager()
So, as you can figure out multiple Route(check model above) instances
will actually become a route. But the code(check above model Name)
shows each instance is actually a Route. So this is the ambiguity. How
do I solve this and which way can I have Route model to be constructed
which is truly communicative?