Re: an error happened to apache2and wsgi

2011-01-05 Thread Graham Dumpleton
Which generally indicates that the HTTP client closed the connection before all of the response could be written back. There is no traceback because it is occurring after Django has returned the response and mod_wsgi is trying to write/flush it back to HTTP client. By rights the 'Exception occu

Re: Japanese Text Sort Order

2011-01-05 Thread James Hancock
Thanks I'll give that a shot. Just to clarify if I have the correct implementation in mind, would mylist list be a queryset of the items I want sorted? Also, I am not very familiar with the lambda syntax. Does x needs to be something? Or do I leave that part as is? Thanks, James Hancock On Thu

an error happened to apache2and wsgi

2011-01-05 Thread CCC
site has runned based on apache and wsgi for a long time very well,but recently happened an error like this: [Sun Jan 02 20:41:02 2011] [error] [client ] IOError: failed to write data [Sun Jan 02 20:41:02 2011] [error] [client ] mod_wsgi (pid=2716): Exception occurred processing WSGI script '/usr/l

Re: Japanese Text Sort Order

2011-01-05 Thread Sam Walters
Hi, Personally I would map the priority of every character in a dict and pass this to sorted: dd = { "cha1": 1, "char2": 2, "char3": 3, "char4": 4, } result = sorted(mylist, key=lambda x:dd[x[0]]) Point being if the db query isnt too slow you could use python. cheers sam_w

Re: Setup issue

2011-01-05 Thread Mike Ramirez
> on linux you have to type: > > 'python django-admin.py startproject projectname' > > I think your missing the python let me know if this sorts it out Forgot to add the executable bit must be set in the permissions i.e.: chmod a+x django-admin.py (though this is already done for you by the dja

Re: Setup issue

2011-01-05 Thread Mike Ramirez
On Jan 5, 1:34 am, TheRedRabbit wrote: > on linux you have to type: > > 'python django-admin.py startproject projectname' > Actually this is incorrect. see line 1 of django-admin.py[1] That line allows the python script to be ran as a regular command it is called the shebang [2]. The only tim

Re: Bug when OR'ing an empty Q() with a non-empty Q()?

2011-01-05 Thread Karen Tracey
On Mon, Jan 3, 2011 at 6:16 PM, Margie Roginski wrote: > I find that if I filter by ORing an empty Q() with a non-empty Q() > that I don't get the expected result. I would expect that this should > return all objects of the specified model that the empty Q() would > return. Let me use an example

Re: Displaying DB Values in a Dropdown Box

2011-01-05 Thread Shawn Milochik
A "choices" value should be a tuple or list containing two-value tuple or list containing the key and value for each dropdown option. Other issues with the code you originally posted: 1. What looked like a context (that dictionary containing "polls"), was being passed to the creation of a form,

Re: Beginner questions: on the official polls tutorial

2011-01-05 Thread Zheng Li
Thank you, Shawn. On Wed, Jan 5, 2011 at 8:24 PM, Shawn Milochik wrote: > 1. When you were running the development server, you were probably > executing from the www directory, so importing from 'mysite' would work. > When running in production, it has to be properly on the PYTHONPATH. > I actu

Re: Beginner questions: on the official polls tutorial

2011-01-05 Thread Shawn Milochik
1. When you were running the development server, you were probably executing from the www directory, so importing from 'mysite' would work. When running in production, it has to be properly on the PYTHONPATH. 2. You need the CSS and stuff for admin available on a server somewhere, and have your

Beginner questions: on the official polls tutorial

2011-01-05 Thread Zheng
I started with the official tutorial to build the polls app. Everything works fine. I then tried to use wsgi on Apache. Everything still works, though with some defects explained below. I have a few questions to ask as a beginner: Assume I create mysite under E:\www. 1. In the settings.py file, t

QuerySetManager breakage with r14389

2011-01-05 Thread Ian Clelland
Hi, I've been using Simon Willison's QuerySetManager[1] pattern for a while now, and since upgrading to Django 1.2.4, it has been breaking when I try to call a method on a RelatedManager constructed from it. There was a change in r14389 (14390 in the 1.2.X branch) which causes this code to break

Re: Displaying DB Values in a Dropdown Box

2011-01-05 Thread hank23
Actually I have been through the tutorial, but there are still a lot of gaps in the information presented, because many of the examples may or may not show all of the code in all of the various modules which is needed for everything to work together successfully. My next question is what is wrong w

Re: Displaying DB Values in a Dropdown Box

2011-01-05 Thread Shawn Milochik
You're not seeing anything for several reasons. There are just a lot of fundamental things about the way Django works that it seems you haven't gotten to yet in your learning. For now, I recommend you follow the tutorial -- do everything step by step so you can see how it works. That alone will

Displaying DB Values in a Dropdown Box

2011-01-05 Thread hank23
I'm trying to display DB data in a dropdon box on a screen using a form. Here's my form/formfield code: from django import forms class AddChoiceForm(forms.Form): ccount = forms.IntegerField() pquestion = forms.CharField() message = forms.CharField() polls = forms.ChoiceField(requi

Re: DateField and SelectDateWidget - How do you set the range for the widget?

2011-01-05 Thread Mike Seidle
Thank you. Problem solved. On Wednesday, January 05, 2011 03:58:59 pm Shawn Milochik wrote: > http://docs.djangoproject.com/en/dev/ref/forms/widgets/ > > Search for "year" on this page and it has what you need. > > Shawn -- Mike Seidle -- You received this message because you are subscribe

Re: DateField and SelectDateWidget - How do you set the range for the widget?

2011-01-05 Thread Shawn Milochik
http://docs.djangoproject.com/en/dev/ref/forms/widgets/ Search for "year" on this page and it has what you need. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsub

DateField and SelectDateWidget - How do you set the range for the widget?

2011-01-05 Thread Mike Seidle
Well, 2011 brought a bug I'm not sure what to do with. I have a view that contains a form that lets a user select a date range. The field is defined as start_date = forms.DateField(initial=date(d.year,d.month,1),widget=SelectDateWidget()) My problem is that as of the 1st of January 2011, the

Re: Japanese Text Sort Order

2011-01-05 Thread Seth Gordon
On 01/05/2011 07:57 AM, James Hancock wrote: > I think it does the same thing, but I was talking about how you cant set > 'ordering' under the Meta class in a model. > http://docs.djangoproject.com/en/1.2/ref/models/options/#django.db.models.Options.ordering > >

Re: Using Forms in Views Examples

2011-01-05 Thread Shawn Milochik
http://docs.djangoproject.com/en/1.2/topics/forms/ This contains form definitions, sample views, and sample HTML. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsu

Using Forms in Views Examples

2011-01-05 Thread hank23
Besides the mostly general documentation documents found on the django website or referenced in other documents on the site is there anywhere else to go to get good complete coding examples of using forms in views showing form and form field creation, associated view code, and also the correspondin

Re: Having a tough time getting started with Django

2011-01-05 Thread Peter L. Berghold
On Wed, 2011-01-05 at 08:27 -0800, Daniel Roseman wrote: > > > What version of Django have you installed? It appears to be earlier > than 1.2 at least, You were right on the money. I just checked the Debian site and the Django loaded via apt-get is version 1.02. (not a typo... there's a zero

Re: TemplateSyntaxError at /admin/

2011-01-05 Thread hank23
The addchoice screen (addchoice.html) code follows below. I included it just in case something might be wrong with it that could be related to or causing this problem, because some of its code is also doing some new things that I've not done before, so there are likely errors in it as well. Here's

Re: TemplateSyntaxError at /admin/

2011-01-05 Thread hank23
OK here's the entire views.py code: # Create your views here. from django.http import Http404 from django.shortcuts import render_to_response, get_object_or_404, get_list_or_404 from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.t

Re: TemplateSyntaxError at /admin/

2011-01-05 Thread Dan Fairs
Hi, > Near the top of my views.py I do have "from django import forms", so > I'm guessing that based on previous comments that this is ok. Do I > also need to import my specific named-form which IO created for the > new screen/view from my polls.forms.py module? If so is this syntax > correct: >

Re: TemplateSyntaxError at /admin/

2011-01-05 Thread hank23
Near the top of my views.py I do have "from django import forms", so I'm guessing that based on previous comments that this is ok. Do I also need to import my specific named-form which IO created for the new screen/view from my polls.forms.py module? If so is this syntax correct: from polls.forms

Re: Having a tough time getting started with Django

2011-01-05 Thread ringemup
Check the capitalization of the word "models" in some of your model definitions. On Jan 5, 11:00 am, "Peter L. Berghold" wrote: > OK:  Trying to get a handle on getting started with Django and like I > always do when learning a new environment I've dived in head first. > > Here is an error messag

Re: Having a tough time getting started with Django

2011-01-05 Thread Daniel Roseman
On Wednesday, January 5, 2011 4:00:02 PM UTC, Cowdawg wrote: > > OK: Trying to get a handle on getting started with Django and like I > always do when learning a new environment I've dived in head first. > > Here is an error message I'm getting. > > pe...@slcjwebapp0:~/agilitystewards$ python m

Having a tough time getting started with Django

2011-01-05 Thread Peter L. Berghold
OK: Trying to get a handle on getting started with Django and like I always do when learning a new environment I've dived in head first. Here is an error message I'm getting. pe...@slcjwebapp0:~/agilitystewards$ python manage.py syncdb Error: Couldn't install apps, because there were errors in

Re: Changing a constraint with live data

2011-01-05 Thread Shawn Milochik
On Jan 5, 2011, at 4:44 AM, Sithembewena Lloyd Dube wrote: > Thomas and Shawn, thanks for responding. > > South looks pretty useful - I hope that it could be included in the standard > Django distribution. > This has been discussed quite a bit, and a plan has been made to do this -- in a way

Re: TemplateSyntaxError at /admin/

2011-01-05 Thread Dan Fairs
Hi, > TemplateSyntaxError at /admin/ > Caught ViewDoesNotExist while rendering: Tried addchoice in module > polls.views. Error was: 'module' object has no attribute 'form'Request > Method: GET > Request URL: http://127.0.0.1:8000/admin/ > Django Version: 1.2.4 > Exception Type: TemplateSyntaxError

TemplateSyntaxError at /admin/

2011-01-05 Thread hank23
I'm not understanding what the error "TemplateSyntaxError at /admin/" is trying to tell me. The full text of the error message looks like this: TemplateSyntaxError at /admin/ Caught ViewDoesNotExist while rendering: Tried addchoice in module polls.views. Error was: 'module' object has no attribute

Re: MySQL jython backend implementation

2011-01-05 Thread Josh Juneau
Javier- Sorry for the lateness of my response. To set up mysql for Django- Jython backend, please see the following issue comment: http://code.google.com/p/django-jython/issues/detail?id=36#c14 Be sure to include the mysql JAR file in your CLASSPATH as well. Best On Dec 20 2010, 12:21 pm, Jav

Re: Redirecting to last view after login.

2011-01-05 Thread Scott Hebert (slaptijack)
I'm sorry you haven't gotten a response from anyone yet. >From everything you've provided here, it looks like you're doing this exactly right. The key seems to be that request is not being set. I think you need to verify two things: 1) That django.core.context_processors.request is in your TEMPLA

Re: Multi-tenant Django w/ Multi-DB?

2011-01-05 Thread Marco Louro
Thanks for your reply Justin, I'd like to avoid having multiple tenants in the same database, I feel multi-database is easier to scale, and simpler in a code maintenance sense. It does required to run database migrations once per tenant, but I still see it as the better solution. One solution I s

Re: A few beginner questions

2011-01-05 Thread Scott Gould
On Jan 4, 9:38 pm, Shawn Milochik wrote: > Hi Ondřej. > > ... > #2: The validation should all be done during form validation[2], prior to > save. Using a Form or ModelForm. That way, the user can get friendly, useful > errors. Further to this, look into model validation if the logic is integral

mod_rewrite and {% url ... %}

2011-01-05 Thread Robin
I have a working .htaccess: RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !\.(gif|jpg|png|css|js|ico)$ RewriteRule (.*) //$1 So the project that used to be at http://www.// is apparently moved to http://www./ which is what I intended. However, all hyperlinks made with {% url ... %} now

Re: Japanese Text Sort Order

2011-01-05 Thread James Hancock
Unfortunately following the ordinal value sorts the characters in a very rare way that no one knows how to use. It is an official order, but at that point is sort of defeats the purpose because they don't sort their characters that way in lists. Japanese is way weird that way. Thanks for all of th

Re: Japanese Text Sort Order

2011-01-05 Thread James Hancock
I think it does the same thing, but I was talking about how you cant set 'ordering' under the Meta class in a model. http://docs.djangoproject.com/en/1.2/ref/models/options/#django.db.models.Options.ordering

Re: Any Django framework command to freeze/wait/notify ?

2011-01-05 Thread Justin
+1 for Celery. For Django integration, see django-celery: https://github.com/ask/django-celery -Justin On Jan 5, 2:21 am, vivek_12315 wrote: > Hi all, > > This is a common scenario which many of you have faced. > > Say, I created a simple view file, in which user uploads a file and > does some p

Re: Multi-tenant Django w/ Multi-DB?

2011-01-05 Thread Justin
Have you looked at the Sites framework? You could have multiple tenants using one database and use a ForeingKey to a Site object to structure the data. This will result in more complex queries, but might be less of a cost than the maintenance issues (see below). If you continue reading that IBM do

Multi-tenant Django w/ Multi-DB?

2011-01-05 Thread Marco Louro
Hey, I'm wondering if Multi-DB supports some kind of multi-tenancy on the DB level (one app instance supporting multiple databases - one per client - 2 on http://www.ibm.com/developerworks/cloud/library/cl-multitenantsaas/figure0.gif). I don't think it does, but just want to be sure. I'm thinkin

Re: Custom queryset on a ModelForm field

2011-01-05 Thread mrmclovin
Thanks, that did the trick! On Jan 4, 9:22 pm, Daniel Roseman wrote: > On Tuesday, January 4, 2011 7:42:16 PM UTC, mrmclovin wrote: > > > Hi, > > > I have a 'project' model > > > class Project(models.Model): > >     title = models.CharField(max_length=100) > >     links = models.ManyToManyField('

Re: Setup issue

2011-01-05 Thread TheRedRabbit
On Jan 4, 10:17 pm, Phil wrote: > Hi all, > > I am having a setup issue on my personal laptop, I got through setup > and couple of tutorials on my Mac in work but not having any joy at > home. I'm running Ubuntu 10.04 Lucid Lynx. > > I run "import django" and I don't get any errors back so I tho

Re: Serialize in django witha query set that contains defer

2011-01-05 Thread jorge
i have propose one solution here : http://stackoverflow.com/questions/4593139/serialize-in-django-witha-query-set-that-contains-defer On Jan 4, 12:21 pm, jorge wrote: > Hi, i have i little problem, and that is how can serialize a django > query with defer ? > I have this model : > >     class Eve

Re: models queryset and permissions

2011-01-05 Thread MarcoS
Hi Danfi, thanks for your reply. This help me! On 5 Gen, 10:06, Danfi wrote: > Esame: > name = models.Foreignkey(User) > ... > > Then queryset=Esame.name.get_rows_with_permission(Ecg(),'add') > > On 1月4日, 下午8时02分, MarcoS wrote: > > > Hi people, probably I'm making a mountain out of a molehill bu

Re: Changing a constraint with live data

2011-01-05 Thread Sithembewena Lloyd Dube
Thomas and Shawn, thanks for responding. South looks pretty useful - I hope that it could be included in the standard Django distribution. On Tue, Jan 4, 2011 at 6:20 PM, Shawn Milochik wrote: > You could do this with South in multiple steps. > > 1. South schema migration: >Add the new fiel

Re: models queryset and permissions

2011-01-05 Thread Danfi
Esame: name = models.Foreignkey(User) ... Then queryset=Esame.name.get_rows_with_permission(Ecg(),'add') On 1月4日, 下午8时02分, MarcoS wrote: > Hi people, probably I'm making a mountain out of a molehill but I > can't figure > how to solve this problem; > > I've a form with a ModelMultipleChoiceField

Re: Japanese Text Sort Order

2011-01-05 Thread Daniel Roseman
On Wednesday, January 5, 2011 8:31:02 AM UTC, James Hancock wrote: > > I have a site I am working on where the main language is Japanese. > When I tried to order the fields in my form on > http://goeigo.org/loc/tokyo/nakano/ by their Japanese name, it doesn't put > them in the right order. It so

Re: Japanese Text Sort Order

2011-01-05 Thread Kenneth Gonsalves
On Wed, 2011-01-05 at 17:31 +0900, James Hancock wrote: > How does ordering() order Japanese Unicode text? I do not know about japanese unicode, but ordering in Indian languages for instance just follows the ordinal value of the character. So if japanese unicode gives the first number to the first

Japanese Text Sort Order

2011-01-05 Thread James Hancock
I have a site I am working on where the main language is Japanese. When I tried to order the fields in my form on http://goeigo.org/loc/tokyo/nakano/ by their Japanese name, it doesn't put them in the right order. It sorts it, but it is in a strange unhelpful kanji order. How does ordering() order

Re: Any Django framework command to freeze/wait/notify ?

2011-01-05 Thread Mo Mughrabi
Am not quite sure of your question, but I use celery to create jobs running in the background, queue them and get their status. http://celeryproject.org/ regards, On Wed, Jan 5, 2011 at 10:21 AM, vivek_12315 wrote: > Hi all, > > This is a common scenario which many o