Hi all,

Maybe I'm asking the wrong questions, maybe I'm asking the impossible,
maybe I need to do the hard thinking myseld. Anyway: here's my
problem.

We have a bunch of projects (about 4 big customers), some of which
have significant overlap. The current approach is copy/paste,
supported by tools such as mercurial for cross-project patching. This
is not maintainable on the long run.

I've decided to work towards an "architecture" of apps. Everything
that does some small bunch of related things is an app, apps can be
dropped in to projects, projects define actual sites and their
particularities.

Now for the fun part: one of our bigger projects which lives in 3 (hg
forked) forms (2 for big customers and 1 for ourselves as an eat-your-
own dogfood) has this idea of what we call a "Realm". Read "company",
"site" or "user" for "realm". It basically means that (almost) all
model instances are only relevant for that particular realm. (Off
course, in particular cases cross realm goodies happen, which is the
reason to throw the stuff on a pile in the first place)

So say for this family of projects tracking of expenses is something
we do. This would mean that we can

A: add/delete/edit/view expenses
B: I can do this, but some other people have expenses of their own to
track

Now, looking at some speeches/talks/blogs on the internet the
recurring theme for apps is "as small as possible". So I'd say my app
is "expense tracking" Not: expense tracking "within the context of
'klaas'"

Now this is not entirely academic, because our second family of
projects has no such concept of "realm". So I'd like to be able to
make a bunch of apps "expense tracking", "basic billing", "time
tracking", etc etc. and put this whole concept of realms on top of it
later. Or as a separate decision at least.

One of the options that was discussed on the IRC when I brought this
up was "Abstract models". But I'm not really sure if that would lead
anywhere. It would mean introducing a whole layer of "abstract" stuff
which is not abstract at all in reality (the whole point of the
exercise would be that I can use the original "expense" out of the
box). Also: Django should not be Java. (and isn't as far as I'm aware)

Another idea (I tried this myself but it didn't work) was simply
moneky-patching an extra field in as an afterthought. It did not work
'cause the django magic is not also patched. Also: about 4 people
started warning me when I suggested this on IRC.

So what's the official/preferred/right way to go forward? I can hardly
believe I'm the first to encounter the need for orthogonality on the
model level?

thanks a lot,
Klaas

-- 
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