Re: Models - getting specific attributes question

2008-10-02 Thread WillF
ile.objects.get(pk=1) >>> attribute = 'name' >>> getattr(user_profile, attribute) > John > > Hope that helps, Mn > > > On Oct 2, 10:47 am, WillF <[EMAIL PROTECTED]> wrote: >> Hi I'm new to django. Is there way to get a specific column from a >

Models - getting specific attributes question

2008-10-02 Thread WillF
Hi I'm new to django. Is there way to get a specific column from a specific table in a database when using Models. Say for instance I wanted just a list of user's firstnames or something. Also, with a instance of a Model, say for instance, UserProfile, is there a way to get an arbitrary

Admin Pages and ManyToMany Relationships

2008-10-01 Thread WillF
I have a Profile model that has a manytomany relationship with a model called Group. When I look at the admin pages for a specific profile say for instance 'testprofile'. For the Groups field I see the entire list of all groups and not just the ones related to 'testprofile'. Any ideas as to why

Re: HttpResponseRedirect or render_to_response

2008-09-19 Thread WillF
Okay Thanks. So say for a login, should that be redirect? Would there be a way to pass a context using the redirect much like you can with render_to_response? On Sep 18, 5:24 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Sep 18, 4:26 pm, WillF <[EMAIL PROTECTED]> wrote

Possible to use url tag to direct to a page without a view?

2008-09-18 Thread WillF
Hi I currently have a page without a view. The corresponding url in the url.py uses the generic view direct_to_template, is there any way I could create a link to this url using the url template tag? Thanks -- View this message in context:

HttpResponseRedirect or render_to_response

2008-09-18 Thread WillF
Hey I'm just picking django , and I have a question. What is the difference between httpresponseredirect and render_to_response? When should I use which? Thanks! -- View this message in context: http://www.nabble.com/HttpResponseRedirect-or-render_to_response-tp19561038p19561038.html Sent

Re: Reusable views from a template - How?

2008-09-17 Thread WillF
David Durham, Jr. wrote: > > > On Wed, Sep 17, 2008 at 1:35 PM, WillF <[EMAIL PROTECTED]> wrote: >> I have written a login view as I have followed the tutorial but how do I >> reuse this view in multiple pages of the site? >> >> Is there a way

Reusable views from a template - How?

2008-09-17 Thread WillF
I have written a login view as I have followed the tutorial but how do I reuse this view in multiple pages of the site? Is there a way to render this particular view as part of a template, so I could have the login form (or anything for that matter) be displayed on every single page? -- View

How do I get the domain the application is running on?

2008-09-17 Thread WillF
How does one get the domain the application is running on? I have an email template where I pass in a url , obviously the url needs to be fully qualified. How do i make it so that I do not have to hardcode the domain, so the application can run on different environments without changing

Application Best Practices - Please advise!!

2008-09-17 Thread WillF
Hi I am new to django and python, and I have a question about best practices with regards to applications. From what I understand applications should be pluggable and portable to other "projects". So When do you know to start a new application? For instance if I am working on a social