Re: Overriding returned contents of user objects

2008-04-13 Thread Tane Piper
Hi again, I seem to have come a cropper with this. Although it returns the fields I want on other models, on my Project model it seems to affect it's functions and attribues For example, in this line: projects = [project for project in Project.projects.all() if project.get_permissions(requ

Re: Overriding returned contents of user objects

2008-04-13 Thread Tane Piper
Hi Malcolm, values() seems to be the way to go for now. I've extracted some of the code back to a context variable, and anything within a view I'll just have to try and make it as efficient as possible, while still removing the user object from the context. On Sun, Apr 13, 2008 at 11:59 AM, Mal

Re: Overriding returned contents of user objects

2008-04-13 Thread Malcolm Tredinnick
On Sun, 2008-04-13 at 11:46 +0100, Tane Piper wrote: [...] > What I want to > know is there any way I could simplify the method and have it remove > the password field any time a user object is being selected as part of > a related query?? Not really, unless you use values(). For any model, if

Overriding returned contents of user objects

2008-04-13 Thread Tane Piper
Hi there, I'm currently building a Django app that uses JavaScript and Ajax. One of the things I am doing is within each view, as well as outputting a variable as standard, I also JSON encode any objects on the page and return them as well, so when the page loads, they are in the DOM as values I