Re: formset initialization question

2009-03-04 Thread Margie
Yes, I am defining _construct_form() as you do. I had just not thought to set initial there - but that makes sense. For reference, here is my current code, with it setting initial in _construct_form. But you may want to read on below before bothering to look at it because I have a theory about w

Re: HttpResponse post

2009-03-04 Thread hoamon
Hi all, I write a experimental example to reach this requirement. By AJAX method, we can make a post type form after server answer. my example is below here: http://hoamon.blogspot.com/2009/03/return-httpresponseredirect-by-post.html --~--~-~--~~~---~--~~ You re

Database connection object in session

2009-03-04 Thread jai_python
Hi. Is it possible to add database connection object in session and handle in different views. Thanks in advance. Jayapal --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: Cookie problem on multiple sites

2009-03-04 Thread Dids
Fixed the problem :) Turns out, underscores '_' are not valid characters for domain names ... Told you I was new to this... Thanks all for your input, much appreciated :) Regards, Didier, --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Database connection object in session

2009-03-04 Thread Malcolm Tredinnick
On Wed, 2009-03-04 at 03:08 -0800, jai_python wrote: > Hi. Is it possible to add database connection object in session and > handle in different views. No. Really bad idea. The connection lifecycle is tied to a single request/response (we close it at the end of the response). Also pickling datab

Re: Cookie problem on multiple sites

2009-03-04 Thread Malcolm Tredinnick
On Wed, 2009-03-04 at 03:14 -0800, Dids wrote: > Fixed the problem :) > > Turns out, underscores '_' are not valid characters for domain > names ... > > Told you I was new to this... Don't feel too bad about missing that. I know it's true, for example, but I wouldn't have guessed that was going

Re: ManyToOne : cannot form a proper query :(

2009-03-04 Thread [CPR]-AL.exe
Thanks, but i've already read that and there's no answer for my question. In SQL this would be some query with nested joins.. but i don't know how to make this query in django.. On 3 мар, 19:17, Alex Gaynor wrote: > On Tue, Mar 3, 2009 at 11:13 AM, [CPR]-AL.exe wrote: > > > for example, i have

Calling a SOAP web service on Django with any kind of a client

2009-03-04 Thread gandra
Hi all! I am working on web services. The idea is that I have a list of services on Djnago that can be called by any kind of a client. To create one web service I used the code from: http://www.djangosnippets.org/snippets/979/ The python client which calls the web service is quite simple: #ws

opposite of icontains

2009-03-04 Thread koranthala
Hi, How do I implement a substring query? Please find the example below. >From Django Documentation: Entry.objects.get(headline__icontains='Lennon') => This matches the headline 'Today lennon honoured' My query is the opposite: I have the string 'Lennon' inside my DB, and I have

Appropriate placement for my testcases belonging to a non-app in Django

2009-03-04 Thread madhav
I have built my website in Django. And like any other django project I have got apps inside the project root directory and some special folders like(extensions a.k.a custom django command extensions). With an app, we dont have any problem with having testcases. "tests.py" inside the app directory

ImportError: No module named postgresql_psycopg2.base

2009-03-04 Thread durgaprasad
Hi, I am new to Django and trying to install and get it running. I have created a small project and when I execute following python manage.py runserver I get this error - ImportError: No module named postgresql_psycopg2.base Here are the details - /net/storm4/dpawar/3rdparty/python2.5.4/

New to Django and a few basic questions

2009-03-04 Thread ch...@secondfoundation.net
Hi group, as the subject says, I'm new to Django. I worked through some tuturials and djangobook.com for the 1.0.2 version as far as there already is documentation. Anyway, I'm still not certain Django is the right answer to my needs. What I want to do: I need to write a web based admin fronten

Re: Cookie problem on multiple sites

2009-03-04 Thread Ramiro Morales
On Wed, Mar 4, 2009 at 9:14 AM, Dids wrote: > > Fixed the problem :) > > Turns out, underscores '_' are not valid characters for domain > names ... > > Told you I was new to this... > > Thanks all for your input, much appreciated :) > Oops, when I saw your email, I searched in my GMail inbox for

Re: Aggregating Ignores Slicing?

2009-03-04 Thread Waylan Limberg
On Mar 3, 8:55 am, Ross wrote: > I have started using aggregation, but it seems to ignore any slicing I > do on a QuerySet before calling aggregate. This is what I'm doing: > > Product.objects.order_by("-price")[:100].values("price").aggregate(Max > ("price"), Min("price")) > > I want the maximum

Django will not match r^sip/conf string in urls.py on Apache2 / modpython

2009-03-04 Thread Dan
Url pattern below r^sip/conf and sip/createfile work for development server but Apache comes up with a 404 error. Note that the error is shown as Apache error not Django parsing error. So, is it Apache not using the Python interpreter or something with Django? Note that changing the name to statio

Re: ImportError: No module named postgresql_psycopg2.base

2009-03-04 Thread Rajesh D
> I am new to Django and trying to install and get it running. I > have created a small project and when I execute following > > python manage.py runserver > > I get this error - > > ImportError:Nomodulenamedpostgresql_psycopg2.base > > Here are the details - > > /net/storm4/dpawar/3rdparty/

Django Flatpages nd set_language

2009-03-04 Thread tdelam
Hi everyone, I am building a bilingual cms type web site using Flatpages and django admin to obviously input the content. I am using django-multilingual. I need to be able to swap languages from one to another remembering the page the user is on, I am aware of set_language and I created a testcas

Re: Django will not match r^sip/conf string in urls.py on Apache2 / modpython

2009-03-04 Thread Rajesh D
On Mar 4, 9:58 am, Dan wrote: > Url pattern below r^sip/conf and sip/createfile work for development > server but Apache comes up with a 404 error. Note that the error is > shown as Apache error not Django parsing error. So, is it Apache not > using the Python interpreter or something with Djan

Re: Django will not match r^sip/conf string in urls.py on Apache2 / modpython

2009-03-04 Thread Rajesh Dhawan
Rajesh D wrote: > On Mar 4, 9:58 am, Dan wrote: > > Url pattern below r^sip/conf and sip/createfile work for development > > server but Apache comes up with a 404 error. Note that the error is > > shown as Apache error not Django parsing error. So, is it Apache not > > using the Python interpre

Re: Django Flatpages nd set_language

2009-03-04 Thread Rajesh D
Hi Trevor, > I am building a bilingual cms type web site using Flatpages and django > admin to obviously input the content. I am using django-multilingual. > I need to be able to swap languages from one to another remembering > the page the user is on, I am aware of set_language and I created a >

what would be a good schema for a facebook mini feed like app ?

2009-03-04 Thread uno...@gmail.com
I have community features in my app - commenting, favoriting,friending etc. I'm wondering what would be a good schema for a facebook like mini feed app ? Where each user's acitivity stream is showed on their profile page. thanks. --~--~-~--~~~---~--~~ You receive

Problems with satchmo

2009-03-04 Thread Oumayrita
I'm New in satchmo I install this store, i tried to see the store by URL:" http://127.0.0.1:8000/shop"; and And i click to display the detail's product, i found this error "Caught an exception while rendering: maximum recursion depth exceeded" I make search but i didn't find a cause for this erro

Re: delete items in queryset results?

2009-03-04 Thread adrian
I ended up doing the following: 1. raw SQL to get the IDs of the rows I want. This required an SQL statement with an inner JOIN subquery specifically: SELECT f.id, f.species_name, f.date from (select species_name, max (date) as maxdate from lister_importedsighting GROUP BY species_name) as x

Re: Problems with satchmo

2009-03-04 Thread Chris Moffitt
You've posted this to the django users group. You'll get more support from the satchmo-users group. When you post there, please include a dpaste link with your traceback. Also, please include which version of Satchmo you're using and the steps required to reproduce the error. -Chris On Wed, Mar

Re: Django will not match r^sip/conf string in urls.py on Apache2 / modpython

2009-03-04 Thread Dan
Looks like I had a sip directory under my templates so was confusing Apache I guess. Anyway, fixed now so thanks. Renamed it as noted above. On Mar 4, 9:10 am, Rajesh Dhawan wrote: > Rajesh D wrote: > > On Mar 4, 9:58 am, Dan wrote: > > > Url pattern below r^sip/conf and sip/createfile work for

CMS on Google Appengine

2009-03-04 Thread poematrix
Is it possible to utilize the Django CMS on Google Appengine? As you know, Google Appengine by default provides support for the Django template system. I am wondering if it is possible to use the CMS as well. Pointers to how-to's regarding this would be much appreciated. Thanks. --~--~-~-

Re: Aggregating Ignores Slicing?

2009-03-04 Thread Alex Gaynor
On Wed, Mar 4, 2009 at 9:24 AM, Waylan Limberg wrote: > > On Mar 3, 8:55 am, Ross wrote: > > I have started using aggregation, but it seems to ignore any slicing I > > do on a QuerySet before calling aggregate. This is what I'm doing: > > > > Product.objects.order_by("-price")[:100].values("pric

Re: what would be a good schema for a facebook mini feed like app ?

2009-03-04 Thread Rajesh D
On Mar 4, 10:25 am, "uno...@gmail.com" wrote: > I have community features in my app - commenting, favoriting,friending > etc. > > I'm wondering what would be a good schema for a facebook like mini > feed app ? Where each user's acitivity stream is showed on their > profile page. Google for Dja

Best practices: generating large dynamic files

2009-03-04 Thread Jeff Gentry
In my project I have a need to generate CSV output files for download. Some of these files aren't overly large - 1-20MB or so, but they can get quite big (currently the largest are several hundred MB and this could grow with time). This would appear to be a case where there's no magic bullet, bu

Re: what would be a good schema for a facebook mini feed like app ?

2009-03-04 Thread uno...@gmail.com
nice.. thanks, that answers my question. On Mar 4, 11:09 am, Rajesh D wrote: > On Mar 4, 10:25 am, "uno...@gmail.com" wrote: > > > I have community features in my app - commenting, favoriting,friending > > etc. > > > I'm wondering what would be a good schema for a facebook like mini > > feed a

getting started...with django

2009-03-04 Thread mseg...@gmail.com
hi there ! am new in django and i need help on getting started... if you are the guy please email me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Re: getting started...with django

2009-03-04 Thread CLIFFORD ILKAY
mseg...@gmail.com wrote: > hi there ! am new in django and i need help on getting started... > if you are the guy please email me Welcome! Start here: . Don't worry if it doesn't all make sense at first. Just follow the steps exactly and b

Re: getting started...with django

2009-03-04 Thread Paul Nema
After the tutorial and reading the docs, if you're the visual type, try these screencasts. Very helpful and illuminating. http://thisweekindjango.com/screencasts/?page=3 and http://showmedo.com/videos/django On Wed, Mar 4, 2009 at 11:58 AM, CLIFFORD ILKAY wrote: > mseg...@gmail.com wrote: > >

translating app name ... again

2009-03-04 Thread patrickk
so far, it doesn´t seem possible to translate the app-names within the admin-interface, which results in a strange index-site with mixed languages. any updates on this issue? any ideas? thanks, patrick --~--~-~--~~~---~--~~ You received this message because you

Django class at the Big Nerd Ranch

2009-03-04 Thread juampa
I am pleased to announce that the Big Nerd Ranch is offering the intensive, five-day Django Bootcamp. If you are interested in learning Django development quickly, this is the place to go. The class is confirmed for April 13-17 2009 in Atlanta, and there are still seats available. Please visit ww

Is a Complex filter with __in and __exact possible?

2009-03-04 Thread Alfonso
I've set up a simple filter to grab a queryset of objects matching a list of (many to many) categories like this: Book.objects.filter(categories__in=[1,2,3]).order_by('name').distinct () It's good, it works... it returns any books in those three categories.But I'd like to return ONLY Books with

Re: URL quoting and escaping

2009-03-04 Thread Rob Hudson
I decided to follow Google's lead and pass it as a parameter of the query string instead and all is well now. Thanks for the feedback... I never considered it might be the web server. -Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: extending admin change_form template

2009-03-04 Thread AmanKow
On Mar 3, 10:50 am, Jon Reck wrote: > I'm a novice Python and Django programmer so please don't assume a lot of > knowledge here. > I'm trying to place a link on an admin change form to a label printing > function. I'd like to pass the id of the current record to the function. If > I hardwire it

Accessing the development server from another machine.

2009-03-04 Thread Joe Goldthwaite
I've been developing with the development server with the default settings without problems. My main development is done in a Windows virtual machine running on a Macbook Pro. Today I wanted to test the output with Safari. Since I don't have that installed in Windows, I decided to just try connect

simple model problem

2009-03-04 Thread arbi
Hello, I am new to Django and programming... I have a model similar to this one : class myModel : attribute 1 = models.ForeignKey(myModel2, primary_key = True) attribute 2 = models.ForeignKey(myModel3, primary_key = True) is it possible to have two primary keys? In fact I want that the id of

Re: Accessing the development server from another machine.

2009-03-04 Thread Alex Gaynor
On 3/4/09, Joe Goldthwaite wrote: > > I've been developing with the development server with the default settings > without problems. My main development is done in a Windows virtual machine > running on a Macbook Pro. Today I wanted to test the output with Safari. > Since I don't have that instal

Re: Accessing the development server from another machine.

2009-03-04 Thread CLIFFORD ILKAY
Joe Goldthwaite wrote: > My main development is done in a Windows virtual machine > running on a Macbook Pro. Today I wanted to test the output with Safari. [snip] > It looks like it's working but when I enter the address in the browser I get > a connection timeout error. The server never gets the

DB Queries of unusual size

2009-03-04 Thread Kottiyath
I am now managing a web server for medium (going on high) traffic site. I see that currently for each POST, it takes ~55-60 separate DB queries for providing a reply. Is this unusual? The total time taken for the queries is less than a second. I looked at the design and it looks somewhat well desi

Re: DB Queries of unusual size

2009-03-04 Thread Alex Gaynor
On Mar 4, 2009, at 1:44 PM, Kottiyath wrote: > > I am now managing a web server for medium (going on high) traffic > site. I see that currently for each POST, it takes ~55-60 separate DB > queries for providing a reply. > Is this unusual? The total time taken for the queries is less than a > s

An easy way to work with webservices and create template tags.

2009-03-04 Thread tristan
I'm a designer learning python and Django by example, and its a brilliant system. On my project I have a set of our own XML webservices to call using a variety of methods. The aim is to then get access to the data returned and expose the individual elements in the XML as Django template tags that

Re: DB Queries of unusual size

2009-03-04 Thread Rajesh D
On Mar 4, 1:44 pm, Kottiyath wrote: > I am now managing a web server for medium (going on high) traffic > site. I see that currently for each POST, it takes ~55-60 separate DB > queries for providing a reply. > Is this unusual? The total time taken for the queries is less than a > second. > I l

Re: DB Queries of unusual size

2009-03-04 Thread Kottiyath
On Mar 5, 12:05 am, Rajesh D wrote: > On Mar 4, 1:44 pm, Kottiyath wrote: > > > I am now managing a web server for medium (going on high) traffic > > site. I see that currently for each POST, it takes ~55-60 separate DB > > queries for providing a reply. > > Is this unusual? The total time tak

Re: formset of ModelForms missing functionality?

2009-03-04 Thread Margie
Hi Malcolm. So after reviewing your pointers, I had high hopes of being able to move to using the modelformset_factory, but I still seem to have problems. The problem I run into is that when _construct_form (the one in django/forms/models.py) is called, it tries to do this: if i < self.

Can't run django on Apache

2009-03-04 Thread John Maines
Hello: I've installed Django 1.0 on Ubuntu and am trying to get it to run on Apache. Apache is installed, working fine, with mod-python also in place. I'm new at everything Linux. But when I try to run my app (a test blog), Apache gives an ImportError message (below) I have come across NUMEROUS

Three Physical Tiers

2009-03-04 Thread ruffeo
Does anyone know how to develop a complex django project in a 3 tiered network environment, still using the MCV architecture? I.E. Web Server (view and control code), App Server (model code), and Database Server --~--~-~--~~~---~--~~ You received this message b

Re: file validation in admin form

2009-03-04 Thread Ty
Perhaps instead of rejecting specific file types, you should only allow specific file types? Most of the time a file upload is taking place the programmer has some sort of idea what the user will upload. This is probably the most secure method, even though it won't work for everyone. On Feb 20, 6

Re: Q search with foreign key

2009-03-04 Thread Jesse
Thanks! That worked. --~--~-~--~~~---~--~~ 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 django-user

Re: Can't run django on Apache

2009-03-04 Thread xankya
I guess u need to set python path to mysite plus django folders In httpd.conf: SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE settings PythonDebug On PythonPath "['path to mysite', 'path to django'] + sys.path" --~--~--

RE: Can't run django on Apache

2009-03-04 Thread Maines, John
Thanks. That's one of the about 50 variables I have tried with the path settings ... still no luck. -- John -Original Message- From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com]on Behalf Of xankya Sent: Wednesday, March 04, 2009 4:28 PM To: Django users Subject:

Re: Can't run django on Apache

2009-03-04 Thread Danny Brown
try above but change /mysite to /mysite/ and settings to mysite/settings On Wed, Mar 4, 2009 at 3:31 PM, Maines, John wrote: > > > Thanks. That's one of the about 50 variables I have tried with the path > settings ... still no luck. > > -- John > > -Original Message- > From: django-user

multiple primary key, solution?

2009-03-04 Thread arbi
Hi all, I read a post dating back to 2007 telling we can create a multiple primary key using " class Meta: unique_together = (('field1', 'field2'),) " in a model like class MyModel(models.Model): field1 = ForeignKey('table1', db_index=True) field2 = ForeignKey('table2', db_inde

RE: Accessing the development server from another machine.

2009-03-04 Thread Joe Goldthwaite
Thanks Alex. That did something. Now I'm getting this; >c:\DjangoProjects\FiscalCalendar>manage.py runserver 0:8000 >Validating models... >0 errors found > >Django version 1.0.2 final, using settings 'FiscalCalendar.settings' >Development server is running at http://0:8000/ >Quit the server wit

Re: multiple primary key, solution?

2009-03-04 Thread Alex Gaynor
On 3/4/09, arbi wrote: > > Hi all, > > I read a post dating back to 2007 telling we can create a multiple > primary key using > > " class Meta: > unique_together = (('field1', 'field2'),) " > > in a model like > > class MyModel(models.Model): > field1 = ForeignKey('table1', db_index=T

Re: Accessing the development server from another machine.

2009-03-04 Thread Karen Tracey
On Wed, Mar 4, 2009 at 4:51 PM, Joe Goldthwaite wrote: > > Thanks Alex. That did something. Now I'm getting this; > > >c:\DjangoProjects\FiscalCalendar>manage.py runserver 0:8000 > >Validating models... > >0 errors found > > > >Django version 1.0.2 final, using settings 'FiscalCalendar.settings'

RE: Accessing the development server from another machine.

2009-03-04 Thread Joe Goldthwaite
I don't think it's a network problem. I've got Zope running on port 80 of this same VM and can access it from any of the other computers. I thought it might be related to using a different port than 80 so I stopped Zope and tried running the development server on 80. That didn't work either. T

JavaScript Frameworks...

2009-03-04 Thread Kyle Hayes
In an effort to better understand loosely what developer's think of the JavaScript frameworks they use, I've created a short survey. It is by no means a scientific representation of an overall census, naturally. I hope to have a somewhat broad enough audience for this short poll. Please share you

Re: CMS on Google Appengine

2009-03-04 Thread brad
On Mar 4, 9:51 am, poematrix wrote: > Is it possible to utilize the Django CMS on Google Appengine? I've just starting looking into Google's App Engine as a possible place to deploy a Django Project. I can't answer your question directly, but there are a couple of articles that might help you:

RE: Accessing the development server from another machine.

2009-03-04 Thread Joe Goldthwaite
Thanks Karen. Tried it. I no longer get the "getaddrinfo failed" error message. I'm now able to access the server as localhost or 127.0.0.1 but no 192.168.1.117. There's got to be something simple I'm missing. This looks like it's designed behavior. There must be a setting somewhere.

Re: Accessing the development server from another machine.

2009-03-04 Thread CLIFFORD ILKAY
Joe Goldthwaite wrote: > I don't think it's a network problem. I've got Zope running on port 80 of > this same VM and can access it from any of the other computers. I thought > it might be related to using a different port than 80 so I stopped Zope and > tried running the development server on 80

Re: Accessing the development server from another machine.

2009-03-04 Thread CLIFFORD ILKAY
Joe Goldthwaite wrote: > Tried it. I no longer get the “getaddrinfo failed” error message. I’m > now able to access the server as localhost or 127.0.0.1 but no > 192.168.1.117. What does the output of "ipconfig" on Windows and whatever the equivalent is in OS X look like? To which machine is 192.

RE: Accessing the development server from another machine.

2009-03-04 Thread Joe Goldthwaite
It makes sense that the dev server won't listen to other requests. The question is then, how to I explicitly specify which address(es) that I want the dev server to listen on? My ipconfig is; Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : mydomainh

Re: Accessing the development server from another machine.

2009-03-04 Thread CLIFFORD ILKAY
Joe Goldthwaite wrote: > It makes sense that the dev server won't listen to other requests. The > question is then, how to I explicitly specify which address(es) that I want > the dev server to listen on? Just like you did when you typed: manage.py runserver 0.0.0.0:8000 (listen on port 8000 on

Re: Appropriate placement for my testcases belonging to a non-app in Django

2009-03-04 Thread Russell Keith-Magee
On Wed, Mar 4, 2009 at 10:10 PM, madhav wrote: > > I have built my website in Django. And like any other django project I > have got apps inside the project root directory and some special > folders like(extensions a.k.a custom django command extensions). With > an app, we dont have any problem w

Re: Is a Complex filter with __in and __exact possible?

2009-03-04 Thread Daniel Hepper
You can try this query: Book.objects.filter(categories=1,categories=2,categories=3) Hope that helps -- Daniel On 4 Mrz., 18:58, Alfonso wrote: > I've set up a simple filter to grab a queryset of objects matching a > list of (many to many) categories like this: > > Book.objects.filter(categori

Re: New to Django and a few basic questions

2009-03-04 Thread Russell Keith-Magee
On Wed, Mar 4, 2009 at 9:54 PM, ch...@secondfoundation.net wrote: > > Hi group, > > as the subject says, I'm new to Django. I worked through some > tuturials and djangobook.com for the 1.0.2 version as far as there > already is documentation. Anyway, I'm still not certain Django is the > right an

Re: extending admin change_form template

2009-03-04 Thread Jon Reck
Thank you so much. Works like a charm. Print Labels -Jon On Wed, Mar 4, 2009 at 1:18 PM, AmanKow wrote: > > On Mar 3, 10:50 am, Jon Reck wrote: > > I'm a novice Python and Django programmer so please don't assume a lot of > > knowledge here. > > I'm trying to place a link on an admin change fo

Why serializing to JSON doesn't work?

2009-03-04 Thread Marek Wawrzyczek
Hello, I've got the code like this: from django.core import serializers ... ret = { } ret['a'] = 'b' json_serializer = serializers.get_serializer("json")() serialized = json_serializer.serialize(ret, ensure_ascii=False) print serialized and this doesn't print serial

AttributeError: 'module' object has no attribute 'TabularInline'

2009-03-04 Thread D
I was getting this error AttributeError: 'module' object has no attribute 'TabularInline' with code i knew was good, After a bit of digging i found my own answer ... posted here for anyone who googles the error message; My dev server version of django was ; python -c "import django; print django

Overriding the HTML id in ModelForm

2009-03-04 Thread Romain
Hello, On the same page I have 2 ModelForm that happen to have an attribute with the same name. Is it possible to choose the name of the HTML id generated by the form without having to change the real name of the model attribute? e.g. class A(models.Model): amount = models.IntegerField() clas

Re: Three Physical Tiers

2009-03-04 Thread Ishwor Gurung
Hi ruffeo wrote: > Does anyone know how to develop a complex django project in a 3 tiered > network environment, still using the MCV architecture? > > I.E. Web Server (view and control code), App Server (model code), and > Database Server model- representation that needs to be modeled into the d

Re: opposite of icontains

2009-03-04 Thread Jeff FW
You'd have to split() the string (probably on spaces, though I don't know exactly what you're going for,) then build a query that checks for each piece OR'd with every other piece. That would probably be the best way--check out: http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-look

Re: opposite of icontains

2009-03-04 Thread Malcolm Tredinnick
On Wed, 2009-03-04 at 05:01 -0800, koranthala wrote: > Hi, > How do I implement a substring query? > Please find the example below. > From Django Documentation: > Entry.objects.get(headline__icontains='Lennon') > => This matches the headline 'Today lennon honoured' > > My query is t

Re: Why serializing to JSON doesn't work?

2009-03-04 Thread Jeff FW
The serializers are for serializing querysets/models. I'm surprised you're not getting an error message there--are you catching all exceptions? What you want is in django.utils.simplejson: from django.utils.simplejson import encoder encoder.JSONEncoder().encode(ret) -Jeff On Mar 4, 6:55 pm, M

Re: delete items in queryset results?

2009-03-04 Thread Malcolm Tredinnick
On Wed, 2009-03-04 at 07:39 -0800, adrian wrote: > > I ended up doing the following: > > 1. raw SQL to get the IDs of the rows I want. This required an SQL > statement with an inner JOIN subquery specifically: > > SELECT f.id, f.species_name, f.date from (select species_name, max > (date) as

Re: Three Physical Tiers

2009-03-04 Thread ruffeo
This was extremely helpful. What about the need to protect the database from intrusion? Since there is only one hop from the webserver to the database server (2 tiers). At my job, the school of thought is that the middle tier is the only server that can access the database (ip restriction) which i

Re: translating app name ... again

2009-03-04 Thread Malcolm Tredinnick
On Wed, 2009-03-04 at 09:39 -0800, patrickk wrote: > so far, it doesn´t seem possible to translate the app-names within the > admin-interface, which results in a strange index-site with mixed > languages. > > any updates on this issue? any ideas? If you put each of your app names into a file tha

Re: simple model problem

2009-03-04 Thread Malcolm Tredinnick
On Wed, 2009-03-04 at 10:43 -0800, arbi wrote: > Hello, > I am new to Django and programming... > I have a model similar to this one : > > class myModel : > attribute 1 = models.ForeignKey(myModel2, primary_key = True) > attribute 2 = models.ForeignKey(myModel3, primary_key = True) > > is it

Re: formset of ModelForms missing functionality?

2009-03-04 Thread Malcolm Tredinnick
On Wed, 2009-03-04 at 11:44 -0800, Margie wrote: > Hi Malcolm. So after reviewing your pointers, I had high hopes of > being able to move to using the modelformset_factory, but I still seem > to have problems. The problem I run into is that when _construct_form > (the one in django/forms/models.

Re: Overriding the HTML id in ModelForm

2009-03-04 Thread Eric Abrahamsen
On Mar 5, 2009, at 8:05 AM, Romain wrote: > > Hello, > > On the same page I have 2 ModelForm that happen to have an attribute > with the same name. Is it possible to choose the name of the HTML id > generated by the form without having to change the real name of the > model attribute? A simple

Possible bug in admin?

2009-03-04 Thread Julien Phalip
Hi, I can't find the exact cause of this, but it seems as though something has changed in the admin's email widget. For one of my project I just upgraded Django from revision 9294 to 9975. Symptomatically, with the recent version, the email field doesn't have the CSS class 'vTextField', which m

Re: Three Physical Tiers

2009-03-04 Thread Mike Ramirez
On Wednesday 04 March 2009 05:43:41 pm ruffeo wrote: > This was extremely helpful. What about the need to protect the > database from intrusion? Since there is only one hop from the > webserver to the database server (2 tiers). At my job, the school of > thought is that the middle tier is the only

New version of open source Django stack appliance

2009-03-04 Thread Liraz
Hello everyone, We just released a new version of our Django stack appliance: http://www.turnkeylinux.org/appliances/django Changes include: * Security: SSL support, crypto key regeneration during installation, database password setting during installation. * Usability: confconsole support

ModelAdmin get_urls w/ invalid literal for int() with base 10

2009-03-04 Thread Brian Neal
I'd like to make my own custom view. In the past I did this by following the django book and added a URL to my main urlpatterns above the '^admin/(.*)' pattern. But I noticed a new get_urls function on the ModelAdmin class in the docs. I'm on trunk, and just did an svn update to 9975 to try this o

Re: Overriding the HTML id in ModelForm

2009-03-04 Thread Alex Gaynor
On 3/4/09, Eric Abrahamsen wrote: > > > On Mar 5, 2009, at 8:05 AM, Romain wrote: > >> >> Hello, >> >> On the same page I have 2 ModelForm that happen to have an attribute >> with the same name. Is it possible to choose the name of the HTML id >> generated by the form without having to change the

Re: Is a Complex filter with __in and __exact possible?

2009-03-04 Thread Malcolm Tredinnick
On Wed, 2009-03-04 at 15:06 -0800, Daniel Hepper wrote: > You can try this query: > > Book.objects.filter(categories=1,categories=2,categories=3) > > Hope that helps It won't. A filter() method is a normal Python function or method call. You can only specify each keyword argument exactly once.

Re: Possible bug in admin?

2009-03-04 Thread Alex Gaynor
On 3/4/09, Julien Phalip wrote: > > Hi, > > I can't find the exact cause of this, but it seems as though something > has changed in the admin's email widget. > > For one of my project I just upgraded Django from revision 9294 to > 9975. > > Symptomatically, with the recent version, the email fiel

Re: Is a Complex filter with __in and __exact possible?

2009-03-04 Thread Malcolm Tredinnick
On Wed, 2009-03-04 at 09:58 -0800, Alfonso wrote: > I've set up a simple filter to grab a queryset of objects matching a > list of (many to many) categories like this: > > Book.objects.filter(categories__in=[1,2,3]).order_by('name').distinct > () > > It's good, it works... it returns any books i

Re: Is a Complex filter with __in and __exact possible?

2009-03-04 Thread Malcolm Tredinnick
On Thu, 2009-03-05 at 14:19 +1100, Malcolm Tredinnick wrote: [...] > Second version: I want books that are in all three categories, but just > those three categories and *no others*. > > Answer: hmmm... :-( > > This one is possible in raw SQL, but it's a fairly fiddly query. I can't > make it wo

Re: Possible bug in admin?

2009-03-04 Thread Julien Phalip
On Mar 5, 2:16 pm, Alex Gaynor wrote: > On 3/4/09, Julien Phalip wrote: > > Hi, > > > I can't find the exact cause of this, but it seems as though something > > has changed in the admin's email widget. > > > For one of my project I just upgraded Django from revision 9294 to > > 9975. > > > Sympt

Re: Possible bug in admin?

2009-03-04 Thread Alex Gaynor
On Mar 4, 2009, at 10:33 PM, Julien Phalip wrote: > > On Mar 5, 2:16 pm, Alex Gaynor wrote: >> On 3/4/09, Julien Phalip wrote: >>> Hi, >> >>> I can't find the exact cause of this, but it seems as though >>> something >>> has changed in the admin's email widget. >> >>> For one of my project

Re: Possible bug in admin?

2009-03-04 Thread Julien Phalip
On Mar 5, 2:40 pm, Alex Gaynor wrote: > On Mar 4, 2009, at 10:33 PM, Julien Phalip wrote: > > > > > > > On Mar 5, 2:16 pm, Alex Gaynor wrote: > >> On 3/4/09, Julien Phalip wrote: > >>> Hi, > > >>> I can't find the exact cause of this, but it seems as though   > >>> something > >>> has changed

Re: formset of ModelForms missing functionality?

2009-03-04 Thread Margie
Yes, I agree with what you are saying about self._initial_form_count being set to a number greater than zero due to me using initial in my code that creates the formset, as follows: def makeTaskDetailFormSetForCreate(tileList, data=None): TaskDetailFormSet = modelformset_factory(TaskDetail,

Re: ModelAdmin get_urls w/ invalid literal for int() with base 10

2009-03-04 Thread Brian Neal
On Mar 4, 9:11 pm, Brian Neal wrote: > I'd like to make my own custom view. In the past I did this by > following the django book and added a URL to my main urlpatterns above > the '^admin/(.*)' pattern. But I noticed a new get_urls function on > the ModelAdmin class in the docs. I'm on trunk, an

Re: formset of ModelForms missing functionality?

2009-03-04 Thread Malcolm Tredinnick
On Wed, 2009-03-04 at 19:47 -0800, Margie wrote: > Yes, I agree with what you are saying about self._initial_form_count > being set to a number greater than zero due to me using initial in my > code that creates the formset, as follows: > > def makeTaskDetailFormSetForCreate(tileList, data=None):

Re: ModelAdmin get_urls w/ invalid literal for int() with base 10

2009-03-04 Thread Brian Neal
On Mar 4, 10:06 pm, Brian Neal wrote: > On Mar 4, 9:11 pm, Brian Neal wrote: > > > > > I'd like to make my own custom view. In the past I did this by > > following the django book and added a URL to my main urlpatterns above > > the '^admin/(.*)' pattern. But I noticed a new get_urls function on

  1   2   >