Re: How to use form fields

2006-03-24 Thread PythonistL
Limodou, Thanks a lot.That is what I need. Regards, L. --~--~-~--~~~---~--~~ 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 thi

Re: apache threading - 'QueryDict' object has no attribute '_mutable'

2006-03-24 Thread Eugene Lazutkin
The patch is in the Trac: http://code.djangoproject.com/ticket/1539. I've submitted both versions for the Django trunk and the magic-removal branch. Big thanks to Alex Brown for finding the bug and testing the fix. Thanks, Eugene Alex Brown wrote: > Ivan Sagalaev wrote: >> I think so too...

Re: Advice on developing with django for a team of 10+

2006-03-24 Thread [EMAIL PROTECTED]
tonemcd wrote: > Oooh, now that's neat. My own tinkering with svn to ignore .pyc files > hasn't worked out so well... > > % svn proplist > Properties on '.': > svn:ignore "svn proplist -v" prints the property value as well. > % svn st > M magic/site1/modeltest/models.pyc > > hmmm... unl

Re: Need help for query, how could i do this with django ? or a raw SQL.

2006-03-24 Thread coulix
i got it working : def _module_get_top_users(limit): cursor = db.cursor() cursor.execute(""" SELECT auth_users.username, COUNT(*) AS count FROM auth_users, recettes_recipes WHERE auth_users.id=

Re: Extreme file uploading

2006-03-24 Thread Ivan Sagalaev
arthur debert wrote: >Regarding memory usage on the server, AFAIK this is something related >to cgi.FieldStorage. more about this here: >http://groups.google.com/group/django-developers/browse_frm/thread/2c379ec0fa30804a/# > >It would be great to have a streaming option, but aparentely this is >t

Re: Preformatted text in templates

2006-03-24 Thread limodou
On 3/25/06, Hari <[EMAIL PROTECTED]> wrote: > > Hi, > > I am quite new to Django; been working on an app using Django for 3-4 > days. > > I have a need to show large piece of text as is. I had issues with > linebreaks, which I solved using > {{ text|linebreaks }} > > Now, the problem is with white

Re: apache threading - 'QueryDict' object has no attribute '_mutable'

2006-03-24 Thread Alex Brown
Ivan Sagalaev wrote: > I think so too... I was investigating Alex's report and it looks like > somewhere onr thread is creating a QueryDict and another tries to access > it while it's being created. It's the only place where it doesn't > contain self._mutable. > > This may mean that mod_python som

Re: Need help for query, how could i do this with django ? or a raw SQL.

2006-03-24 Thread Andy Dustman
On 3/24/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > coulix wrote: > > Hello, > > I was trying to play with custom query but i didnt manage to get it > > working, > > I too could not get the custom query from the API reference working: > > polls.get_list( > select={ > 'choice_c

Preformatted text in templates

2006-03-24 Thread Hari
Hi, I am quite new to Django; been working on an app using Django for 3-4 days. I have a need to show large piece of text as is. I had issues with linebreaks, which I solved using {{ text|linebreaks }} Now, the problem is with whitespaces. I have to display them as is. One of the solutions is

Re: Advice on developing with django for a team of 10+

2006-03-24 Thread nate-django
On Thu, Mar 23, 2006 at 09:23:30AM -0800, tonemcd wrote: > Oooh, now that's neat. My own tinkering with svn to ignore .pyc files > hasn't worked out so well... The way I did it was to edit my ~/.subversion/config file. There is a section, "[miscellany]" that includes a "global-ignores" option.

Re: How to use form fields

2006-03-24 Thread limodou
On 3/25/06, PythonistL <[EMAIL PROTECTED]> wrote: > > I use a custom manipulator that creates field_names.These filed names > can be a different. To create fields I use > formfields.IntegerField(field_name="Pieces_"+`v`, maxlength=4) > where Dynamic_value changes. > > Normaly, for static field, I

Re: ASCII or PDF version of docs?

2006-03-24 Thread Glenn Tenney
On Fri, Mar 24, 2006 at 07:45:18PM -0600, James Bennett wrote: > Every time you download Django, you get a complete copy of the latest > version of the documentation, in ASCII format. As I've noted on one of the doc pages on the web, that's not quite correct... You don't get all of the model exa

Re: RSS Feeds - what am I doing wrong?

2006-03-24 Thread Bryan Murdock
I'm looking but I don't see anything you are doing wrong. It's been a while since I implemented my feeds and I vaguely remember maybe getting an error like that at one point. What you have looks a lot like what I have that works though. Sorry, I'm not helping much here, but I guess I didn't wan

Re: ASCII or PDF version of docs?

2006-03-24 Thread James Bennett
On 3/24/06, Francisco Reyes <[EMAIL PROTECTED]> wrote: > Is there an ASCII or PDF version of the documentation? Every time you download Django, you get a complete copy of the latest version of the documentation, in ASCII format. Look in the 'docs' directory of your copy of Django (or look here: h

Re: trying to get my first app up.

2006-03-24 Thread Luke Plant
On Friday 24 March 2006 16:49, sergio_101 wrote: > but no matter what happens, i get this: > > ViewDoesNotExist at /opps/ > Could not import learningOpps.opps.views. Error was: cannot import > name opps > > can someone tell me what i am doing wrong? Have you created __init__.py files in the rele

ASCII or PDF version of docs?

2006-03-24 Thread Francisco Reyes
Is there an ASCII or PDF version of the documentation? Specially installation, tutorial and overview. Tried to print them, but any line that is long, gets cutoff when printing from my FreeBSD desktop at work.. Will try a windows machine at home.. but it would be nice if the documentation was av

syntax error with tutorial1 in "python manage.py sql polls" step

2006-03-24 Thread maphew
Hi, at the ''python manage.py sql polls'' step of the [http://www.djangoproject.com/documentation/tutorial1/ poll tutorial] I get a syntax error: {{{ [EMAIL PROTECTED]:~/code/djtutor$ python manage.py sql polls Traceback (most recent call last): File "manage.py", line 11, in ? execute_manag

Re: Assigning default value for field in admin

2006-03-24 Thread arthur debert
If I read you right: http://www.djangoproject.com/documentation/faq/#how-do-i-automatically-set-a-field-s-value-to-the-user-who-last-edited-the-object-in-the-admin I've solved almost this problem in an app, but that's because I would get the user from the session cookie and put it on the request

Re: Need help for query, how could i do this with django ? or a raw SQL.

2006-03-24 Thread [EMAIL PROTECTED]
coulix wrote: > Hello, > I was trying to play with custom query but i didnt manage to get it > working, I too could not get the custom query from the API reference working: polls.get_list( select={ 'choice_count': 'SELECT COUNT(*) FROM choices WHERE poll_id = polls.id' } ) Tryin

Re: Extreme file uploading

2006-03-24 Thread arthur debert
Hi Andy. Regarding memory usage on the server, AFAIK this is something related to cgi.FieldStorage. more about this here: http://groups.google.com/group/django-developers/browse_frm/thread/2c379ec0fa30804a/# It would be great to have a streaming option, but aparentely this is trickier than it se

Re: admin apache

2006-03-24 Thread Adrian Holovaty
On 3/24/06, abe <[EMAIL PROTECTED]> wrote: > I get a blank screen (in the browser) and the > httpd error logs say : > > [Fri Mar 24 18:36:09 2006] [notice] mod_python: (Re)importing module > 'django.core.handlers.modpython' > [Fri Mar 24 18:36:17 2006] [notice] child pid 13817 exit signal > Segmen

Extreme file uploading

2006-03-24 Thread Andy Dustman
I'm working on a little app to manage a podcast RSS feed (believe it or not, someboody actually edits it by hand now). So my first thought was to use the FileField for uploading the enclosure. This worked fine except for one issue: The podcast in question is for video, and the files are typically

Re: numeric formatting

2006-03-24 Thread Eric Walstad
On Friday 24 March 2006 12:23, Jacob Kaplan-Moss wrote: > > I don't think that python built-in formatting can do this. (Am I > > wrong?) > > Actually, locale.format will do it for you, IIRC. >>> import locale >>> locale.setlocale(locale.LC_ALL, '') 'en_US.UTF-8' >>> locale.format("%d", 1234567, T

Re: How to change naming convention when creating models?

2006-03-24 Thread sam
Thanks for the pointer. I'm a little tired today. Should have found it myself ... --~--~-~--~~~---~--~~ 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

Re: numeric formatting

2006-03-24 Thread Jacob Kaplan-Moss
On Mar 24, 2006, at 1:48 PM, Rock wrote: > Is there a template filter for turning a large integer into a human > readable number? > > 1234567 --> 1,234,567 > 12345 --> 12,345 > > I don't think that python built-in formatting can do this. (Am I > wrong?) Actually, locale.format will do it for yo

Re: How to change naming convention when creating models?

2006-03-24 Thread Jacob Kaplan-Moss
On Mar 24, 2006, at 1:33 PM, sam wrote: > Waht about the table names? I'd like to remove the 's' at the end of > each name. You want to "db_table" option; this is documented in the Model API doc at http://www.djangoproject.com/documentation/model_api/#meta- options Jacob --~--~-~--~-

numeric formatting

2006-03-24 Thread Rock
Is there a template filter for turning a large integer into a human readable number? 1234567 --> 1,234,567 12345 --> 12,345 I don't think that python built-in formatting can do this. (Am I wrong?) Assuming there isn't already a simple filter that will do this, what do I need to learn about in

Re: How to change naming convention when creating models?

2006-03-24 Thread sam
Adrian, Thanks for your reply. Waht about the table names? I'd like to remove the 's' at the end of each name. Regards, Sam --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: ManyToManyField corrupts headers

2006-03-24 Thread Adrian Holovaty
On 3/20/06, burivuh <[EMAIL PROTECTED]> wrote: > This output occures before any legal HTTP header - so we get "Internal > Server Error" > May be it's just forgotten debug code? Hi burivuh, Thanks for pointing this out! Yes, it's forgotten debug code. I've removed that print statement and checked

Re: How to change naming convention when creating models?

2006-03-24 Thread Adrian Holovaty
On 3/24/06, sam <[EMAIL PROTECTED]> wrote: > I'd like to change the naming convention when creation Django models. > For instance I don't want to append "_id" to the foreign key field > name. It is apparently possible to change this behavior. Hi Sam, You can't change the naming convention on a g

Assigning default value for field in admin

2006-03-24 Thread Daniel Bimschas
Hi there, i'm currently writing my first Django application. I must say that Django is really what i've been searchin for for years. Right now I have a problem concerning the usage of the admin interface. I have a model like this: from django.core import meta from django.model

admin apache

2006-03-24 Thread abe
hi, trying to use the admin site vi apache/mod_python/mysql I get a blank screen (in the browser) and the httpd error logs say : [Fri Mar 24 18:36:09 2006] [notice] mod_python: (Re)importing module 'django.core.handlers.modpython' [Fri Mar 24 18:36:17 2006] [notice] child pid 13817 exit signal

Re: apache threading - 'QueryDict' object has no attribute '_mutable'

2006-03-24 Thread Eugene Lazutkin
Ivan Sagalaev wrote: >> > I think so too... I was investigating Alex's report and it looks like > somewhere onr thread is creating a QueryDict and another tries to access > it while it's being created. It's the only place where it doesn't > contain self._mutable. > > This may mean that mod_pyt

How to change naming convention when creating models?

2006-03-24 Thread sam
Hi All, I'd like to change the naming convention when creation Django models. For instance I don't want to append "_id" to the foreign key field name. It is apparently possible to change this behavior. Thanks in advance. Regards, Sam --~--~-~--~~~---~--~~ You re

Re: OneToOneField

2006-03-24 Thread olive
OK, you do, not the original poster. Anyway, I've heard that subclassing has been improved in MR. Why don't you use that instead ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to th

trying to get my first app up.

2006-03-24 Thread sergio_101
i am having a rough time getting my first app running.. i made a new project called "learningOpps" the admin works fine.. i set up a new application called "opps".. everything seems to have built just fine.. the problem is.. now, i added this to my urls: (r'^site_media/(?P.*)$', 'django

Re: Need help for query, how could i do this with django ? or a raw SQL.

2006-03-24 Thread Rock
Dropping down to the raw SQL level is easy... Assuming my_sql_command is a string with your select statement... from django.core.db import db cursor = db.cursor() cursor.execute( my_sql_command ) row = cursor.fetchone() result = row[0] You might prefer fetchall(), but I leave the data gather

How to use form fields

2006-03-24 Thread PythonistL
I use a custom manipulator that creates field_names.These filed names can be a different. To create fields I use formfields.IntegerField(field_name="Pieces_"+`v`, maxlength=4) where Dynamic_value changes. Normaly, for static field, I can use in a form {{form.FieldName}}. If fileds are generated

RSS Feeds - what am I doing wrong?

2006-03-24 Thread [EMAIL PROTECTED]
Hi. I'm trying to put together a feed for a specific blog in my system. I've been following the example at http://www.djangoproject.com/documentation/syndication/#a-complex-example Unfortunately, when I access the feed, I get: - - - - - - - - - - - - - - - - - - - - - - - - TypeError at /rss/bl

Re: OneToOneField

2006-03-24 Thread ChaosKCW
That would be why yours works, this is specific to MR as stated above. --~--~-~--~~~---~--~~ 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 unsu

Need help for query, how could i do this with django ? or a raw SQL.

2006-03-24 Thread coulix
Hello, I was trying to play with custom query but i didnt manage to get it working, for example this one whcih i found on the mail list : Polls.get_list( select={ 'choice_count': { db_table='choices', db_columns=['COUNT(*)'] kwargs={

Need help for query, how could i do this with django ? or a raw SQL.

2006-03-24 Thread coulix
Hello, I was trying to play with custom query but i didnt manage to get it working, for example this one whcih i found on the mail list : Polls.get_list( select={ 'choice_count': { db_table='choices', db_columns=['COUNT(*)'] kwargs={

MR Branch - list_filter with ForeignKey -- Help

2006-03-24 Thread ChaosKCW
Hi I am trying to get the list_filter to work with a ForeignKey field in the admin site. It works fine with with a standard charfield with choices, but when I move those values out into a seperate model and add the filter fields in to the list I dont get filters on the right hand side. I searche

Re: OneToOneField

2006-03-24 Thread olive
No, an up to date svn trunk. --~--~-~--~~~---~--~~ 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 [EM

A newbie question about log files

2006-03-24 Thread Vladimir
Hi I am hosting my Django webapp on DreamHost. No real problems so far. And let me just say: I really like the work you've done with Django. Simple and cohesive. Anyway, back to my problem. As I said, everything works fine, but I am chasing this bug I only seem to have when I deploy. I do an AJA

Re: OneToOneField

2006-03-24 Thread ChaosKCW
Hi Are you using the MR Branch for the OneToOne on User ? Thx, S --~--~-~--~~~---~--~~ 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 unsub

Re: SQL Debugging and limit_choices_to in MR Branch

2006-03-24 Thread ChaosKCW
Glad you solved it, PS the patch wasnt done by me BTW. Kudos to Luke. --~--~-~--~~~---~--~~ 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 unsub

Re: OneToOneField

2006-03-24 Thread olive
Strange, OneToOne works pretty well for me to extend User model (I would prefer to subclass but without having new database tables). On the contrary, I had many problem with OneToOne to extend my own model(s), I use ForeignKey with intermediary model and Inline Edit instead. hth --~--~

Re: apache threading - 'QueryDict' object has no attribute '_mutable'

2006-03-24 Thread Ivan Sagalaev
Eugene Lazutkin wrote: >Alex: I'll look into this problem. Most probably there is a racing >condition in multithreaded Django. It doesn't look like it is related to >database backends. > I think so too... I was investigating Alex's report and it looks like somewhere onr thread is creating a Qu

Re: Strings and % sign fails - Help Please

2006-03-24 Thread Siah
I see. Thanks, Sia --~--~-~--~~~---~--~~ 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 PROTE

Re: ManyToManyField corrupts headers

2006-03-24 Thread Russell Keith-Magee
On 3/24/06, John Szakmeister <[EMAIL PROTECTED]> wrote: > This output occures before any legal HTTP header - so we get "Internal> Server Error"> May be it's just forgotten debug code?Caveat: I'm not a Django developer.  I think you're right though, it's probably a bug, and it still exists on trunk/

Re: ManyToManyField corrupts headers

2006-03-24 Thread John Szakmeister
On Monday 20 March 2006 07:46, burivuh wrote: > Situation: > Django 0.91, common CGI through WSGI, many-to-many fields with only one > available choice > (for example, use flatpages and try to add new flat page - you'll see > error) > > Look at the line after #question target > > fields.py: > Many