Pass subdomain to a view function.

2009-04-08 Thread Rodrigo C.
Is there a way to catch a subdomain and pass it to a view function? For example, if I have a site "sitename.com", and a user called "user1", I would like to be able to have "user1.sitename.com" be hooked into the user's profile, for example, so I'd need to be able to pass the subdomain to my

Limiting available fields in admin for non-superusers

2009-02-03 Thread Rodrigo C.
After following this article: http://www.b-list.org/weblog/2008/dec/24/admin/ I have managed to implement admin users editing and seeing only their own records (yay). However, I would like to be able to limit the fields users see based on if they're superusers or not (i.e.: superusers see all

Re: Limiting available fields in admin for non-superusers

2009-02-03 Thread Rodrigo C.
Never mind, it was easy. Basically, overriding the "get_form": def get_form(self, request, obj=None, **kwargs): if request.user.is_superuser: self.exclude = None On Feb 3, 5:42 pm, "Rodrigo C." <rodrigo...@gmail.com> wrote: > After follow

Re: Bound Inline Formset doesn't render FileField's current value, needs to be reentered.

2009-01-28 Thread Rodrigo C.
> Just a suggestion -- if the admin site does the sort of thing you want, then > taking a look at the admin code would probably be helpful in figuring out > how to do it. Sorry I don't know offhand without doing more digging than I > have time for what it does, exactly, but if it is showing a

Re: Bound Inline Formset doesn't render FileField's current value, needs to be reentered.

2009-01-28 Thread Rodrigo C.
Hi Malcolm, thanks for your reply. > So, perhaps you could give a small, reduced to the minimum, example of > how you're setting all this up. Maybe it's a problem in inline formsets, > or maybe it's an oversight in your code. At the moment, hard to tell. > I included the View and Model in my

Re: Bound Inline Formset doesn't render FileField's current value, needs to be reentered.

2009-01-27 Thread Rodrigo C.
> This isn't a Django issue. It's a standard property of browsers: you > can't set an initial value for file input fields. This is a security > measure, to stop malicious pages uploading files from your hard drive > without your explicit instruction. I see. If there's no way to set the initial

Bound Inline Formset doesn't render FileField's current value, needs to be reentered.

2009-01-27 Thread Rodrigo C.
I have model that represents a file, and has a FileField, that I am rendering via an Inline Formset. When a user fills in the form it gets saved with no problems. However, I want the users to be able to continue editing the file, but when I re-display the newly created object, the data for the

Facebook-like functionality for an Intranet

2009-01-22 Thread Rodrigo C.
I need to create an Intranet for a client. I would like to include some facebook-like functionality, such as being able to create and join networks, setting permissions based on membership in said networks, being notified when a friend or someone in your network updates his status, writes