On 25 nov, 16:07, pa_ree <coldreetit...@gmail.com> wrote:
> the idea is basically that there are people in an organization who are
> working in various projects under different roles.
> so i want to represent the project hierarchy in the form of an
> inverted tree structure.

You're talking about (what you thing is) the solution, but not about
your real use case. What are you actually going to DO with these
infos ?

Still, I'll give you a couple hints:

First point: your hierarchy involves roles, not peoples.

If this hierarchy is known and fixed and the same for each and every
project, you could as well hardcode it in your role models. If it's
not totally fixed but rather stable and still the same for each and
every project, you could define the hierarchical relationships between
roles in your settings using a simple dict.

If you need more flexiblity, you'll have to use models for your roles,
and yes this time you'll have to represent the roles hierarchy in your
models. There are basically three ways to model trees in a RDBMS : the
adjacency list, the materialized path, and the modified preorder tree
traversal (aka MPTT). They're all have their pros and cons, and are
all well documented on the net - modelling trees in a RDBMS is not
exactly a new problem.

Second point: there's a django pluggable app named treebeard that
offer a unified API for these three possible implementation - but I
strongly suggest you first do your homework and read about these three
patterns before you go any further, else you'll have a hard time
making informed decisions about what solution is the more appropriate
for your project's use cases.


> i also want it to be dynamic that is when a
> new project is assigned to a person say who is wrking at the
> managerial level to be upgraded to the next higher level.
> one person can work in various projects with different roles and one
> project has various persons involved.

Looks like a trinary relationship (person,role,project).

> i wud be realy grateful if u cud come out wid the solution as to how
> do i implememnt this.

A bit OT, but do yourself (and everyone here) a favour and quit that
childish "l33t" speak. No one is going to take you seriously here if
you don't speak as a grown up person. And now, I'm not going to do
your own work.

HTH

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to