urlpatterns question

2008-12-01 Thread Earl Lapus
hi all, I'm new to django and python. I have a small question about urlpatterns and it may sound silly to some so please bear with me. I noticed a bit of difference between a urlpatterns callback function of an admin site from that of an app. The callback function for an app requires single quot

Re: urlpatterns question

2008-12-01 Thread Earl Lapus
On Mon, Dec 1, 2008 at 10:06 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: >> >> So, what is the difference between a callback function that is >> enclosed on single quotes from that which is not? > > Nothing really: > > http://docs.djangoproject.com/en/dev/topics/http/urls/#passing-callable-objects

Re: urlpatterns question

2008-12-01 Thread Earl Lapus
On Tue, Dec 2, 2008 at 9:50 AM, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > Yes, because admin.site.root isn't a function. It's a method on a class > (which implies a difference in the way things are called). > > There's a bit of history going on here: in the early days, all the view > fun

question about the DEBUG setting

2009-07-16 Thread Earl Lapus
hi all, This is a silly newbie question, so please bear with me :D Example: ... def DoSomethingAwful(request): if __debug__: DoDebugStuff() ProcessRequest() ... In the example above, I want django to call DoDebugStuff() *ONLY* if I'm running my app on my development environment. So, my q

Re: question about the DEBUG setting

2009-07-16 Thread Earl Lapus
> > > > Make the code dependent on checking settings.DEBUG directly? > > Karen > > Oh, I didn't know that my app can get the settings.DEBUG value... I'll try this out, I think this will do. Thanks! -- There are seven words in this sentence. --~--~-~--~~~---~--~~ Y

model name ending with an 's'

2009-07-17 Thread Earl Lapus
hi, I have a model named 'Services'. I added it to the admin page and an extra 's' was appended to the name (see attached file). I grep'd through my project directory and I'm pretty sure that there are no text that matches 'Servicess'. So, is django the one altering the model name? If so, is there

Re: model name ending with an 's'

2009-07-17 Thread Earl Lapus
On Sat, Jul 18, 2009 at 1:54 PM, Alex Gaynor wrote: > > > You can provide verbose name, and verbose name plural to control that: > http://docs.djangoproject.com/en/dev/ref/models/options/#verbose-name > > Alex > > It works! Thanks a lot! -- There are seven words in this sentence. --~--~---

ModelMultipleChoiceField - override validation

2021-11-19 Thread Earl Lapus
Hi, I have a ModelForm that has a ModelMultipleChoiceField. In the said field, I've set the queryset to none and assigned the FilteredSelectMultiple as the widget for the field. It looks like this: class MyForm(forms.ModelForm): myfield = ModelMultipleChoiceField( queryset=SomeMode

Re: ModelMultipleChoiceField - override validation

2021-11-22 Thread Earl Lapus
I was able to resolve this by overriding `clean()` instead of `to_python()`. In there, I've the set correct queryset to use for validation. I still could not explain why `to_python()` is not called. On Saturday, November 20, 2021 at 8:38:47 AM UTC+8 Earl Lapus wrote: > Hi, >