I just posted a blog entry to my personal site:
http://jtauber.com/blog/2008/11/09/groups_tribes_and_projects_in_pinax/
where I confuse myself about the relation between Org, Org instances,
OrgType instances and a 4th type (a collection of semantically related
Org instances, e.g. "programming language tribes")
After revisiting this email, I'm fairly sure that my first 3 bullet
points in that blog post do correspond to Org, OrgType instances and
Org instances respectively.
Thoughts welcome.
James
As requested by James I packaged the first of the modules I wrote for
http://tuttivisti.com.
I did not polish it since I understand you started a rewrite of the
account module.
http://github.com/durdn/easyopenid/tree/master
I'm here of if you have any question, but as you'll see it's nothing
ground breaking.
Regards,
Nick
greg newman
http://20seven.org
My current working name for the main model is Group.
The first design decision I'm hitting up against is whether slugs
should be unique across all groups or just scoped to the group type.
Option 1. All Groups
Has the advantage that we can more easily provide for linking to a
group regardless of type. e.g #foo in a tweet could mean a tribe or
project or whatever, without need to disambiguate.
Disadvantage is we couldn't for example, have a tribe and project both
called "pinax". To be honest, this doesn't bother me -- we can just
call the project "pinax-dev" or whatever.
Note that even if we go with this, I would still propose URLs that
look like /groups/project/foo/ rather than /groups/foo/ although this
option allows for both (and we could let the site-developer ultimately
pick their URL patterns)
Option 2. Scoped to Group Type
Only real advantage is it's easier to pick slugs because there's less
chance of a clash. It might surprise the user if they are creating the
very first tribe and it says the slug is taken.
Obviously we would have to use the *type* slug in any URLs and it
would make difficult doing things like linking to groups easily in
wikis or tweets without some extra prefix.
Thoughts?
Let me also through in Crazy Option 3: don't even allow group slugs to
be the same as a username. That way @group could be used instead of a
different siglum for users versus groups.
James
Should the templates be parameterized or should we expect a site-
developer to just create per-group-type templates?
I certainly expect views to be parameterized otherwise it's really
only a shared model and I think the point is to have better reuse than
that.
e.g. say a site has group types 'project' and 'tribe'.
Option 1. Single Set of Parameterized Templates
There is a single group_list, group_create, your_groups, group_detail,
etc each of which is parameterized for the group type.
This means that more is done either in the database or settings files
to declare various text to be used for a particular group type and
gives less flexibility if you want different layout or content
depending on group type.
Option 2. Individual Templates
The site developers have to provide project_list, tribe_list,
project_create, tribe_create, your_projects, your_tribes, etc, etc
which will be a big DRYolation. The only benefit is if you want more
fine grained control on templates on a per-group-type basis.
Thoughts?
James
Should a group type (e.g. "project" or "tribe") be a row in a
GroupType table OR purely a Python object configured in a Python file?
Personally, I prefer the latter -- I don't like configuring my site
via the database, although we may eventually want to allow both
approaches. Remember, group *type* creation is intended to be a rare,
development-time activity no different than setting up urls.py, etc)
The only different this makes to the Group model is instead of a
foreignkey to a GroupType model, it will just have a CharField which
will contain the type slug which will be used for a lookup in some
group type dictionary. Having that slug in the table will also prevent
unnecessary db joins in many cases.
James
Good point. It was my preference anyway :-)
> Templates -> Individual templates. Note that this doesn't necessarily
> leave the matter to the site developer since I expect several group-
> based apps to become available (at least as examples) and those apps
> could provide more detailed templates if desired.
Yes, you're right -- some group types could come out of the box. But I
still worry about violating DRY having a different template for
creating a tribe versus creating a project versus creating
my_group_type_1 versus creating my_group_type_2.
Perhaps I'll define to one template for all types but allow template
names to be overridden in the group type configuration.
> Group Type -> Pure Python. I buy your explanation.
We can always change things based on feedback, but I'll at least start
off this way.
James
More design discussion on the new groups app...
Should a group type (e.g. "project" or "tribe") be a row in a
GroupType table OR purely a Python object configured in a Python file?
I'll try to get a little further on my branch first and then see how I
might be able to support your cases (or even just use your code)
James
1) reduce the duplication of code between Tribes and Projects
2) make it easier for new types of "Groups" to be created that have
different combinations of features from tribes and projects, possibly
with additions of their own
Note that while I use the term "Group" in this email we'll probably
ultimately go with a different name. With that warning gone, I'll drop
the scare quotes.
My shift in thinking from "endo" to "exo" means that instead of a
table of GroupTypes and a single Group table, each new group type will
just be a Django model. In other words, in Pinax 0.7, there will still
be a Tribe model and a Project model.
The change from 0.5 to 0.7, however, will be that pieces like topics
and tasks will be independent of tribes and projects and reusable
apart from them. Furthermore there will be support for a variety of
membership models including:
1. anyone can join
2. users can request to join but must be approved
3. users can be invited by the group admin but must accept
4. users can be added by the group admin
(Note these are options available to a *developer* -- whether a group
creator has a choice is up to the site developer)
The first step in all of this is breaking topics out of tribes and
projects and putting them in a third app where they can be shared by
tribes, projects and whoever else wants to use them. (The same applies
to tasks)
There is already precedence for this in wikiapp.
But I wanted to raise some of the challenges in breaking out (just for
example) topics to elicit feedback and possible alternatives.
1. the explicit foreign key to Tribe or Project must be changed to a
generic foreign key
I don't think this is an issue -- we may want to follow the lead of
wikiapp in supporting the GFK being nullable too for sites that might
want top-level topics
2. will topic URLs be group-type-specific?
The simplest way is not, but that is probably not desirable for many.
wikiapp does get around this and does include the group slug in the
URL for a wiki article. We could do the same. There may even be a
common pattern we can document.
3. will topic views be group-type-specific?
I'm not even sure how to make this so if we wanted to, short of just
dispatching to different functions based on group type which I guess
would work. But maybe we don't even need to do this. It depends if the
topic view needs to do group-type-specific things. Wikiapp just has a
single view regardless of whether its a tribe wiki, project wiki or
whatever. The group is always available. It does mean that all groups
need to follow certain conventions or there need to be adaptor
functions for doing things like checking membership and checking
permissions. Again, we could note the common patterns in wikiapp and
reuse them (there may even be code we can factor out)
4. will topic templates be group-type-specific?
wikiapp does not do this but I think we might need to support it. The
fact wikiapp doesn't do this can be seen in the fact that if you go to
a wiki page under a tribe, the tribe tab is no longer selected. I'm
not sure how to address this short of the view looking for a template
called (say) <group_type>_topic.html before falling back to topic.html
I definitely welcome thoughts on this.
5. will topic notifications be group-type-specific?
When someone replies to a topic in a tribe now, the topic creator gets
a "tribes_topic_response" notification. In 0.7 we would have two
choices: just have a generic "topic_response" notification (i.e. you
can't control tribe and project responses separately) OR support
notification type label conventions like "<group_type>_topic_response"
3, 4 and 5 all talk about naming conventions which can sometimes feel
a bit too magical but I'm not sure of a better way.
I welcome your feedback and thoughts
James