Re: admin view

2010-12-07 Thread commonzenpython
thanks for your reply, iv been reading the documentation, and wrote the code, but theres one thing im having trouble with, i included the signal connection in my models.py, and passed the model that was there to the handler function so that it can be tied to that specific model, like so class foo(

Re: admin view

2010-12-07 Thread Wayne Smith
To fire off an action (method) after an object is saved, you want to listen for its signal. Check out http://docs.djangoproject.com/en/dev/topics/signals/ On Mon, Dec 6, 2010 at 11:28 PM, commonzenpython wrote: > hey guys, im trying to get a script to run, like a view after a user > in the admi

Re: Admin view: History log

2009-04-05 Thread Karen Tracey
On Sun, Apr 5, 2009 at 4:08 AM, EagerToUnderstand wrote: > > With regards to the history log on models in the admin view. > > I am adding instances of models via the db api (model.save()) > method. When such a model is opened (but not edited) and then saved > for the first time in the admin mod

Re: Admin view - merge two tables? (potentially bad db design)

2009-02-02 Thread Carl Meyer
On Feb 2, 6:44 pm, Zbigniew Braniecki wrote: > How can I overwrite the way Questions are selected so that when they > are returned by Question.objects.get('x') or Question.objects.filter() > or Question.objects.all() they are already joined with > QuestionProperties values? Try select_related()

Re: Admin view - merge two tables? (potentially bad db design)

2009-02-02 Thread Zbigniew Braniecki
On Feb 2, 7:24 am, Carl Meyer wrote: (...) > The other downside is the extra administration complexity, which is > the meat of your question.  Fortunately Django's admin can help you > out, and it's quite easy: look into inlines[1]. > > [1]http://docs.djangoproject.com/en/dev/ref/contrib/admin/#

Re: Admin view - merge two tables? (potentially bad db design)

2009-02-02 Thread Carl Meyer
This database design will result in lots of joins, but it's perfectly normalized and very flexible. Fine if you expect low traffic and you need the flexibility. The other downside is the extra administration complexity, which is the meat of your question. Fortunately Django's admin can help you

Re: Admin "View on site" link broken

2006-08-27 Thread Alan Green
On 8/27/06, Michael van der Westhuizen <[EMAIL PROTECTED]> wrote: > On 8/27/06, Alan Green <[EMAIL PROTECTED]> wrote: > > I'm having a problem with the Admin "View on site" button. According > [snip] > > My model objects have a get_absolute_url() method, and the View on > > site button appears as

Re: admin-view, password-md5 problem

2005-12-30 Thread gabor
On Fri, Dec 30, 2005 at 05:13:52PM +, Afternoon wrote: > > > Django developers: when people start using monkey patches to get > around issues, it's time to prioritise fixing them properly. > > This has been discussed many times and several solutions proposed. > > Worse things could happe

Re: admin-view, password-md5 problem

2005-12-30 Thread Afternoon
Django developers: when people start using monkey patches to get around issues, it's time to prioritise fixing them properly. This has been discussed many times and several solutions proposed. Worse things could happen that just using this as the template for a patch. On 28 Dec 2005,

Re: admin-view, password-md5 problem

2005-12-27 Thread Burhan
I found this "hack" that does it very nicely. Forgot who gave me the link; and the link itself :( from django.models.auth import User def user_pre_save(self): if not self.password.startswith('sha1$'): self.set_password(self.password) User._pre_save = user_pre_save Add this in your mode

Re: admin-view, password-md5 problem

2005-12-27 Thread oggie rob
> but in the user-management part, the password has to be entered in an > md5-hashed form. hi gabor, I've been thinking about this as well and my solution is probably going to be something like the following: 1) Create a custom form with only the username/password/confirm fields. This will take

Re: admin-view, password-md5 problem

2005-12-27 Thread James Bennett
On 12/27/05, gabor <[EMAIL PROTECTED]> wrote: > how do other django developers solve this problem? > do they create a separate view to handle user management? I've been lobbying forever to just have a _pre_save hook added which hashes the password, and I'd imagine that'd be the most expedient way