Re: Xampp and django

2009-10-11 Thread Denis Bahati
Thanx a lot for the information, but i managed to get it working before this information. I have another problem that the __unicode()__ is not working. It just gives me Poll object instead of the name of data from the database, i put the function at the beginning of the line, but if i put a tab to

Paging, 0-50, 51-100, 101-132

2009-10-11 Thread The Danny Bos
Heya, thanks for all the help of late, I'm about four late nights from finishing my first big app I'm guessing. Anyway, I'm working on paging in my app and am completely stuck (again), here's what I'm trying for: eg: http://www.domainname.com/card/pokemon/0-50/ Which would obviously dis

Re: Connection limit exceeded for non-superusers

2009-10-11 Thread A Melé
Looking at the postgresql log I can see it's probably the connection hasn't been closed: LOG: unexpected EOF on client connection Any ideas on this? Thank you. On 9 oct, 12:34, A Melé wrote: > I get this when I run the query: SELECT * FROM pg_stat_activity > >  datid |  datname  | procpid |

Re: Paging, 0-50, 51-100, 101-132

2009-10-11 Thread Daniel Roseman
On Oct 11, 9:22 am, The Danny Bos wrote: > Heya, thanks for all the help of late, I'm about four late nights from > finishing my first big app I'm guessing. > > Anyway, > I'm working on paging in my app and am completely stuck (again), > here's what I'm trying for: >          eg:http://www.domain

Re: Paging, 0-50, 51-100, 101-132

2009-10-11 Thread The Danny Bos
I had a read of that, is good but seems overly basic for what I'm trying to achieve. Basically a list of links like so on the Template: Link: Cards 0-50 Link: Cards 51-100 Link: Cards 101-132 Know what I mean? My biggest question being, how can I create that above list with the data I have, ba

Re: efficiently deleting content based on how old it is

2009-10-11 Thread Sam Lai
2009/10/11 buttman : > > you could also do it this way: > > http://pythonblog300246943.blogspot.com/2009/09/cron-jobs-with-django-made-easy.html Is there really much point to this instead of just putting all that into a .py file and using cron to call the .py file instead? There doesn't seem to b

Re: Paging, 0-50, 51-100, 101-132

2009-10-11 Thread Sam Lai
2009/10/11 The Danny Bos : > > > I had a read of that, is good but seems overly basic for what I'm > trying to achieve. > > Basically a list of links like so on the Template: > > Link: Cards 0-50 > Link: Cards 51-100 > Link: Cards 101-132 > > Know what I mean? > My biggest question being, how can

Re: Xampp and django

2009-10-11 Thread Bayuadji
Hi Denis, have you put self on your unicode function? its __unicode__(self) not __unicode()__ regards djibon On 10/11/09, Denis Bahati wrote: > Thanx a lot for the information, but i managed to get it working before this > information. > I have another problem that the __unicode()__ is not wor

Re: Paging, 0-50, 51-100, 101-132

2009-10-11 Thread The Danny Bos
I kind of worked out a way, it seems highly flimsy but it's working. paging = str(paging) paging = paging.split("-") page_from = paging[0] page_to = paging[1] items = CollectionItem.objects.filter(collection=collection) items_paged = CollectionIte

Re: Foreign language in View Model.

2009-10-11 Thread Joshua Russo
You may want to check how the encoding is set in your database. Make sure you are using utf-8. On Sat, Oct 10, 2009 at 9:43 PM, Rizwan wrote: > > I am trying to extend flatpage view...I have added custom code > here..you can see navigation showing question mark here > http://beta.rmansuri.net/ho

Re: Require reverse foreign key

2009-10-11 Thread Kristaps Kūlis
There can be multiple associated Model2 objects to Model1, but without one Model2 Model1 cannot exist. Kristaps Kūlis BOFH excuse #96: Vendor no longer supports the product On Sat,

Re: Xampp and django

2009-10-11 Thread Daniel Roseman
On Oct 11, 9:05 am, Denis Bahati wrote: > Thanx a lot for the information, but i managed to get it working before this > information. > I have another problem that the __unicode()__ is not working. It just gives > me Poll object instead of the name of data from the database, i put the > function

Models problem: put references of change in all fields

2009-10-11 Thread Xan
Hi, I have a trouble with model definition: I have several classes, for example a Car class: class Car(models.Model): numberplate = models.CharField(max_length=20) color = models.CharField(max_length=100) places = models.IntegerField() reparation = models.DateTimeField() I want

Apache WSGI DJANGO

2009-10-11 Thread lafada
Apache says, File does not exist: /var/lib/python-support/python2.5/django/contrib/ admin/media/js/actions.js When I tried to locate server says, /usr/lib/python2.5/site-packages/django/contrib/admin/media/js/ actions.js what may be the cause ??? --~--~-~--~~~---~--

Re: Require reverse foreign key

2009-10-11 Thread Daniel Roseman
On Oct 11, 12:38 pm, Kristaps Kūlis wrote: > There can be multiple associated Model2 objects to Model1, but without one > Model2  Model1 cannot exist. > > Kristaps Kūlis The best bet is to define custom validation for your inline formset, to ensure that there's at least one valid entry. class

Re: Apache WSGI DJANGO

2009-10-11 Thread Kenneth Gonsalves
On Sunday 11 Oct 2009 12:14:13 pm lafada wrote: > Apache says, > > File does not exist: /var/lib/python-support/python2.5/django/contrib/ > admin/media/js/actions.js > > When I tried to locate server says, > /usr/lib/python2.5/site-packages/django/contrib/admin/media/js/ > actions.js > > what may

Problem - sometimes I get blank pages

2009-10-11 Thread Roodie
Hello, I have a hard-to-identify problem on one of our production servers. We host some Django-based websites, and one of them ( a small news portal ) produces this strange error - sometimes users get blank pages when they try to access the portal. A browser refresh a few second later solves the

Re: Uploading an Image.

2009-10-11 Thread Chirolo
Hi Bayuadji. I already change the permissions for my Djangoprojects directory to rwxrwxrwx, but still couldn't write to my Image directory, which I also changed the permissions. Do I need to change the permissions to my /home directory? Here are the permissions of my home directory -> dwrxr-xr

Re: Django Developer Position in New York City, Urgent Stuff

2009-10-11 Thread Chhouk Voeun
mother fucker so many sending mail i' m bored don't send On Sat, Oct 10, 2009 at 3:04 AM, Shaun Hinklein (Sysmind L.L.C) < shaunhinkl...@gmail.com> wrote: > > Hey :) > I'm messaging all of you in regards to a Django Developer position > located in New York City. The position is extremely urgent a

Re: Django Developer Position in New York City, Urgent Stuff

2009-10-11 Thread Russell Keith-Magee
On Sun, Oct 11, 2009 at 11:33 PM, Chhouk Voeun wrote: > mother fucker so many sending mail i' m bored don't send That kind of language is *completely* uncalled for. Please refrain from posting messages with this tone to the Django mailing lists. Yours, Russ Magee %-) > On Sat, Oct 10, 2009 at

Re: Uploading an Image.

2009-10-11 Thread andreas schmid
i had the same issue a few days ago and i solved it by simply adding write permission to all for the given directory, not for the whole /media/ or even home. your error differs a bit from mine... does the directory /imageupload/ exist in /home/Djangoprojects ?? Chirolo wrote: > Hi Bayuadji. >

Re: Redirect home page

2009-10-11 Thread Caisys
Thanks On Oct 11, 8:15 am, jeffschenck wrote: > The simplest option is probably to use the redirect generic view > (http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views- > generic-simple-redirect-to). You could add something like this to your > urlconf: > > (r'^$', 'django.views.

Re: Problem - sometimes I get blank pages

2009-10-11 Thread Michael
On Sun, Oct 11, 2009 at 9:23 AM, Roodie wrote: > > Hello, > > I have a hard-to-identify problem on one of our production servers. We > host some Django-based websites, and one of them ( a small news > portal ) produces this strange error - sometimes users get blank pages > when they try to acces

Re: Problem - sometimes I get blank pages

2009-10-11 Thread akonsu
hello, is there anything in the web server logs? konstantin --~--~-~--~~~---~--~~ 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 fro

Re: best way to build a form for m2m-related models (via intermediary table)?

2009-10-11 Thread Brian McKeever
"Does it make sense to include the fields of both models into the same form?" Models represent how a computer stores your data in a database. Forms allow humans to input data into your database. Ideally, the two would be the same. Realistically, humans and computers think quite differently and d

Re: Redirect home page

2009-10-11 Thread Graeme Glass
On Oct 11, 12:24 am, Caisys wrote: > Hi, > I would like visitors to my site homepagewww.example.comto be > redirected towww.example.com/en/in order to allow for translations > in the future. > > What is the most efficient way? > > 1- Use apache mod-rewrite? > 2- I know i could use the HttpRespon

Re: required fields during object instantiation

2009-10-11 Thread Brian McKeever
It may make debugging a little harder, but it gives you a lot more flexibility in constructing objects. Here's a factoryish method I wrote for testing: def create_teacher(textbook = None, user = None, start_state = None,

Re: Automatic user association, and confirmation page

2009-10-11 Thread Brian McKeever
Is there a reason why you're storing an email address instead of just selecting the user or creating a new one? On Oct 10, 12:41 am, Andrew Pendleton wrote: > I'm trying to figure out the best way to add an email address form > field to the edit page for a model in the Django admin, and, upon >

Re: Uploading an Image.

2009-10-11 Thread Arthur Metasov
If you use distribution with apparmor try to stop it (/etc/init.d/apparmor). If the problem disappears, find apparmor config for apache and add there /home/Djangoprojects/ rw, /home/Djangoprojects/** rw, /home/Djangoprojects/imageupload/** rw, 2009/10/11 Chirolo > > Hi Bayuadji. > I already ch

sorl thumbnail error

2009-10-11 Thread Malcolm MacKinnon
Hi, I'm getting error messages with sorl thumbnail. I'm simply trying to show thumbnail images on my template. I select a number of images in my views, and iterate over my selection. Note that all my images are a certain size, and I'm just trying to reduce that size in my template using sorl thumbn

sorl thumbnail error--correction

2009-10-11 Thread Malcolm MacKinnon
-- Forwarded message -- From: Malcolm MacKinnon Date: Sun, Oct 11, 2009 at 2:32 PM Subject: sorl thumbnail error To: django-users@googlegroups.com Hi, I'm getting error messages with sorl thumbnail. I'm simply trying to show thumbnail images on my template. I select a number of i

Apply decorator to view functions in third-party apps?

2009-10-11 Thread ringemup
I need to find a way to programmatically change the template path for every view in my project -- a decorator seems like a nice DRY way to accomplish that. But what's the best way to apply it to views in third-party apps? The only way to accomplish this that I can think of is to declare new deco

Re: Django Developer Position in New York City, Urgent Stuff

2009-10-11 Thread Angel Cruz
I wholeheartedly agree. The Django community has a good reputation. Don't screw it up with your foul verbal attacks. On Sun, Oct 11, 2009 at 8:41 AM, Russell Keith-Magee wrote: > > On Sun, Oct 11, 2009 at 11:33 PM, Chhouk Voeun > wrote: > > mother fucker so many sending mail i' m bored don't se

Re: sorl thumbnail error

2009-10-11 Thread Arthur Metasov
2009/10/12 Malcolm MacKinnon > Hi, > I'm getting error messages with sorl thumbnail. I'm simply trying to show > thumbnail images on my template. I select a number of images in my views, > and iterate over my selection. Note that all my images are a certain size, > and I'm just trying to reduce t

Re: sorl thumbnail error

2009-10-11 Thread Michael P. Jung
> I'm getting error messages with sorl thumbnail. [...] All works fine, > until I use the following template thumbnail tag: > > You must not put braces around variables passed to a template tag. Just write: {% thumbnail obj 80x80 %} That also explains why your {% thumbnail '/path/to/image' 80

reverse() and Django with fastcgi behind lighty with sockets

2009-10-11 Thread Almad
Hi, I'm deploying Django behind lighttpd and have official-docs-like config: fastcgi.server = ( "/django.fcgi" => (( "socket" => "/path/to.socket", "check-local" => "disable", )) ) alias.url += ( "/media" => "/path/to/ap

Re: sorl thumbnail error

2009-10-11 Thread Malcolm MacKinnon
Thanks very much. On Sun, Oct 11, 2009 at 3:03 PM, Michael P. Jung wrote: > > > I'm getting error messages with sorl thumbnail. [...] All works fine, > > until I use the following template thumbnail tag: > > > > > > You must not put braces around variables passed to a template tag. > > Just wri

Re: reverse() and Django with fastcgi behind lighty with sockets

2009-10-11 Thread sleepyjames
you need to set FORCE_SCRIPT_NAME in your settings. http://docs.djangoproject.com/en/dev/ref/settings/#force-script-name On Oct 11, 11:07 pm, Almad wrote: > Hi, > > I'm deploying Django behind lighttpd and have official-docs-like > config: > >     fastcgi.server = ( >       "/django.fcgi" => >

Re: Running just core regression tests

2009-10-11 Thread Tim Chase
>> t...@rubbish:~/django/trunk/tests$ python runtests.py >> --settings=settings >> >> to execute the core set of tests. However, it takes quite a >> while (on the order of hours) on my old box. Is there a way to >> just run tests on the regressions/ subdirectory or even just a >> particular file

Re: Django Developer Position in New York City, Urgent Stuff

2009-10-11 Thread Wayne Koorts
>> Please refrain from posting messages with this tone to the Django mailing >> lists. >> > I wholeheartedly agree. > The Django community has a good reputation. > Don't screw it up with your foul verbal attacks. Surely it should be grounds for instant removal? Regards, Wayne --~--~-~--

Re: Django Developer Position in New York City, Urgent Stuff

2009-10-11 Thread Russell Keith-Magee
On Mon, Oct 12, 2009 at 8:05 AM, Wayne Koorts wrote: > >>> Please refrain from posting messages with this tone to the Django mailing >>> lists. >>> >> I wholeheartedly agree. >> The Django community has a good reputation. >> Don't screw it up with your foul verbal attacks. > > Surely it should be

how to get back to a view requiring login

2009-10-11 Thread Sergio A.
I've three views each with different URL. They are visible to logged in users. If a non-logged user tries to access a URL requiring login, I'm able to redirect it to the login page. What I'm missing is how to go back to the initial page, once the user log in the system. Cheers, Sergio --~--~---

FormWizard Validation via external data.

2009-10-11 Thread va1ha11a
I am going crazy trying to figure out how to do a specific validation setup via FormWizard. Basically I have a bunch of forms that need regular validation but also get validated as part of the program flow. e.g: First form: enter group name -> validate by checking that group does not exist in AD

Re: how to get back to a view requiring login

2009-10-11 Thread Florian Schweikert
2009/10/12 Sergio A. > > I've three views each with different URL. They are visible to logged > in users. > If a non-logged user tries to access a URL requiring login, I'm able > to redirect it to the login page. > > What I'm missing is how to go back to the initial page, once the user > log in t

'GeoPt' object has no attribute 'widget'

2009-10-11 Thread redawn
Hey, can anybody figure out what's going on around here. My model-form fails to validate and I get the error that, 'GeoPt' object has no attribute 'widget'. It seems that I'm missing two variables in my models but I don't explicitly declare 'location' and 'location_geocells' in my model, because t

Re: FormWizard Validation via external data.

2009-10-11 Thread va1ha11a
OK Well I think I might have got a working outcome, however it involves a bit more overriding than I would like but here it is: Comments or suggestions are still most welcome. class TestFormWizard(FormWizard): def get_template(self, step): return 'dev/testwiz.html' def done(self

Re: how to get back to a view requiring login

2009-10-11 Thread Bayuadji
On 10/11/09, Florian Schweikert wrote: > 2009/10/12 Sergio A. > >> >> I've three views each with different URL. They are visible to logged >> in users. >> If a non-logged user tries to access a URL requiring login, I'm able >> to redirect it to the login page. >> >> What I'm missing is how to go

__unicode__(self) doesn't work

2009-10-11 Thread Denis Bahati
Hi there i have the problem with unicode function it doesn't give me any changes. the poll list is displayed as Poll object and does doesn't give me error if i write the models.py like this:from django.db import models import datetime class Poll(models.Model): question = models.CharField(max_l

Re: __unicode__(self) doesn't work

2009-10-11 Thread Kenneth Gonsalves
On Monday 12 Oct 2009 10:39:48 am Denis Bahati wrote: > class Poll(models.Model): > question = models.CharField(max_length=200) > pub_date = models.DateTimeField('date published') > def __unicode__(self): > return self.question > def was_published_today(self): > return self.pub_date.date()

__unicode__(self) doesn't work

2009-10-11 Thread Denis Bahati
Hi all, I have a problem with __unicode__(self) function it doesn't give any changes to the display of poll list it just display the Poll object when i code like below: from django.db import models import datetime class Poll(models.Model): question = models.CharField(max_length=200) pub_

Re: __unicode__(self) doesn't work

2009-10-11 Thread Denis Bahati
Did you see my second post? I changed it still a problem On Mon, Oct 12, 2009 at 8:19 AM, Denis Bahati wrote: > Hi all, > I have a problem with __unicode__(self) function it doesn't give any > changes to the display of poll list it just display the Poll object when i > code like below: > > > fro

Hi All: __unicode__(self)

2009-10-11 Thread Denis Bahati
Hi all, I have a problem with __unicode__(self) function it doesn't give any changes to the display of poll list it just display the Poll object when i code like below: from django.db import models import datetime class Poll(models.Model): question = models.CharField(max_length=200) pub

Re: Hi All: __unicode__(self)

2009-10-11 Thread Kenneth Gonsalves
On Monday 12 Oct 2009 11:05:38 am Denis Bahati wrote: > class Poll(models.Model): > question = models.CharField(max_length=200) > pub_date = models.DateTimeField('date published') > def __unicode__(self): > return self.question > def was_published_today(self): > return self.pub_date.date()

Re: Hi All: __unicode__(self)

2009-10-11 Thread Russell Keith-Magee
On Mon, Oct 12, 2009 at 1:35 PM, Denis Bahati wrote: > Hi all, > I have a problem with __unicode__(self) function it doesn't give any changes > to the display of poll list it just display the Poll object when i code like > below: Ok - you need to do two things. 1) Stop posting the same question

Re: Hi All: __unicode__(self)

2009-10-11 Thread Russell Keith-Magee
On Mon, Oct 12, 2009 at 1:44 PM, Kenneth Gonsalves wrote: > > On Monday 12 Oct 2009 11:05:38 am Denis Bahati wrote: >> class Poll(models.Model): >>     question = models.CharField(max_length=200) >>     pub_date = models.DateTimeField('date published') >> def __unicode__(self): >> return self.que

FlatPage.objects.filter method: content_icontains attribute does not exist

2009-10-11 Thread chris
Hello, I am trying to work my way through Practical Django Projects (a book by James Bennett 1st edition 2008). I'm on chapter 3 page 28 where a search function is being added to the 'cms' project. The results=FlatPage.objects.filter(content_icontains=query) does not work; it looks like the con

Re: Distance across a LineString in GeoDjango

2009-10-11 Thread Jani Tiainen
HARRY POTTRER kirjoitti: > I have a model which represents a route. I can use the `make_line()` > geoqueryset method to create a LineString like so: > r = Route.objects.get(pk=33) # a route from Seattle to New York to Miami, a total distance # of about 3043.8 nautical miles r

Re: Problem - sometimes I get blank pages

2009-10-11 Thread Roodie
Nothing at all, that's the main problem we face diagnosing the problem. Roodie On okt. 11, 19:10, akonsu wrote: > hello, > > is there anything in the web server logs? > > konstantin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: FlatPage.objects.filter method: content_icontains attribute does not exist

2009-10-11 Thread Russell Keith-Magee
On Mon, Oct 12, 2009 at 2:41 PM, chris wrote: > > Hello, > > I am trying to work my way through Practical Django Projects (a book > by James Bennett 1st edition 2008).  I'm on chapter 3 page 28 where a > search function is being added to the 'cms' project.  The > results=FlatPage.objects.filter(c