Re: same code runs on two machines and barfs on the third [solved]

2012-02-12 Thread kenneth gonsalves
On Wed, 2012-02-08 at 12:45 +0530, kenneth gonsalves wrote: > On Tue, 2012-02-07 at 19:29 +1100, Mike Dewhirst wrote: > > On 7/02/2012 6:14pm, kenneth gonsalves wrote: > > > On Tue, 2012-02-07 at 08:06 +0100, Babatunde Akinyanmi wrote: > > >> Perhaps you made a change to a model and forgot to syncd

django-admin.py startproject doesn't work

2012-02-12 Thread raddy
I have windows7 OS and have installed Python27 and Django1.3.1 I have also set the path in the environment variables to: C: \Python27\;C:\Python27\python.exe;C:\Python27\Scripts;C:\Python27\Lib \site-packages\django\bin Commands like python and import django works well but when i try creating a ne

Re: Django Comments Form not Displaying

2012-02-12 Thread coded kid
Thanks guys. @matias I tried your solution, and the post button appeared. After clicking on it, I get 'COMMENT POST NOT ALLOWED (404)' Please whats wrong? On Feb 12, 4:37 pm, Matías Aguirre wrote: > Excerpts from Michael P. Soulier's message of 2012-02-12 14:16:26 -0200: > > > > > > > On 12/02/

complete for dropdown box in admin

2012-02-12 Thread kenneth gonsalves
hi, I need a widget in admin to autoselect (I do not know what it is called) a foreign key - that is if I type 'f' it goes to the first occurrence of 'f' and so on. I hope I am clear. -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Groups "Dja

Re: Problem with encoding in unit tests

2012-02-12 Thread Shawn Milochik
How did you get the name into your fixtures? Did you type it in manually, or enter it in Django admin and then use dumpdata? It looks like the value in your fixtures got its encoding mangled. It should work properly if the unicode is correct in your database and you use manage.py dumpdata to d

Django Gigs - Why so few gigs?

2012-02-12 Thread ydjango
A year or so (may be more) back when I looked at Django Gigs and there were quite a lot of gigs( I mean in 100s). After a while I checked again today just to see how the market is doing and I see very few jobs on django gigs. What happened, what changed? -- You received this message because you

Problem with encoding in unit tests

2012-02-12 Thread David Gómez
Hi everyone, I am having some problems with unit tests in Django. If I run this code in the django shell, I got the expected result: In [2]: actividades = ActividadExtracurricular.objects.order_by("id") In [3]: print (actividades[1].nombre == u"Soñar despierto", actividades[1].nombre) Out[3]: (T

Re: [modwsgi] Thread timeout

2012-02-12 Thread Graham Dumpleton
On 13 February 2012 08:30, Phyllipe Medeiros wrote: > I have made this class: > "class Teste(Thread): >     def __init__(self): >         Thread.__init__(self) >     def run(self): >         try: >             print "Begin" >             from httplib2 import Http >             import time >      

Thread timeout

2012-02-12 Thread Phyllipe Medeiros
I have made this class: "class Teste(Thread): def __init__(self): Thread.__init__(self) def run(self): try: print "Begin" from httplib2 import Http import time time.sleep(20) print "PASSED SLEEP" respons

Re: accessing foreign key value in template select related

2012-02-12 Thread richard
sorry left something out which was actually causing the lookup to fail. I have overidden the Select that gets given by default with a foreign key to a CharField for ajax autocomple. So i guess is how to i get the relationship lookup to work with the select changed to a CharField? class ProfileEdit

accessing foreign key value in template select related

2012-02-12 Thread richard
Hi i have a UserProfile that has a city_id as a foreign key to cities table. when i use {{ profile_edit_form.city_id}} in the template i get the id of the city that is stored in my userprofile showing as the value instead of the city name. Would the select related fix this issue and lookup the city

Re: is my UserProfile ManyToMany wrong?

2012-02-12 Thread richard
Thanks Patrick and Daniel i got it working with adding the unicode method. much appreciated. On Feb 12, 3:49 pm, Patrick Wellever wrote: > Hi, > > Is that code all that's in your model classes, or just an excerpt? If you > don't already have a __unicode__() method defined on your model, I think

Re: is my UserProfile ManyToMany wrong?

2012-02-12 Thread Daniel Roseman
On Sunday, 12 February 2012 11:06:32 UTC, richard wrote: > > Hi im having difficulty looping over my mantomany in my template. A > user has a 1to1 with UserProfile and the UserProfile has a manytomany > with interests. But displaying the form field without looping over it > displays a model mult

Re: Where is linebreaksbr function ?

2012-02-12 Thread Nolhian
>         What's so difficult about > >               "".join(data.split("\n")) Nothing ? But that's not what I wanted. 1) It can't escape. 2) If I would have wanted something like that I would have use data.replace('\n', '') which is a whole lot faster than your solution. -- You received this

Re: pysqlite installation

2012-02-12 Thread yati sagade
Actually, If you're using the the sqlite3 backend for Django, you DO NOT have to use any `pysqlite'. The sqlite3 db-API has been a part of the Python standard library for long, and even if we ignore that, if you stick to Django's wonderful ORM, you shouldn't really have to work directly with pysqli

Re: sqlite3 error

2012-02-12 Thread Nevio Vesic
Try: django.db.backends.sqlite3 instead of just sqlite3 On Sun, Feb 12, 2012 at 3:31 PM, Marcus Maximus wrote: > Hey guys, > > i am trying to configure sqlite3(cause it seems to be easier than > postgresql) for django: > > my setting.py file is: > > DATABASES = { >'default': { >'EN

Re: Django Comments Form not Displaying

2012-02-12 Thread Matías Aguirre
Excerpts from Michael P. Soulier's message of 2012-02-12 14:16:26 -0200: > On 12/02/12 coded kid said: > > > Below is the codes in my comments/form.html > > {% load comments i18n %} > > {% csrf_token > > %} > > {% if next %} > value="{{ next }}" />{% endif %} > > {% for field in form %} > >

Re: Django Comments Form not Displaying

2012-02-12 Thread Michael P. Soulier
On 12/02/12 coded kid said: > Below is the codes in my comments/form.html > {% load comments i18n %} > {% csrf_token > %} > {% if next %} value="{{ next }}" />{% endif %} > {% for field in form %} > {% if field.is_hidden %} > {{ field }} > {% else %} > {% if field.errors %}

Django Comments Form not Displaying

2012-02-12 Thread coded kid
Hi guys, please help me out with django-comments form. I added : 'django.contrib.comments', to INSTALLED APPS (r'^comments/', include('django.contrib.comments.urls')), to urls.py and I copied the default templates from django.contrib.comments.templates.comments to my app templates directory. Af

Re: Where is linebreaksbr function ?

2012-02-12 Thread Nolhian
autoreponsse : Found it ! It's in django.template.defaultfilters, linebreaks is there too ! On Feb 12, 4:53 pm, Nolhian wrote: > Hello, > > I've found linebreaks, urlize and so on in django.utils.html but > linebreaksbr is not there. I need it to format my data inside my view > instead of the tem

Where is linebreaksbr function ?

2012-02-12 Thread Nolhian
Hello, I've found linebreaks, urlize and so on in django.utils.html but linebreaksbr is not there. I need it to format my data inside my view instead of the template. Any idea of its location ? Thanks in advance, Nolhian -- You received this message because you are subscribed to the Google Gro

Re: is my UserProfile ManyToMany wrong?

2012-02-12 Thread Patrick Wellever
Hi, Is that code all that's in your model classes, or just an excerpt? If you don't already have a __unicode__() method defined on your model, I think that would cause the problem you are referring to. That method would be called by Django in various places, wherever it needs to represent a model

Is django-syncr dead?

2012-02-12 Thread Kevin Harvey
Good day Djangonauts! I'm wondering if anyone knows anything about django-syncr ( http://code.google.com/p/django-syncr/). The PyPI page hasn't been updated for a year, and I think some of the YouTube API has changed. I'm bringing an old project that relied pretty heavily on django-sycr up to Djan

Re: sqlite3 error

2012-02-12 Thread Reinout van Rees
On 12-02-12 15:31, Marcus Maximus wrote: I tried to change the setting.py on line 'ENGINE': 'sqlite3', but this seems ok in my eyes... so whats wrong? Try the full dotted path, so including django.db.backends: 'ENGINE': 'django.db.backends.sqlite3', Just "sqlite3" by itself was fine in olde

sqlite3 error

2012-02-12 Thread Marcus Maximus
Hey guys, i am trying to configure sqlite3(cause it seems to be easier than postgresql) for django: my setting.py file is: DATABASES = { 'default': { 'ENGINE': 'sqlite3', #'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME

pysqlite installation

2012-02-12 Thread Marcus Maximus
Hey guys, i am trying to install pysqlite under win 7, but the installation routine always terminates...(I always have to kill the process ,cause the installation routine always hangs on) My python version: ActivePython 2.7.2.5 (ActiveState Software Inc.) based on Python 2.7.2 (default, Jun 24 20

is my UserProfile ManyToMany wrong?

2012-02-12 Thread richard
Hi im having difficulty looping over my mantomany in my template. A user has a 1to1 with UserProfile and the UserProfile has a manytomany with interests. But displaying the form field without looping over it displays a model multiple select with just a list of object result sets. displaying interes

Re: Automatically block requests from bad IP addresses

2012-02-12 Thread Cal Leeming [Simplicity Media Ltd]
That's pretty cute, we use a similar type of DDoS protection method in our webapps too, along with an abusive IP register (albeit ours isn't based on RPM - requests per minute). You might also want to consider looking at CloudFlare (free for even huge amounts of traffic), as they maintain a *huge*

Re: Unit test example for web froms

2012-02-12 Thread veearrsix
Coming from a non python/django background (my experience is groovy/ grails), but when we test our controllers (I think this is equivalent to django views). We simply set up mock params on the request and set expectations on the controller properties. Simple example: given: request.params = [