Lookups that span relationships

2006-06-07 Thread rob
Hi there, I'm having trouble with the documentation at http://www.djangoproject.com/documentation/db_api/#lookups-that-span-relationships It says that I can follow a 'reverse' relationship by using the lowercase name of the model, but when I try with the model below, I get an error. What am I do

Re: DateField and DateTimefield do not really validate

2006-06-07 Thread Rudolph
Hi, Ok: http://code.djangoproject.com/ticket/2103 Cheers, Rudolph --~--~-~--~~~---~--~~ 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 unsubsc

Re: Site testing How-To

2006-06-07 Thread Brett Parker
On Tue, Jun 06, 2006 at 10:33:42PM -0600, Joseph Kocherhans wrote: > > On 6/6/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > > > > Does anyone know of a way to get all attributes of a module into > > another module while overriding just a few? > > I think you want tocreate something like testsett

Re: Site testing How-To

2006-06-07 Thread Simon Willison
On 7 Jun 2006, at 02:42, Todd O'Bryan wrote: > Does anybody have a best practice (or not-too-annoying practice) for > testing? > > I think I'll use Selenium to test my site, but how should I change to > a test database, populate the test database, etc.? This is an area where Django can learn a

Re: Site testing How-To

2006-06-07 Thread Simon Willison
On 7 Jun 2006, at 05:33, Joseph Kocherhans wrote: > I think you want tocreate something like testsettings.py, and in that > file do something like: > > from myproject.settings import * > > then override the specific settings you want. It won't work with > manage.py, but your tests should be

Re: Please help with project setup

2006-06-07 Thread Kristoffer
Thanks, everyone, I have almost gotten things to work now! One thing I can't quite figure out, though, is the following: Say that I have Category defined as in http://code.djangoproject.com/wiki/CookBookCategoryDataModel (I use Django 0.91), with the exception that these lines def get_separ

Subclassing in Trunk

2006-06-07 Thread David Reynolds
Hi, I seem to remember reading either on the mailing list or IRC channel that sub-classing doesn't work at the moment, is that correct? It seems to work to some extent but I can't recreate the behaviour that replaces_model='modelname' used to do. Is this going to be readded, or a better w

Re: Internalization: Two DB tables for one Model?

2006-06-07 Thread Archatas
For better understanding of the second and the third ways of creating multilingual models I mentioned, you can read the sub-article "Database" in the "Internationalization Primer" at http://digital-web.com/articles/internationalization_primer/ In my opinion, internalization is very important feat

Re: Django on Intel mac?

2006-06-07 Thread Corey Oordt
I have MacBook, and although it was a challenge to get everything up and running, I ended up using darwinports to install apache 2, mysql 5 and python 2.4. Everything is working really well now Corey Oordt On Jun 6, 2006, at 9:36 PM, Greg Harman wrote: > > > Oliver Kiessler wrote: > >> --

MyFormWrapper.myfield works in {{}} but not {%%} ?

2006-06-07 Thread mazurin
Hi all, I have a short question, it's probably a stupid one but I can't quite figure out why Django behaves this way. I am using limoudou's 'expr' tag, btw. In a template html file, why can I do this (very simplified example): {{ form.somefield }} but not this: {% expr fo

Re: Site testing How-To

2006-06-07 Thread Jeroen Ruigrok van der Werven
On 6/7/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > I think I'll use Selenium to test my site, but how should I change to > a test database, populate the test database, etc.? You might like twill as well: http://twill.idyll.org/ http://agiletesting.blogspot.com/2005/09/web-app-testing-with-pyth

Re: Site testing How-To

2006-06-07 Thread Todd O'Bryan
On Jun 7, 2006, at 3:54 AM, Simon Willison wrote: > > > On 7 Jun 2006, at 05:33, Joseph Kocherhans wrote: > >> I think you want tocreate something like testsettings.py, and in that >> file do something like: >> >> from myproject.settings import * >> >> then override the specific settings you

Re: Site testing How-To

2006-06-07 Thread Matthew Flanagan
On 6/7/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > > > On Jun 7, 2006, at 3:54 AM, Simon Willison wrote: > > > > > > > On 7 Jun 2006, at 05:33, Joseph Kocherhans wrote: > > > >> I think you want tocreate something like testsettings.py, and in that > >> file do something like: > >> > >> from

Re: Site testing How-To

2006-06-07 Thread Michael Radziej
Hi, Just a little teaser: I've found a nice approach to test your views. The problem is, the http response is hard to test, since you have to either scrape the interesting content from it, or use regexps. Both is not really nice. My approach does not check the actual http response, but the co

Django on Dreamhost. Getting 503 http error when I try to login to admin

2006-06-07 Thread Tomas Jacobsen
Hi. Im trying to install django on my Dreamhost domain. I have followed the dreamhost wiki and the guide on http://www2.jeffcroft.com/2006/may/11/django-dreamhost/ about 4 times now, and the last 3 times I get the same 503 error when I try to login to admin. Before I installed admin I get the "I

"Back-to-front" LDAP Authentication

2006-06-07 Thread James Mulholland
I've set up Django under Apache 2, so that users are prompted for their LDAP username/password when they try to visit my Django site. This authentication is the standard Apache http-auth dialog which has nothing to do with Django itself. I also created this (below) as a way to populate the Django

Re: Django on Dreamhost. Getting 503 http error when I try to login to admin

2006-06-07 Thread Michael Radziej
Tomas Jacobsen wrote: > In the error log i get this error: > > mod_security: Access denied with code 503. Pattern match > "(go\\.to|get\\.to|drop\\.to|hey\\.to|switch\\.to|dive\\.to|move\\.to|again\\.at)" > at HEADER. [hostname "django.mydomain.com"] [uri "/admin/"] How exactly did you access yo

Re: Django on Dreamhost. Getting 503 http error when I try to login to admin

2006-06-07 Thread Tomas Jacobsen
I use: http://www.django.tomasjacobsen.com/admin/ and http://django.tomasjacobsen.com/admin/ . The same result on both. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

Re: Django on Dreamhost. Getting 503 http error when I try to login to admin

2006-06-07 Thread Michael Radziej
Tomas Jacobsen wrote: > I use: http://www.django.tomasjacobsen.com/admin/ and > http://django.tomasjacobsen.com/admin/ . The same result on both. That's it. There's "go.to" in "django.tomasjacobsen". You should complain at Dreamhost. They filter in the wrong way. For a work-around, change your

Re: Django on Dreamhost. Getting 503 http error when I try to login to admin

2006-06-07 Thread Tomas Jacobsen
Ah, good to know Im not stupid :) Will try it out with my regular domain later. Thank you! --~--~-~--~~~---~--~~ 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@goog

DoesNotExist at /accounts/login/

2006-06-07 Thread Charles F. Munat
New to Django but pretty impressed so far. Am having some trouble getting Auth to work. Have tried everything I can think of. Error message below. Any help appreciated. Chas. Munat Seattle (Not knowing yet what is important, I included everything here. If there are parts of the error message

Re: DoesNotExist at /accounts/login/

2006-06-07 Thread rob
I'm completely new to django and don't know too much, but to me it looks as though your urls.py doesn't include a regular expression that matches "/accounts/login/". If this is the case, then http://www.djangoproject.com/documentation/tutorial3/ should hopefully cover what you'll need. All the be

Re: Help with multiple object added on a single form with addManipulator.

2006-06-07 Thread Frankie Robertson
This forces me to use non-compliant code by making me use multiple controls with the same id. Since nobody seems to know the solution to this problem I'm assuming it's a problem with documentation and have filed a bug on it at http://code.djangoproject.com/ticket/2107. Frankie. On 06/06/06, Fran

Re: DoesNotExist at /accounts/login/

2006-06-07 Thread Paul Childs
I had the same troubles and then I found this... http://www.carcosa.net/jason/blog/computing/django/gotchas-2006-04-19 You will notice some other goodies there too. :) You may want these in your project's url.py file too (r'^logout/', 'django.views.auth.login.logout'), (r'', 'django.

Re: DoesNotExist at /accounts/login/

2006-06-07 Thread Charles F. Munat
rob wrote: > I'm completely new to django and don't know too much, but to me it > looks as though your urls.py doesn't include a regular expression that > matches "/accounts/login/". My urls.py includes: (r'^accounts/login/$', 'django.contrib.auth.views.login'), which I copied and pasted d

Re: DoesNotExist at /accounts/login/

2006-06-07 Thread Charles F. Munat
Paul Childs wrote: > I had the same troubles and then I found this... > http://www.carcosa.net/jason/blog/computing/django/gotchas-2006-04-19 > You will notice some other goodies there too. :) Jason McBrayer uses the following regexs in his urls.py file: (r'^accounts/login/', 'django.views.

Re: Internalization: Two DB tables for one Model?

2006-06-07 Thread tekNico
Aidas Bendoraitis wrote: > Hello Django Professionals! > > I am making a Django-based website that has to be multilingual. Me too. :-) > Everything is clear about making the admin section and the templates > translatable. The problem is multilingual objects. > > I could think of several approac

Re: DoesNotExist at /accounts/login/

2006-06-07 Thread Paul Childs
I'm using version 0.91. That's the difference. The only other thing I can suggest is to chekc if you have your login and logout templates in the right place and that the template locations are in your settings.py file. Sorry I couldn't help out. Good luck. --~--~-~--~~~

Re: Django Article on Developerworks

2006-06-07 Thread Wilson Miner
Ha - that's great! On 6/6/06, Ian Maurer <[EMAIL PROTECTED]> wrote: Thanks guys for the feedback. Hopefully the changes will getincorporated tomorrow.Also, I like the art IBM put together for the front page of the linux section... http://www-128.ibm.com/developerworks/linux/I hope it meets with the

Validation based on a related object field (ForeignKey) value

2006-06-07 Thread strangy
Hello, Is there a way to validate a field in the model based on a value in a related object (ForeignKey field) ?? For example: I have an Activity object which definex a maxscore integer field and an StudentActivity object which has a score field. Now i want to validate that the value of the Stude

Re: Validation based on a related object field (ForeignKey) value

2006-06-07 Thread strangy
strangy wrote: > Hello, > Is there a way to validate a field in the model based on a value in a > related object (ForeignKey field) ?? > > For example: > I have an Activity object which definex a maxscore integer field and an > StudentActivity object which has a score field. Now i want to validat

Re: Catching a failed response

2006-06-07 Thread Jay Parlar
On 6/6/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > Ah... This is interesting :-). A web server will know that a client has > been disconnected only when it will try to send it something. So if you > have a long working view you can't know if it works for nothing until it > finishes. > > It's go

Re: DoesNotExist at /accounts/login/

2006-06-07 Thread Charles F. Munat
Paul Childs wrote: > I'm using version 0.91. That's the difference. > > The only other thing I can suggest is to chekc if you have your login > and logout templates in the right place and that the template locations > are in your settings.py file. I think so. The other templates are working. But

Re: Validation based on a related object field (ForeignKey) value

2006-06-07 Thread mamcxyz
Overwrite the save() methon. Example: (I wanna test if at least 1 addr is added) def save(self): #Comprobar que existe al menos UNA direccion... existe = False for addr in self.restaurantaddress_set.all(): existe = True break Why this and no

Re: Catching a failed response

2006-06-07 Thread Jeremy Dunck
On 6/7/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > Oh wow, you can pass an iterable to HttpResponse? I never noticed that before! > > If the write fails before all the iterations are done though, I guess > I have no way to generically catch that, to do any kind of cleanup I > might need? class M

Re: "Back-to-front" LDAP Authentication

2006-06-07 Thread Ramiro Morales
James, On 6/7/06, James Mulholland <[EMAIL PROTECTED]> wrote: > > I've set up Django under Apache 2, so that users are prompted for their > LDAP username/password when they try to visit my Django site. This > authentication is the standard Apache http-auth dialog which has > nothing to do with Dj

Re: Catching a failed response

2006-06-07 Thread Jay Parlar
On 6/7/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > > In other words, as it stands, no, I don't think you can catch an > exception raised while sending the bits down the wire. Exception > middleware catches exceptions raised by the view, but the Response > isn't rendered to the pipe until well

Re: Catching a failed response

2006-06-07 Thread Jeremy Dunck
On 6/7/06, Jay Parlar <[EMAIL PROTECTED]> wrote: > What's the current definition of "Exception Middleware"? I can't find > a good one in the docs. From http://www.djangoproject.com/documentation/middleware/#process-exception : " process_exception Interface: process_exception(self, request, exce

Re: Subclassing in Trunk

2006-06-07 Thread Scanner
It does not work currently. Ticket #1656 at djangoproject refers to this: http://code.djangoproject.com/ticket/1656 This is apparently one of the projects being covered by the Google Summer of Code. Some discussion of it is at: http://code.djangoproject.com/wiki/ModelInheritance I myself need

Re: Validation based on a related object field (ForeignKey) value

2006-06-07 Thread mamcxyz
Forget this code... really not work :( The reason is that is necesary save *first* the parent then go for children. I test several things, like do the save in the child (expecting that "detect" is their parent is not saved) but this only insert orphan childs... Now we are 2 with the same questi

Subversion Repository is Asking for a User Name and Password

2006-06-07 Thread Paul Childs
I would really like to download the developer version. I am using TortoiseSVN. When I perform an import I get a dialogue that says... Django SVN repository Requests a username and a password Could someone please help me out. Thanks, --~--~-~--~

Re: Subversion Repository is Asking for a User Name and Password

2006-06-07 Thread Jeremy Dunck
On 6/7/06, Paul Childs <[EMAIL PROTECTED]> wrote: > > I would really like to download the developer version. > > I am using TortoiseSVN. > > When I perform an import I get a dialogue that says... You don't want "import", you want "checkout". (In explorer, right-click on the folder you'd like to

LOST-theories.com

2006-06-07 Thread Don Arbow
I'm sure it just slipped his mind but Jeff Croft has a new website up that allows LOST fans to comment on theories about episodes. I'm not really a LOST fan, but the site is cool, and written in Django. The even cooler part is you can download the source code. According to his blog, it took

Re: Subversion Repository is Asking for a User Name and Password

2006-06-07 Thread Paul Childs
Thanks very much Jeremy. Worked like a charm. Regards, /Paul --~--~-~--~~~---~--~~ 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 fr

Weird behaviour

2006-06-07 Thread Elver Loho
request.session seems to be storing things beyond me closing the Django development server. This is sort of weird. Is it a feature or a bug? Because, I'd prefer a clean slate every time I run the devserver. Example code: def foo(request): foo = request.session.get("foo", None)

Re: Weird behaviour

2006-06-07 Thread Adrian Holovaty
On 6/7/06, Elver Loho <[EMAIL PROTECTED]> wrote: > This behaviour is just way too weird. I'm currently developing with > Django for work and with CherryPy for a side project and CherryPy > doesn't store sessions beyond the lifetime of the server. I sort of > didn't expect this behaviour from Djang

Re: Weird behaviour

2006-06-07 Thread arthur debert
Hi Elver. This is a feature. This behaviour depends on wheter you want yor sessions to expire and when. More details in the docs: http://www.djangoproject.com/documentation/sessions/#browser-length-sessions-vs-persistent-sessions arthur --~--~-~--~~~---~--~~ You

Admin site/ManyToManyField problem

2006-06-07 Thread Dagur
Hi, I'm having problems with ManyToManyField not appearing in the admin site. I think it's best explained with this screenshot (look at the bottom): http://dagur.sytes.net/static/djangoshot.jpg I also put the source for the models in on pasted: http://paste.e-scribe.com/372/ I'm at the point wh

Re: Weird behaviour

2006-06-07 Thread Elver Loho
On 6/8/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/7/06, Elver Loho <[EMAIL PROTECTED]> wrote: > > This behaviour is just way too weird. I'm currently developing with > > Django for work and with CherryPy for a side project and CherryPy > > doesn't store sessions beyond the lifetime of

Re: Weird behaviour

2006-06-07 Thread Adrian Holovaty
On 6/7/06, Elver Loho <[EMAIL PROTECTED]> wrote: > I think it's a bug that Django's session variables survive when the > Django development server is closed. Yes, when I close the browser, > it's nice that I can start it again and be greeted with my session. > However, when I close the server, I e

Re: Weird behaviour

2006-06-07 Thread Malcolm Tredinnick
On Thu, 2006-06-08 at 02:21 +0300, Elver Loho wrote: > On 6/8/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > > > On 6/7/06, Elver Loho <[EMAIL PROTECTED]> wrote: > > > This behaviour is just way too weird. I'm currently developing with > > > Django for work and with CherryPy for a side project

Re: Weird behaviour

2006-06-07 Thread Elver Loho
On 6/8/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Thu, 2006-06-08 at 02:21 +0300, Elver Loho wrote: > > On 6/8/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > > > > > On 6/7/06, Elver Loho <[EMAIL PROTECTED]> wrote: > > > > This behaviour is just way too weird. I'm currently devel

Re: Weird behaviour

2006-06-07 Thread Adrian Holovaty
On 6/7/06, Elver Loho <[EMAIL PROTECTED]> wrote: > Everything you've just said makes a lot of sense on a production > rollout. Yes, do keep sessions after shutdown. It's a great feature! > But this "feature" on the development server simply makes development > more difficult. > > So, um, could som

Re: Weird behaviour

2006-06-07 Thread Elver Loho
On 6/8/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/7/06, Elver Loho <[EMAIL PROTECTED]> wrote: > > Everything you've just said makes a lot of sense on a production > > rollout. Yes, do keep sessions after shutdown. It's a great feature! > > But this "feature" on the development server

Re: Weird behaviour

2006-06-07 Thread Honza Král
and do you really think that sessions are saved after each variable set into the database? I hope not... they are probably only saved after the return of the view, or somewhere around that point... On 6/8/06, Elver Loho <[EMAIL PROTECTED]> wrote: > > On 6/8/06, Adrian Holovaty <[EMAIL PROTECTED]>

Using the database backend for a non web app.

2006-06-07 Thread Zarrabeitia
Hello. I'm developing a short app based on django. It is composed by a few agents, and a web app to show the results. The agents are, of course, not web based, but I'd like to reuse as much code as I can from the webapp ("DRY"), specially the model (and the configurations in my project's settings

Re: Weird behaviour

2006-06-07 Thread Elver Loho
On 6/8/06, Honza Král <[EMAIL PROTECTED]> wrote: > and do you really think that sessions are saved after each variable > set into the database? > I hope not... > > they are probably only saved after the return of the view, or > somewhere around that point... Alright then, my mistake. However, it

Re: Using the database backend for a non web app.

2006-06-07 Thread Zarrabeitia
Nevermind... Problem solved. export DJANGO_SETTINGS_MODULE= did the trick. Thanks IRC! Zarrabeitia. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: Weird behaviour

2006-06-07 Thread limodou
On 6/8/06, Elver Loho <[EMAIL PROTECTED]> wrote: > > On 6/8/06, Honza Král <[EMAIL PROTECTED]> wrote: > > and do you really think that sessions are saved after each variable > > set into the database? > > I hope not... > > > > they are probably only saved after the return of the view, or > > somew

'ManyToManyField' attribute error

2006-06-07 Thread Mikeal Rogers
Hiya, I'm using the django trunk and tried to generate the SQL for a model I just wrote and got the following traceback; execute_manager(settings) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/django/core/management.py", line 1255, in execute_m

Re: 'ManyToManyField' attribute error

2006-06-07 Thread Malcolm Tredinnick
Hi Mikeal, On Wed, 2006-06-07 at 19:17 -0700, Mikeal Rogers wrote: > Hiya, > > I'm using the django trunk and tried to generate the SQL for a model > I just wrote and got the following traceback; > > execute_manager(settings) >File "/Library/Frameworks/Python.framework/Versions/2.4/l

Re: 'ManyToManyField' attribute error

2006-06-07 Thread Mikeal Rogers
Sure, Here you go, class BItem(models.Model): #Date stuff created_on = models.DateTimeField(auto_now_add=True) last_edited_on = models.DateTimeField(auto_now=True) #Last Edited By last_edited_by = models.ForeignKey(User) #B information name = models.CharField(

Re: 'ManyToManyField' attribute error

2006-06-07 Thread Malcolm Tredinnick
Hi Mikael, On Wed, 2006-06-07 at 19:41 -0700, Mikeal Rogers wrote: > Sure, Here you go, > > class BItem(models.Model): > > #Date stuff > created_on = models.DateTimeField(auto_now_add=True) > last_edited_on = models.DateTimeField(auto_now=True) > #Last Edited By > last_

Re: 'ManyToManyField' attribute error

2006-06-07 Thread Mikeal Rogers
Thanks, that clears things up. I thought that if I sent it as a string rather than the class I could wait to define it until later. -Mikeal On Jun 7, 2006, at 8:30 PM, Malcolm Tredinnick wrote: > > Hi Mikael, > > On Wed, 2006-06-07 at 19:41 -0700, Mikeal Rogers wrote: >> Sure, Here you go, >>

Re: Django on Intel mac?

2006-06-07 Thread Greg Harman
Jeremy Dunck wrote: > What error are you getting? $ sudo python setup.py build Password: running build running build_py copying MySQLdb/release.py -> build/lib.macosx-10.4-fat-2.4/MySQLdb running build_ext building '_mysql' extension gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u

Re: Django on Intel mac?

2006-06-07 Thread Greg Harman
Corey Oordt wrote: > I have MacBook, and although it was a challenge to get everything up > and running, I ended up using darwinports to install apache 2, mysql > 5 and python 2.4. > > Everything is working really well now Yeah, the only cases I've read about where people have gotten this worki

Re: Context as Stack?

2006-06-07 Thread mazurin
Hi Eugene, Thanks for this example. I think it'll be helpful for me. I'm working on something like this right now, where I need to generate a whole bunch of small and simple subtemplates inside of a main layout template. I was worried that I might have to write a custom tag -- I can, but it

Re: Catching a failed response

2006-06-07 Thread Ivan Sagalaev
Jeremy Dunck wrote: >It sounds to me like "Exception Middleware" needs to be renamed to >"View Exception Middleware" and you should write a patch for "Response >Exception Middleware". ;-) > > I don't think it's possible. In the wsgi.py it's just: return response.iterator .. and the WSGI