Filtering does not work through recursive models

2009-02-01 Thread James Pearce
(or so it seems) My model has a class with a reference to itself. It's for modelling a hierarchy of geographical areas. (e.g. cities in states, states in countries, countries in continents etc) class Area(models.Model): name = models.CharField(max_length=50) parent

Re: Admin get_urls

2009-02-01 Thread Dave Fowler
Daniel, thanks for the response I'm on the latest svn version d...@django$ svn up At revision 9803. so my version shouldn't be the issue. On Feb 2, 1:44 am, Daniel Roseman wrote: > On Feb 1, 10:11 pm, Dave Fowler wrote: > > > > > I'm

Re: "invalid reference to FROM-clause" for nested annotate query

2009-02-01 Thread omat
I just remembered that the above error occured when running on Postgresql 8.2. Sorry for the misinformation about SQLite. Then to give it a try with SQLite, I built a fresh database with syncdb on SQLite. This time, at the same point, I get a: OperationalError: no such column:

Re: Admin get_urls

2009-02-01 Thread Daniel Roseman
On Feb 1, 10:11 pm, Dave Fowler wrote: > I'm adding new views to my admin models.  The documentation is > here:http://docs.djangoproject.com/en/dev/ref/contrib/admin/#get-urls-self > > and the following is my implementation ( I think the same thing ) > > from

Django-gitosis

2009-02-01 Thread Jeff Anderson
Hello fellow Django users! I've been wanting to set up gitosis on a server for a while now. I think a new Django app might make this easier for the end users. The people that'd access the git repos I want to host could simply put their public SSH key in their Django-powered user profile, the

Re: Django newbie question re: porting from Google App Engine to Django standalone

2009-02-01 Thread Rama Vadakattu
Please have a look at the below link: http://code.google.com/appengine/articles/pure_django.html May be it helps you in porting the app from appengine to django. --rama On Feb 1, 5:16 am, "Mark.Petrovic" wrote: > Good day.  I'm new here, as well as a new (all of two

Re: trouble with Django and javascript

2009-02-01 Thread Will Matos
The problem is that the iframe is part of the main page. When the main page is refreshed, the iframe goes with it. Unless you have the form in a separate iframe the behavior will continue to be the same. W - Original Message - From: django-users@googlegroups.com

Re: trouble with Django and javascript

2009-02-01 Thread min
Not working. Still the same problem( when button is clicked, the text of "This is a test" will display in the iframe for one second, and then disappear.). On Feb 2, 12:55 pm, "Will Matos" wrote: > Onclick="test();submit();" > Will Matos > TCDI > Dir. of Tech. Sales > > > > -

Re: trouble with Django and javascript

2009-02-01 Thread Will Matos
Onclick="test();submit();" Will Matos TCDI Dir. of Tech. Sales - Original Message - From: django-users@googlegroups.com To: Django users Sent: Sun Feb 01 20:54:32 2009 Subject: Re: trouble with Django and javascript If I

Re: trouble with Django and javascript

2009-02-01 Thread min
If I use Onclick="submit();", how to add the javascript function " test ()" to that buttom? thanks On Feb 2, 11:58 am, "Will Matos" wrote: > Onclick="submit();" > Will Matos > TCDI > Director of Technical Sales > 4510 Weybridge Lane > Greensboro, NC  27407 > 336.232.5832 office

Re: Using hashing for password checking in auth module

2009-02-01 Thread Malcolm Tredinnick
On Sun, 2009-02-01 at 01:07 -0800, Guy Rutenberg wrote: > Hi Kless, > > > On Jan 31, 7:05 pm, Kless wrote: > > > > Your method has a point of failure. Whatever can see your code JS > > (client-code), so he will know what are you making with the password > > that is

Re: trouble with Django and javascript

2009-02-01 Thread Will Matos
Onclick="submit();" Will Matos TCDI Director of Technical Sales 4510 Weybridge Lane Greensboro, NC 27407 336.232.5832 office 336.232.5850 fax 336.414.0467 mobile - Original Message - From: django-users@googlegroups.com To: Django users

Re: django sqlite autoincrement bug

2009-02-01 Thread Malcolm Tredinnick
On Sat, 2009-01-31 at 16:56 -0500, alexander lind wrote: > > > > > > > class User(models.Model): > > > user_id = models.AutoField(primary_key=True) > > > > > > This produces a table in sqlite that will NOT take NULL for a > > > value > > > when inserting records. You get an error back. > >

Re: trouble with Django and javascript

2009-02-01 Thread min
Thanks for you reply. However, if I change the 'submit' to button, how can I submit the form to the server? Regards min On Feb 2, 11:34 am, "Todd O'Bryan" wrote: > In addition to displaying the message, it's also submitting the form, > so you see the text for a second

Re: trouble with Django and javascript

2009-02-01 Thread min
Thanks for you reply. However, if I change the 'submit' to button, how can I submit the form to the server? Regards min On Feb 2, 11:34 am, "Todd O'Bryan" wrote: > In addition to displaying the message, it's also submitting the form, > so you see the text for a second

Re: trouble with Django and javascript

2009-02-01 Thread min
Thanks for you reply. However, if I change the 'submit' to button, how can I submit the form to the server? Regards min On Feb 2, 11:34 am, "Todd O'Bryan" wrote: > In addition to displaying the message, it's also submitting the form, > so you see the text for a second

Re: trouble with Django and javascript

2009-02-01 Thread min
Thanks for you reply. However, if I change the 'submit' to button, how can I submit the form to the server? On Feb 2, 11:34 am, "Todd O'Bryan" wrote: > In addition to displaying the message, it's also submitting the form, > so you see the text for a second and then the

Re: trouble with Django and javascript

2009-02-01 Thread min
Thanks for you reply. However, if I change the 'submit' to button, how can I submit the form to the server? On Feb 2, 11:34 am, "Todd O'Bryan" wrote: > In addition to displaying the message, it's also submitting the form, > so you see the text for a second and then the

Re: Meta-information for model and form fields

2009-02-01 Thread Malcolm Tredinnick
On Sat, 2009-01-31 at 13:13 -0800, Vinay Sajip wrote: > > > On Jan 30, 1:36 am, Malcolm Tredinnick > wrote: > > On Wed, 2009-01-28 at 23:21 -0800, Vinay Sajip wrote: > > > > [...] > > > > > I was hoping there was another way. Of course subclassing's not hard > > > to

Re: trouble with Django and javascript

2009-02-01 Thread Todd O'Bryan
In addition to displaying the message, it's also submitting the form, so you see the text for a second and then the form reloads. Change the instead of "submit" and see if that helps. Todd On Sun, Feb 1, 2009 at 6:05 PM, min wrote: > > First I have a form: > > class

Re: Basic question: filtering objects by date

2009-02-01 Thread Todd O'Bryan
How about: items = Item.objects.filter(categories=category, expire_date__gt=today) ? Todd On Sun, Feb 1, 2009 at 2:04 PM, KJ wrote: > > Hi, I want to filter objects based on whether they have expired or > not. Each object has an expiration date. Right now, I am

Re: trouble with Django and javascript

2009-02-01 Thread min
Besides, I use firefox. On Feb 2, 10:05 am, min wrote: > First I  have a form: > > class TestForm(forms.Form): >   name = forms.CharField( max_length=30 ) >   age = forms.CharField( max_length=30 ) > > Then in the views.py: > > def Test_page(request): > >   form =

Re: Auction app

2009-02-01 Thread Dave Fowler
There's Django Satchmo http://www.satchmoproject.com/ But it doesn't do auctions yet. I haven't heard of anything else... On Feb 1, 12:10 pm, Erik Allik wrote: > Does anyone know of an app written for Django that implements a kind   > of (simple) web-auction functionality

Django with mod_fcgid

2009-02-01 Thread MIke
Hi, I just started looking at Django, and since I'm using mod_fcgid anyhow for other things, I thought I'd look into using it with Django as well. One benefit of mod_fcgid over mod_fastcgi is that it does all process management for you, and in my impression it's quite well- behaved. Turns out

Re: Customized model methods

2009-02-01 Thread Dave Fowler
Well you might want to start by looking into django-tagging http://code.google.com/p/django-tagging/wiki/UsefulTips Install that for easy tags, and that link to the useful tips shows how to retrieve and set tags. Also instead of doing a lot of is_this() and is_that() you will probably want to

Admin get_urls

2009-02-01 Thread Dave Fowler
I'm adding new views to my admin models. The documentation is here: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#get-urls-self and the following is my implementation ( I think the same thing ) from django.conf.urls.defaults import * class AisleAdmin(admin.ModelAdmin): def

Customized model methods

2009-02-01 Thread Alex Jonsson
Hey guys, I'm looking to create a model method like is_(), where the tag can be used to lookup if the object is tagged with a certain ... tag. Kind of like this: A blog entry is tagged "personal" and "funny". >> blog_entry.is_sports() False >> blog_entry.is_personal() True >>

Re: Inherit/Override custom Form class methods in a custom ModelForm class

2009-02-01 Thread Stewart
That's perfect. Thanks to both of 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@googlegroups.com To unsubscribe from this group, send

Re: Merging results from two tables

2009-02-01 Thread Markus
Thanks, that did the trick!! On Jan 31, 6:07 pm, Daniel Roseman wrote: > On Jan 31, 12:27 pm, Markus wrote: > > > > > Hi > > > just starting to use Django, am stuck with the following problem: > > > Given > > > class A(models.Model): > >    

Re: "invalid reference to FROM-clause" for nested annotate query

2009-02-01 Thread omat
Hi, TaggedItem model is as follows: class TaggedItem(models.Model): tag = models.ForeignKey(Tag, verbose_name=_('tag'), related_name='items') added = models.DateTimeField(auto_now_add=True) content_type = models.ForeignKey(ContentType, verbose_name=_ ('content type')) object_id

Re: Writing custom model fields with Multi-table inheritance

2009-02-01 Thread Viktor
Hi, did you got any response or did you managed to solve your problem? I've just started to search for a UUIDField, and it would be great to have proper uuid columns for postgres. If so do you plan to commit it to django_extensions? Thanks, Viktor On 2008 dec. 16, 22:53, gordyt

Re: Cookie test in login() view

2009-02-01 Thread Akbar
Thanks Karen. I have raised ticket #10166 On Feb 1, 1:23 am, Karen Tracey wrote: > On Sat, Jan 31, 2009 at 9:36 PM, Akbar wrote: > > > Hi, > > > The cookie test in django.contrib.auth.views.login() view doesn't seem > > to work as expected. I disabled

Basic question: filtering objects by date

2009-02-01 Thread KJ
Hi, I want to filter objects based on whether they have expired or not. Each object has an expiration date. Right now, I am getting all the objects via this line: items = Item.objects.filter(categories=category) However, I only want to get the "items" which have not expired (expire_date

Re: Application design question

2009-02-01 Thread eddie
Thanks Alex, that was exactly what I was looking for. On Jan 31, 8:06 pm, "alex.gay...@gmail.com" wrote: > On Jan 31, 8:04 pm, eddie wrote: > > > > > Hey guys & girls, > > > I've just started playing with django, and am not sure of the best way > > to

Auction app

2009-02-01 Thread Erik Allik
Does anyone know of an app written for Django that implements a kind of (simple) web-auction functionality suitable for, say, selling arts, valuable old books, or just random items? Erik --~--~-~--~~~---~--~~ You received this message because you are

Re: URL mismatch when moving from django server to apache server on windows

2009-02-01 Thread Karen Tracey
On Sun, Feb 1, 2009 at 9:04 AM, Robert wrote: > > I have set up apache with mod_python and I am able to get django > working. > > I am trying to reach the simple poll application that is in the > djangoproject tutorial. > > I have to add "mysite" in the url when I work with

Re: __icontains in case of non ascii symbols

2009-02-01 Thread Karen Tracey
On Sun, Feb 1, 2009 at 6:57 AM, Konstantin S wrote: > > Hello again :) > > Am I right that __icontains relays on DB backend entirely to perform > case insensitive search ? > Yes. Karen --~--~-~--~~~---~--~~ You received this message

Re: Three table Lookup Question

2009-02-01 Thread Karen Tracey
On Sun, Feb 1, 2009 at 4:36 AM, Kyle wrote: > Hello again. > > I have one more question about the three table lookup I am trying to > complete. > > The details of my situation are posted here: http://dpaste.com/115244/ > > Does anybody have any idea on how to use django's

URL mismatch when moving from django server to apache server on windows

2009-02-01 Thread Robert
I have set up apache with mod_python and I am able to get django working. I am trying to reach the simple poll application that is in the djangoproject tutorial. I have to add "mysite" in the url when I work with apache. This wasn't the case with the django server.

Re: commit=False and m2m relations in forms

2009-02-01 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 9:53 PM, Konstantin wrote: > > On Feb 1, 2:23 pm, Russell Keith-Magee wrote: >> Yes. Read up on how to use the save() method in the modelforms docs. >> >>

Re: commit=False and m2m relations in forms

2009-02-01 Thread Konstantin
On Feb 1, 2:23 pm, Russell Keith-Magee wrote: > Yes. Read up on how to use the save() method in the modelforms docs. > > http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-sav... > > In particular, the second example in that section should answer your

Re: Using hashing for password checking in auth module

2009-02-01 Thread Kless
Hi Rutenberg, I just find anything that can be of interest for you. It's a "secure" method to login without https. Althought it isn't realy secure in comparison to https. http://www.pylucid.org/about/features/JS-SHA-Login/ On 1 feb, 09:07, Guy Rutenberg wrote: > I

__icontains in case of non ascii symbols

2009-02-01 Thread Konstantin S
Hello again :) Am I right that __icontains relays on DB backend entirely to perform case insensitive search ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: docs: Problem with 'make html'

2009-02-01 Thread Ramiro Morales
On Sat, Jan 31, 2009 at 8:48 AM, Benjamin Buch wrote: > > Hi, > > if I do 'make html' in my django-trunk/docs directory, I get this error: > > [...] > > Traceback (most recent call last): > File "/opt/local/lib/python2.5/site-packages/sphinx/__init__.py", > line 114, in main

Re: commit=False and m2m relations in forms

2009-02-01 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 8:12 PM, Konstantin S wrote: > > Hello! > > I couldn't add m2m relations in my form if I use delayed commit, i.e. > form.save(commit = False) and form.save() later on. See code at > http://dpaste.com/hold/115253/. Is there some common pattern to >

commit=False and m2m relations in forms

2009-02-01 Thread Konstantin S
Hello! I couldn't add m2m relations in my form if I use delayed commit, i.e. form.save(commit = False) and form.save() later on. See code at http://dpaste.com/hold/115253/. Is there some common pattern to workaround such issues ? --~--~-~--~~~---~--~~ You

Re: Someone using django trunk for production?

2009-02-01 Thread Russell Keith-Magee
On Sat, Jan 31, 2009 at 7:24 PM, Alessandro Ronchi wrote: > > I need to use aggregation features of django 1.1 (i need AVG, SUM). > > My production site uses 1.0.2. > > Can I upgrade to trunk without worrying? Would I expect to see any major failures? No. Would I

Re: Using ./manage.py test without a database and with a custom test runner fails

2009-02-01 Thread Russell Keith-Magee
On Sun, Feb 1, 2009 at 7:42 PM, Jarkko Laiho wrote: > >> The doc about defining a different test runner starts with the assumption >> you are not using Django's test framework -- I read that to mean you are not >> using django.test.TestCase tests, for example. You can't

Re: Using ./manage.py test without a database and with a custom test runner fails

2009-02-01 Thread Jarkko Laiho
> The doc about defining a different test runner starts with the assumption > you are not using Django's test framework -- I read that to mean you are not > using django.test.TestCase tests, for example.  You can't just rip out the > database-create/destroy parts of the test runner and still

Anyone know how to install and run django on IronPython 2.0?

2009-02-01 Thread IL
I'm a new coming. I know MS has showed the django on IronPython. But I failed to do this. Anyone can help? Django 1.0.2 IronPython 2.0 OS: winXP sp3 command: ipy.exe setup.py install Failed and show "File c:\documents does not exist." I copy from cpython folder directly, and try Template.

Re: Three table Lookup Question

2009-02-01 Thread Kyle
Hello again. I have one more question about the three table lookup I am trying to complete. The details of my situation are posted here: http://dpaste.com/115244/ Does anybody have any idea on how to use django's ORM to perform two INNER JOINS, a WHERE, and an ORDER BY? Thanks in advance for

docs: Problem with 'make html'

2009-02-01 Thread Benjamin Buch
Hi, if I do 'make html' in my django-trunk/docs directory, I get this error: mkdir -p _build/html _build/doctrees sphinx-build -b html -d _build/doctrees . _build/html Exception occurred: File "/Users/benjamin/Code/django/django-trunk/docs/_ext/ djangodocs.py", line 15, in setup

Re: Using hashing for password checking in auth module

2009-02-01 Thread Guy Rutenberg
Hi Kless, On Jan 31, 7:05 pm, Kless wrote: > > Your method has a point of failure. Whatever can see your code JS > (client-code), so he will know what are you making with the password > that is sent from a form. > > The best options are https or using

Re: User Profiles and Fixtures

2009-02-01 Thread stryderjzw
Well, it looks like I was able to solve this particular problem. In the fixtures, I changed the order when loading the data. I now load the Profile first, and then the User. That works. I guess writing the problem down helped me think of potential solutions. :P Still, I'm going to have to

User Profiles and Fixtures

2009-02-01 Thread stryderjzw
Hi! I did some searching, but I felt it's going nowhere, so here's the question. I'm using Django 1.1 r9756, the one where tests are using transactions. I have a user profile automatically created with signals, as below: def create_player(sender, instance=None, **kwargs): if instance