Re: how to get {% url %} working with {% blocktrans %}?

2008-08-30 Thread Matthias Kestenholz
On Fri, Aug 29, 2008 at 10:55 PM, Martin Diers <[EMAIL PROTECTED]> wrote: > > There is a currently a discussion an even newer discussion on Dev, > where Jacob has proposed a new syntax, and has a patch that would > allow this: > > {% url django-admindocs-docroot as docroot %} > > Then docroot bec

Re: Getting things into entries

2008-08-30 Thread Matthias Kestenholz
On Fri, Aug 29, 2008 at 11:22 PM, Martin Diers <[EMAIL PROTECTED]> wrote: > > On Aug 29, 2008, at 2:22 PM, Benjamin Buch wrote: > >> >> Clumsy subject, I know... >> >> I know there was a recent discussion about this, but I lost it, so >> sorry for asking again. >> So here's the question: >> >> How

Re: inlineformset_factory

2008-08-30 Thread patrickk
here (http://dpaste.com/71450/) is an example for using inlineformset_factory (see better_author_edit). don´t know if this is much help though. maybe you can post your exact error-message. patrick. On Aug 30, 12:09 am, cmiller <[EMAIL PROTECTED]> wrote: > Hi All, > > I have been hitting my head

Type comparisons in templates - a Django wart?

2008-08-30 Thread AndyB
I read the following snippet with interest: http://www.djangosnippets.org/snippets/1010/ I am trying to lock that tightly into brain as I can imagine being tripped up by that and ending up completely confused as to why my code doesn't work. Does anyone else think that there should be an elegant

Problem with global variables in modules

2008-08-30 Thread mwebs
Hello, this is more a python-specific problem then a django one. I have 2 modules #a.py: global filebuffer filebuffer = [] #b.py print filebuffer --> filebuffer not defined ___ Do I have to import a.py? but I want to work on the same instance of filebuffer from both mo

Re: new be Many to many relation question

2008-08-30 Thread [EMAIL PROTECTED]
Sorry but I didnt get it :( (Perhaps you should actually call the field user rather than user) . Could you please explain more ? I tried to do following but couldnt get user information, In [36]: p = PU.objects.all() In [37]: p Out[37]: [, ] In [38]: for i in p: : i.user.id

Re: Problem with global variables in modules

2008-08-30 Thread mwebs
solved :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For

Re: new be Many to many relation question

2008-08-30 Thread Daniel Roseman
On Aug 30, 10:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Sorry but I didnt get it :( > (Perhaps you should actually call the field user  rather than user) . > Could you please explain more ? Sorry, that should have been "you should call the field users" - i.e. plural, because it refe

Changing the AuthenticationForm username's max_length field (impossible!?)

2008-08-30 Thread keltus
After many frustrating hours, I have yet to monkey patch the form.username variable from: to In my urls.py file, I added: from django.contrib.auth.forms import AuthenticationForm AuthenticationForm.base_fields['username'].max_length = 75 AuthenticationForm.base_fields['username'].label = "Email

Re: how to display custom messages in admin site

2008-08-30 Thread Bora Savas
Hi, You want to modify these messages or add your own messages ? If it's the latter, look at here; http://www.djangoproject.com/documentation/authentication/#messages You can simply create your messages; request.user.message_set.create(message="Your message comes here") On Aug 29, 10:15 pm

Unaccountable syntax error

2008-08-30 Thread Leaf
I'm having a problem when I try to validate my models. The interpreter somehow takes offense at this line: box_text_color = models.ColorField("Box Text Color") I'm using a custom "ColorField" here. What I don't understand is that it seems almost identical to this ColorField, which it did acc

photologue or: how to not escape html in the admin?

2008-08-30 Thread Benjamin Buch
Hi, I've installed photologue recently, and it's a great app. Works like a charm... The only thing that doesn't is the thumbnail preview in the admin. I think photologue spits out the correct html: http://127.0.0.1:8000/site_media/photologue/photos/cache/DSC04668_admin_thumbnail.JPG "> But th

Re: Unaccountable syntax error

2008-08-30 Thread Karen Tracey
On Sat, Aug 30, 2008 at 9:50 AM, Leaf <[EMAIL PROTECTED]> wrote: > > I'm having a problem when I try to validate my models. The interpreter > somehow takes offense at this line: > >box_text_color = models.ColorField("Box Text Color") > > I'm using a custom "ColorField" here. What I don't under

id problem with mysql and django models

2008-08-30 Thread eniac
Hello, I'm using django 0.96.1 on ubuntu. I'm going to describe the steps I went through until I encountered something odd. I create a model: class shoutbox(models.Model): name = models.CharField(maxlength=15) shout = models.CharField(maxlength=256) pub_date = models.Dat

Re: locale name conflict (deploy issue)

2008-08-30 Thread dcoy
oh sh*t, that was it! So stupid :) Thanks! On 24 Aug, 21:01, msaelices <[EMAIL PROTECTED]> wrote: > Maybe you have an __init__.py inside locale directory? > > On 16 ago, 13:12, dcoy <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm trying to deploy my django project to my VPN (CentOS 5 python > >

Re: Unaccountable syntax error

2008-08-30 Thread Leaf
Of course. I just look at the error actually occurs on, not the context. I guess even Python's awesome debugging still has limits. What happened was that I forgot a parenthesis at the end of the previous line. Thanks for giving me the tip. On Aug 30, 9:57 am, "Karen Tracey" <[EMAIL PROTECTED]> wr

Design question, Form using two models.

2008-08-30 Thread coulix
Hi, Like in many projects i use User from auth and my own Profile model. Except i have several profiles so Profile just holds a generic FK relationship; And ProfileFoo model has also a user Fk pointing back to User (its cleaner than using the generic reverse realtion which gives back a list) If

Re: Photologue Error: NoReverseMatch -- Reverse for 'pl-gallery' not found.

2008-08-30 Thread tonemcd
Check out this link, apply the patch and I think you'll see the problem (basically, whatever is being passed to {% url ... %} does not match the regex in urls.py). Cheers, Tone On Aug 30, 12:25 am, Jacolyte <[EMAIL PROTECTED]> wrote: > Here's a pastebin of the traceback:http://pastebin.com/m43f

Re: Photologue Error: NoReverseMatch -- Reverse for 'pl-gallery' not found.

2008-08-30 Thread tonemcd
The link would help :rolls eyes: http://groups.google.com/group/django-users/browse_thread/thread/eb5db61766a5dc07/a32ec2de4bd9ff0f?lnk=gst&q=noReverseMatch#a32ec2de4bd9ff0f On Aug 30, 3:12 pm, tonemcd <[EMAIL PROTECTED]> wrote: > Check out this link, apply the patch and I think you'll see the >

Re: Django new comments framework error

2008-08-30 Thread tonemcd
...and of course, I find that http://code.djangoproject.com/ticket/8221 is now fixed! That should help clear up an awful lot of confusion. As of r8672, it's in the trunk. Cheers, Tone On Aug 29, 7:40 am, tonemcd <[EMAIL PROTECTED]> wrote: > Also > seehttp://groups.google.com/group/django-user

Admin styles disappeared

2008-08-30 Thread Leaf
Yes, they did. After upgrading to the newer version of Django, I lost all styles for the admin site. When I tried to access the stylesheet it was trying to access, I got a 403 Forbidden error. (I'm using OS X's built-in Apache server to serve the admin media.) Is it necessary for me to use an alte

How to create a list of months from a date field.

2008-08-30 Thread djandrow
I'm basically trying to create a standard archive function. I have the following field in my models:entry_date = models.DateField(auto_now_add=True) I understand dynamic urls and templates and things, so i don't need help with that. What i need to know is how can i get a list of months w

Space added when including URLs

2008-08-30 Thread Leaf
I'm testing a styles app, and I tried this URL: http://localhost:8000/styles/css/test-style/ When I did that, it responded with a 404 error. It said it checked against the URLConfs I had included, which were: # /devsite/urls.py urlpatterns = patterns('', # Example: # (r'^devsite/', inc

Re: photologue or: how to not escape html in the admin?

2008-08-30 Thread Benjamin Buch
Okay, I've got it! > I've installed photologue recently, and it's a great app. > Works like a charm... > > The only thing that doesn't is the thumbnail preview in the admin. > I think photologue spits out the correct html: > > src="http://127.0.0.1:8000/site_media/photologue/photos/cache/DSC04668

Re: How to create a list of months from a date field.

2008-08-30 Thread Dmitry Dzhus
djandrow wrote: > I understand dynamic urls and templates and things, so i don't need > help with that. What i need to know is how can i get a list of months > which have entries in them, I'd apperciate any help. Use generic date-based view (under django.views.generic.date_based.) and see `date_

Re: photologue or: how to not escape html in the admin?

2008-08-30 Thread Malcolm Tredinnick
On Sat, 2008-08-30 at 15:52 +0200, Benjamin Buch wrote: > Hi, > > > I've installed photologue recently, and it's a great app. > Works like a charm... > > > The only thing that doesn't is the thumbnail preview in the admin. > I think photologue spits out the correct html: > > > src="http://

Re: Core keyword error

2008-08-30 Thread Frantisek Malina
Thank you guys for saving my follicles. I completely trusted the backward incompatible changes page so far, but now it miserably failed :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: id problem with mysql and django models

2008-08-30 Thread Malcolm Tredinnick
On Sat, 2008-08-30 at 06:56 -0700, eniac wrote: > Hello, > > I'm using django 0.96.1 on ubuntu. > I'm going to describe the steps I went through until I encountered > something odd. > > I create a model: > > class shoutbox(models.Model): > name = models.CharField(maxlength=15) >

Re: Space added when including URLs

2008-08-30 Thread Malcolm Tredinnick
On Sat, 2008-08-30 at 09:08 -0700, Leaf wrote: > I'm testing a styles app, and I tried this URL: > > http://localhost:8000/styles/css/test-style/ > > When I did that, it responded with a 404 error. It said it checked > against the URLConfs I had included, which were: [...] >1. ^admin/doc/

Having trouble creating admin form using TabularInline

2008-08-30 Thread jeffself
My model has 3 main classes, School, Contest, Participant. School contains the following fields: school_name, slug, nickname. Contest contains the following fields: date_scheduled, title, notes. Participant contains the following fields: contest (foreign key), school (foreign key), score I want

Re: How to create a list of months from a date field.

2008-08-30 Thread djandrow
I've had alook through http://www.djangoproject.com/documentation/generic_views/ but i'm still not clear on what to do. I might be being a bit think but could someone explain it to me. Regards, Andrew On Aug 30, 5:59 pm, Dmitry Dzhus <[EMAIL PROTECTED]> wrote: > djandrow wrote: > > I understand

Re: Having trouble creating admin form using TabularInline

2008-08-30 Thread Karen Tracey
On Sat, Aug 30, 2008 at 2:04 PM, jeffself <[EMAIL PROTECTED]> wrote: > > My model has 3 main classes, School, Contest, Participant. > > School contains the following fields: school_name, slug, nickname. > Contest contains the following fields: date_scheduled, title, notes. > Participant contains t

Translating Model Form Error Messages

2008-08-30 Thread Aaron
Hi, I'm working on a non-English site and need to replace the validation messages from ModelForm (e.g. 'This field is required.') What are some approaches that I can take? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Type comparisons in templates - a Django wart?

2008-08-30 Thread bruno desthuilliers
On 30 août, 11:41, AndyB <[EMAIL PROTECTED]> wrote: > I read the following snippet with > interest:http://www.djangosnippets.org/snippets/1010/ > > I am trying to lock that tightly into brain as I can imagine being > tripped up by that and ending up completely confused as to why my code > doesn

Re: Translating Model Form Error Messages

2008-08-30 Thread Malcolm Tredinnick
On Sat, 2008-08-30 at 12:57 -0700, Aaron wrote: > Hi, I'm working on a non-English site and need to replace the > validation messages from ModelForm (e.g. 'This field is required.') > What are some approaches that I can take? All those strings should already be translated. They're defined in dja

Re: Translating Model Form Error Messages

2008-08-30 Thread Aaron
Hi Malcolm, Thanks for the info. It'll save me a lot of time, now that I know where to look. Aaron On Aug 30, 1:03 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-08-30 at 12:57 -0700, Aaron wrote: > > Hi, I'm working on a non-English site and need to replace the > > validatio

Re: Type comparisons in templates - a Django wart?

2008-08-30 Thread AndyB
> Then you'd be tripped up and ends up completly confused by any raw > python code. Did you ever tried comparing a string and an int in > Python ??? Doh. I knew that. For some reason the fact that it was template code sent my brain to sleep. > > Does anyone else think that there should be an el

Re: Problem with global variables in modules

2008-08-30 Thread bruno desthuilliers
On 30 août, 11:46, mwebs <[EMAIL PROTECTED]> wrote: > Hello, > this is more a python-specific problem then a django one. Then please post it on c.l.py. > I have 2 modules > > #a.py: > > global filebuffer > filebuffer = [] You don't need the global keyword at the top-level of a module. You onl

Re: Type comparisons in templates - a Django wart?

2008-08-30 Thread bruno desthuilliers
On 30 août, 22:17, AndyB <[EMAIL PROTECTED]> wrote: > (next time - think>post instead of post>think...) Lol. Don't worry, we all face the same problem one day or another... > However. The fact we are in Django's template language with less of > the niceties of Python does change things. We ca

admin deployment

2008-08-30 Thread Chris Haynes
http://127.0.0.1:8000/admin/ works fine, and under fcgi other things work and https:admin/ gives me the admin login screen (without css formatting). But in response to the Log in button it directs to https:///admin/ which fails because the server only directs URLS beginning with https://https:

Re: id problem with mysql and django models

2008-08-30 Thread eniac
Thanks for the advice ! Everhting seems to work fine now. Only when I enter s.id it return nothing and when I print s.id it returns None. Guess that's normal since the s-object hasn't been saved yet ? On Aug 30, 7:13 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-08-30 at 06:56

Anyone want to join in a cool new project as a hobby

2008-08-30 Thread nycwebproject
Hi all, I'm building a website (www.meprice.com) to help consumers discuss, share, and seek pricing information for service-related transactions. The goal is to create pricing transparency for consumers to empower them to make better spending decisions and avoid being exploited by providers. The

Weird ImproperlyConfigured error

2008-08-30 Thread Julien Phalip
Hi, I've spent a couple hours trying to debug this, in vain... I'm setting up a very simple site. In that site I've copied/pasted the flatpages app to be able to extend it at will (I call the new app 'staticpages'). Everything works fine on the local machine running with the dev server. But whe

Re: Using http header information in settings.py

2008-08-30 Thread Greg Fuller
Thanks Graham. I guess I won't be hiking that trail. On Aug 29, 6:40 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Aug 30, 12:20 am, Greg Fuller <[EMAIL PROTECTED]> wrote: > > > Thanks for the replies. > > > I like the middleware solution, if you can modify settings variables > > during m

regroup tag

2008-08-30 Thread sholombc
how do i do a regroup under a regroup for example: Male: o George Bush o Bill Clinton Female: o Margaret Thatcher o Condoleezza Rice Unknown: o Pat Smith and then add another regroup for the age: Male:

Re: Getting things into entries

2008-08-30 Thread Martin Diers
>> > That's a really bad idea. Users can bring the whole site down with > malformed content if you do it like that. > > At least you should do something like that: > > try: >usercontent = render_to_string('whatever.html', {...}) > except TemplateSynatxError: # maybe other exceptions? >user

recursive templates

2008-08-30 Thread mmcduff
I am trying to create a contents list using the following sidebar_sub_contents.html. {% for content in contents %} {% if content.link %} {{ content.name }} {% endif %} {% if content.list %} {% with content.list as contents %} {% i

Re: recursive templates

2008-08-30 Thread Malcolm Tredinnick
On Sat, 2008-08-30 at 20:33 -0700, mmcduff wrote: > I am trying to create a contents list using the following > sidebar_sub_contents.html. > > {% for content in contents %} > {% if content.link %} > > {{ content.name }} > > {% endif %} > {% if content.li

Re: Changing the AuthenticationForm username's max_length field (impossible!?)

2008-08-30 Thread Julien Phalip
Keltus, The patch I mentioned in that thread solved the problem of validating the input. For the rendering of the form, you also need to patch the widget as follows: AuthenticationForm.base_fields['username'].widget.attrs['maxlength'] = 75 Note that here 'maxlength' doesn't take an underscore.

Re: Changing the AuthenticationForm username's max_length field (impossible!?)

2008-08-30 Thread Julien Phalip
As an alternative, you can also check the patch in ticket #8274 http://code.djangoproject.com/ticket/8274 It has been pushed post-1.0, but in the meantime it could be of some help for you. It gives full control on the form to use in the login view, and so allows you not to monkey-patch the code d

Django 1.0 and Textmate

2008-08-30 Thread Rodrigo Culagovski
Has anybody taken a crack at updating the Textmate Django bundles (python and template) for version 1.0? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Django SVN request.get_full_path() return main.fcgi?

2008-08-30 Thread Jason Cui
When I update django SVN yestoday, about from 0.97 to 1.0 beta2, the function request.get_full_path() return wrong value sometimes. When I locate url http://domain/detail/list/, this function return /main.fcgi/ detail/list/, but should be /detail/list/. Who can tell me why? Now I have to add repl

Re: Newbie Question - Regex Field to deal with Feet/Inches

2008-08-30 Thread Ronny Haryanto
On Fri, Aug 29, 2008 at 2:54 AM, bkev <[EMAIL PROTECTED]> wrote: > > Ronny, > > This is fabulous...thank you so very much. If you don't mind me > asking, can you give me an example of how you implemented this method > in your Class? In my case, I've defined the field as a DecimalField > type, but