Re: project root or its parent in pythonpath?

2012-01-06 Thread Waldek Herka
Hi, how about creating a proper package and installing it as an egg? That would be a proper way I think. See this tutorial: http://peak.telecommunity.com/DevCenter/setuptools It is only a matter of creating the setup.py with the list of the stuff you need to package, then you run(from the projec

Re: Way to identify affected rows from a delete in the admin

2012-01-04 Thread Waldek Herka
Hi, here is the essence: from django.contrib.admin.util NestedObjects collector = NestedObjects(using=None) collector.collect(User.objects.all()) to_delete = collector.nested() It gives you a raw list of all the objects. For more friendly output see the usage of NestedObjects.nested with the call

Re: Correct folder layout for a big Django application

2012-01-04 Thread Waldek Herka
Hi, I'd recommend 'reviewboard' - code.google.com/p/reviewboard/ I learned great deal from this application. It is very mature and well thought through. Cheers, Waldek On Jan 4, 6:51 pm, IgorS wrote: > Can someone recommend a big existing Django application with the > "right" folder layout? > > I

Re: How to get current session user in models.py?

2012-01-04 Thread Waldek Herka
to be aware of this penalty. Otherwise really good point again! For a broader use I'd go for your solution, my usecase is a bit different tough. Cheers Andy! On Jan 4, 4:04 am, Andy McKay wrote: > On Mon, Jan 2, 2012 at 12:25 PM, Waldek Herka > wrote: > > > c) local threading wa

Re: How to get current session user in models.py?

2012-01-02 Thread Waldek Herka
@Andy: I agree it may be convoluted a bit indeed.. but your alternative a) is not an option - I would not do it if I did not needed it, wouldn't I ;-) b) requires interface changes, sometimes it's even messier.. changing the signatures means you need make sure all the callers would accept that chan

Re: How to get current session user in models.py?

2012-01-02 Thread Waldek Herka
Hi, I actually have already sent this to Shawn, but thought it might be useful if I post to it a broader audience. Here is my solution to this problem: user = None outer_frames = inspect.getouterframes(inspect.currentframe()) for tpl in outer_frames: arginfo =