Re: is_member_of method for user objects

2006-02-11 Thread Max Battcher
Roberto Aguilar wrote: In my situation, what I wanted to do was limit the display of a bunch of menu items depending on the group of the user. I accomplished this with a for loop and a test for a group: {% for group in user.get_list %} {% ifequal group 'desired_group' %} [...] It's a two-step

Re: Django+Postgre+Apache+Windows

2006-02-11 Thread Tom Tobin
Okay, smack me for reading the subject line one second after hitting Send. :-p On 2/12/06, Tom Tobin <[EMAIL PROTECTED]> wrote: > On 2/11/06, David S. <[EMAIL PROTECTED]> wrote: > > > > Sorry for the lack of details, but any guidance is appreciated. > > That's where I'd start — more details. ;-)

Re: Django+Postgre+Apache+Windows

2006-02-11 Thread Tom Tobin
On 2/11/06, David S. <[EMAIL PROTECTED]> wrote: > > Sorry for the lack of details, but any guidance is appreciated. That's where I'd start — more details. ;-) Can you tell us, e.g., what platforms the two machines are running?

Django+Postgre+Apache+Windows

2006-02-11 Thread David S .
I have followed the docs to the letter regarding my mod_python setup but I am having a frustrating experience with Apache falling over. I can not seem to find a foothold for solving this and I thought I would ask if anyone has advice or has seen (and fixed!) anything like this. The behavior is

Re: subclasses reverse field order

2006-02-11 Thread Kenneth Gonsalves
On Sunday 12 Feb 2006 3:38 am, you wrote: > I have the same problem as described below. How did you solve it? i didnt solve it - i just stopped subclassing classes where one has to remove fields from the original class. I only subclass where i have to add fields - this doesnt mess up the order

Re: custom admin view for edit_inline object

2006-02-11 Thread Robert Wittams
> Okay, I get it now. Sorry, I need to read more carefully. It would save > me a lot of time. > > Colleen No worries, just glad someone is finding this stuff useful ;-) Robert

Re: Is context variable 'user' automatic in templates?

2006-02-11 Thread Luke Plant
On Saturday 11 February 2006 22:00, Roberto Aguilar wrote: > I've noticed that in certain instances, in a flatpage, for example, > the user context variable is available in my templates. However, > most of the time I have to explicity provide it like when using > render_to_response. Is this a b

Is context variable 'user' automatic in templates?

2006-02-11 Thread Roberto Aguilar
Hello, I've noticed that in certain instances, in a flatpage, for example, the user context variable is available in my templates. However, most of the time I have to explicity provide it like when using render_to_response. Is this a bug, feature, or am I just not doing something right? Thanks

Re: custom admin view for edit_inline object

2006-02-11 Thread Colleen Owens
On 11 Feb, 2006, at 06.55, Robert Wittams wrote: > I do not know how to make it any clearer than that. MyBoundRelatedObject > is a class. > > You do *not* need to make up a new constant like TABULAR. It is purely a > mechanism that allows people to specify the tabular view or whatever > without ma

Re: is_member_of method for user objects

2006-02-11 Thread Roberto Aguilar
In my situation, what I wanted to do was limit the display of a bunch of menu items depending on the group of the user. I accomplished this with a for loop and a test for a group: {% for group in user.get_list %} {% ifequal group 'desired_group' %} [...] It's a two-step process rather than one,

Web Services

2006-02-11 Thread ChaosKCW
Hi I have read the web services link and done some research but nothing stands out. I am interested in designing and application around the web services model. That is I want the core backend functions as standalone in that they can be hooked up via any front end ie XML-RPC or SOAP etc.. eve

Version 1.0 Features

2006-02-11 Thread ChaosKCW
Hi I have looked all over the roadmap etc.. and cant find any dates on the features. The most important feature for me is the transaction support in the ORM layer. Does anyone have any ideas on the progress or timeline for this ? Thanks,

Re: Background process?

2006-02-11 Thread hugo
>I have a repetitive background task I'd like to run in my Django >environment, for example, once a minute. What's the best way to do >this? Currently, I run a cron job that executes a Python script, >imports the Django modules it needs, and does its work. But this means >configuring this cron

Re: Background process?

2006-02-11 Thread Adrian Holovaty
On 2/11/06, Ned Batchelder <[EMAIL PROTECTED]> wrote: > I have a repetitive background task I'd like to run in my Django > environment, for example, once a minute. What's the best way to do > this? Currently, I run a cron job that executes a Python script, > imports the Django modules it needs,

Background process?

2006-02-11 Thread Ned Batchelder
I have a repetitive background task I'd like to run in my Django environment, for example, once a minute. What's the best way to do this? Currently, I run a cron job that executes a Python script, imports the Django modules it needs, and does its work. But this means configuring this cron job o

Re: relating ManyToMany to itself

2006-02-11 Thread Russell Keith-Magee
On 2/6/06, Brice Carpentier <[EMAIL PROTECTED]> wrote: > > Hi, > I've got an Article object (what a surprise !), and was willing to > relate it to other articles > My initial plan was to use a ManyToMany relationship, but it doesn't > seem to be possible (I tried specifying "self"). > I also tried

Re: displaying a foreign key in admin list and template exception

2006-02-11 Thread Robert M.
Hello, first of all big "Thank You" to Django developers! Sorry for connecting to this thread, but I seem to have a similar problem ? My model is as follows: // model start from django.core import meta class Customer(meta.Model): name = meta.CharField(maxlength=20, blank=False) last = meta.

Re: displaying a foreign key in admin list and template exception

2006-02-11 Thread Andu
Removing to_field makes it work ok. I will investigate it more and file a ticket if appropiate. I also solved the template exception by making TEMPLATE_DEBUG=False. It came up that the error was the fact that __repr__ returned an int, not a string. Andu

Re: is_member_of method for user objects

2006-02-11 Thread Russell Keith-Magee
On 2/11/06, Luke Skibinski Holt <[EMAIL PROTECTED]> wrote: > > > Would it be possible for me to use this function within a template > > {% if user.is_member_of:"blah" %} > > I think calling functions with parameters from within a template was > deliberately not included for security and simplicity

Re: How to find the label for a value

2006-02-11 Thread Luke Plant
On Saturday 11 February 2006 13:14, Luke Plant wrote: > context['choices'] = CHOICES.items() Just remembered - this doesn't guarantee ordering, you'll need to handle sorting of the choices list somehow. Luke -- Life is complex. It has both real and imaginary components. Luke Plant ||

Re: locale settings

2006-02-11 Thread TT
Thanks. I'll do so then.

Re: recursive template calls

2006-02-11 Thread Luke Plant
On Saturday 11 February 2006 12:08, Robert Wittams wrote: > If you don't learn how to use at least > simple_tag and inclusion_tag, you will get annoyed quite often. That's fairly easy for you to say -- you wrote them! Documentation on these tags is fairly hard to come by - nothing in the offic

Re: How to find the label for a value

2006-02-11 Thread Luke Plant
On Saturday 11 February 2006 10:53, PythonistL wrote: > > Choice 1 > Choice2 > > > It is easy to find the value( here 1 and 2) but how, in Django , can > I find the label( here Choice 1 and Choice2) ? > E.g. when a user chooses the first option, I need to know that the > choosen label

Re: displaying a foreign key in admin list and template exception

2006-02-11 Thread Luke Plant
On Friday 10 February 2006 23:28, Andu wrote: > Now, addinga a currency works fine. Trying to add a customdata, when > saving, yelds a template exception. I've read on this group that this > might be because something's wrong in the model. Any ideas? The only thing that is unusual in your model

Re: recursive template calls

2006-02-11 Thread Robert Wittams
Shannon -jj Behrens wrote: >> You don't *need* recursion on templates for threaded messages like >>your example app, that's exactly the point :) > > > Julio, with all due respect for your programming prowess, I *like* > recursion. It can often make hard problems easy, even when generating > HT

Re: custom admin view for edit_inline object

2006-02-11 Thread Robert Wittams
Colleen Owens wrote: > On 09 Feb, 2006, at 13.21, Robert Wittams wrote: > > > > I'd be happy to write this up once I get it working. The problem I'm > having right now is that there seems to be no elegant way of updating > the dictionary bound_related_object_overrides in admin_modify.py to le

How to find the label for a value

2006-02-11 Thread PythonistL
Hi, Let's suppose we have the drop-down menu in a template Choice 1 Choice2 It is easy to find the value( here 1 and 2) but how, in Django , can I find the label( here Choice 1 and Choice2) ? E.g. when a user chooses the first option, I need to know that the choosen label was Choice

Re: is_member_of method for user objects

2006-02-11 Thread Luke Skibinski Holt
> Would it be possible for me to use this function within a template > {% if user.is_member_of:"blah" %} I think calling functions with parameters from within a template was deliberately not included for security and simplicity reasons. This doesn't stop you from evaluating it in the view or writ

Re: Bug in MultiValueDict?

2006-02-11 Thread Andrew Degtiariov
Hi Andrew,This isn't a bug -- it's intended behavior. When you access an element in a MultiValueDict, it returns the last item, as a string. See thedocs for more info:http://www.djangoproject.com/documentation/request_response/#querydict-objects If you want to get a list instead of a string, usedat

Re: locale settings

2006-02-11 Thread hugo
>And those date hierarchy filters were displayed like they should be >displayed. I mean translated. This was because date formatter uses >strftime, which uses locale settings. Yeah, but that only works with a single locale - many apps need per-request locales, that's the reason why date formattin