Re: admin: add save -> error

2010-05-27 Thread Philipp
Thanks a lot Karen, I did google and found some more info here: http://trac.turbogears.org/ticket/2133#comment:11 just as a note, this is an issue on Django Developer Kit 1.2.1 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: admin: add save -> error

2010-05-27 Thread Karen Tracey
On Fri, May 28, 2010 at 2:11 AM, Karen Tracey wrote: > Workarounds for you prior to getting a fix into Django would be to get rid > of the standalone hashlib that's apparently installed, or use a more recent > level of Python. > ...or use an older (e.g. 1.1.2) level of Django is the other option

Re: admin: add save -> error

2010-05-27 Thread Karen Tracey
On Thu, May 27, 2010 at 7:13 PM, Philipp wrote: > Hello Django Users > > I'm a beginner going through the tutorial. I do have a problem using > the admin interface. > I can't add new records. Save results in: http://dpaste.de/UoBH/ > If I'm using the shell, everything works fine: http://dpaste.de

Re: admin: add save -> error

2010-05-27 Thread Philipp
I just realized, that I'm using python 2.4.4 which is not the latest, but within the django requirments. Thank you! Philipp -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To

Looking for a good CRUD example

2010-05-27 Thread Lee Hinde
Hi; I've appreciated the sample apps out there as great learning tools. I'm having problems saving existing records (new ones get created instead?) and with validation. But rather than pepper the group with my ?s, I'd like to do some more code reviews. So, I'm wondering if you can recommend one

Re: best approach to solve statistical problem

2010-05-27 Thread Kenneth Gonsalves
On Friday 28 May 2010 10:20:55 darren wrote: > Needing to get this done, I went with SQL. The sql seems rather > inefficient. But, my data set will be rather small. I posted what I > went with on Pastebin: http://pastebin.com/VmiYNXan (good for 24 > hrs). > > I don't have much data loaded (jus

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
Yea, I just discovered that... On Thu, May 27, 2010 at 9:10 PM, Vinicius Mendes wrote: > Just be careful with the index errors. If you are sure that this query will > allway have at least one item, so this is fine. But if it returns an empty > queryset, so you will have trouble with IndexError.

Re: db autoclobbering with automated tests

2010-05-27 Thread Rolando Espinoza La Fuente
On Thu, May 27, 2010 at 2:00 PM, dmitry b wrote: > So, no one is running automated tests? I'd added a patch that adds the --noinput option to testserver command: http://code.djangoproject.com/ticket/12619 ~Rolando -- You received this message because you are subscribed to the Google Groups "D

Re: best approach to solve statistical problem

2010-05-27 Thread darren
Needing to get this done, I went with SQL. The sql seems rather inefficient. But, my data set will be rather small. I posted what I went with on Pastebin: http://pastebin.com/VmiYNXan (good for 24 hrs). I don't have much data loaded (just one tournament). But, you can see the resulting table

db problems after upgrading

2010-05-27 Thread darren
I upgraded django version from (not exactly sure) about 1.0 to 1.2. After doing so, if I run manage.py syncdb, I get messages saying I need to add unique constraints. I added "unique=True" to the columns in the model that were indicated. However, I continue to get the messages. That didn't turn

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Vinicius Mendes
Just be careful with the index errors. If you are sure that this query will allway have at least one item, so this is fine. But if it returns an empty queryset, so you will have trouble with IndexError. Atenciosamente, Vinicius Mendes Solucione Sistemas vinic...@solucione.info On Thu, May 27, 20

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
On Thu, May 27, 2010 at 5:44 PM, Lee Hinde wrote: > weather = > Weather.objects.filter(weather_date=self.target_date,zip_code=self.created_by.store.zip_code) > > so, the solution was def get_weather(self): weather = Weather.objects.filter(weather_date=self.target_date,zip_code=self.cr

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
On Thu, May 27, 2010 at 12:22 PM, chr wrote: > On May 27, 11:46 am, Lee Hinde wrote: > > So, if I were to display a list of notes, how would I join those two > > together? > > if i get you right, you could accomplish this by using a model method > > get_weather(self): > weather = Weather.object

Re: Target WSGI script not found or unable to stat

2010-05-27 Thread Graham Dumpleton
On May 28, 6:27 am, mojito wrote: > > > When I come to deploy my django app on Apache , I get this error. > > > >  [error] [client 127.0.0.1] Target WSGI script not found or unable to > > > stat: C:/wsgi-django-app > > > /testing/apache/django.wsgi > > > This will occur where the user that the A

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Graham Dumpleton
On May 28, 8:35 am, Chris Seberino wrote: > On May 27, 10:51 am, Nuno Maltez wrote: > > > > ImportError: No module named mvc > > > What's the "mvc" module? Python can't seem to find it. Is it in your > > python path? > > My project is called seoconquer. > My app is called mvc. > My absolute dir

admin: add save -> error

2010-05-27 Thread Philipp
Hello Django Users I'm a beginner going through the tutorial. I do have a problem using the admin interface. I can't add new records. Save results in: http://dpaste.de/UoBH/ If I'm using the shell, everything works fine: http://dpaste.de/q5O0/ I'm using 1.2.1 and the dev server. I tried different

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Chris Seberino
On May 27, 10:51 am, Nuno Maltez wrote: > > ImportError: No module named mvc > > What's the "mvc" module? Python can't seem to find it. Is it in your > python path? My project is called seoconquer. My app is called mvc. My absolute directory path to mvc is /home/seb/MAIN/seoconquer/mvc. I have /

Newbie having problems with django project tutorial setup - errors with psycopg2

2010-05-27 Thread Cyndi Bussey
Hi, I am a brand newbie learning how to use django with python (using progresql). I am also not very experienced with packages. However, I have been trying to follow the tutorial on djangoproject.com and I have been having a problem with psycopg2 I had been having problems installing in general

Re: testing client.get('/yo/', {}, HTTPS='on') ?

2010-05-27 Thread nikolaj.baer
> Starting at > ...http://docs.djangoproject.com/en/dev/topics/testing/#django.test.clie... > > ... how do we test with HTTPS turned on? This doesn't work: > >   client.get('/yo/', {}, HTTPS='on') Of course the answer is that Django test client uses WSGIRequest, which checks for "wsgi.url_schem

Integrity error during syncdb with multidb.

2010-05-27 Thread J. Cliff Dyer
Hey all, I'm trying to set up django 1.2 to work with database replication in MySQL. When I run syncdb, I get an integrity error when content_types starts creating its data. Replication seems to be occurring, so I suspect I'm doing something wrong with my routing. Is there some gotcha I'm missi

testing client.get('/yo/', {}, HTTPS='on') ?

2010-05-27 Thread Phlip
Djangoists: Starting at ... http://docs.djangoproject.com/en/dev/topics/testing/#django.test.client.Client.get ... how do we test with HTTPS turned on? This doesn't work: client.get('/yo/', {}, HTTPS='on') All we can find is documentation to turn it off, which is somewhat fruity if it's off

django queryset issue

2010-05-27 Thread weiwei
Hi all, Here is my question details http://stackoverflow.com/questions/2915880/django-objects-all-method-... this is driving me crazy, after a save(), i can see the new data in mysal db, but i cannot get new data from queryset. Thanks in advance. -- You received this message because you are subs

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
On Thu, May 27, 2010 at 12:22 PM, chr wrote: > On May 27, 11:46 am, Lee Hinde wrote: > > So, if I were to display a list of notes, how would I join those two > > together? > > if i get you right, you could accomplish this by using a model method > > get_weather(self): > weather = Weather.object

Re: Django v1.2 TestCase doesn't seem to load fixtures except 'initial_data'

2010-05-27 Thread Karen Tracey
On Thu, May 27, 2010 at 3:34 PM, Bryan wrote: > just checked this again. > > I changed the fixtures name to: > > $ ls forum/fixtures > forum_fixtures.json > > class UserProfileTestCases(TestCase): >"""These are tests to verify that refactoring of UserProfile is > correct""" >fixtures = ['

Re: Target WSGI script not found or unable to stat

2010-05-27 Thread mojito
> > When I come to deploy my django app on Apache , I get this error. > > >  [error] [client 127.0.0.1] Target WSGI script not found or unable to > > stat: C:/wsgi-django-app > > /testing/apache/django.wsgi > > This will occur where the user that the Apache service runs as does > not have the neces

Re: Django v1.2 TestCase doesn't seem to load fixtures except 'initial_data'

2010-05-27 Thread Bryan
I just checked this again. I changed the fixtures name to: $ ls forum/fixtures forum_fixtures.json class UserProfileTestCases(TestCase): """These are tests to verify that refactoring of UserProfile is correct""" fixtures = ['forum_fixtures.json'] $ python manage.py test Creating test da

Re: best approach to solve statistical problem

2010-05-27 Thread darren
Drats! It looks like my HTML table came out jumbled. I'll try to post it somewhere where it is more legible. But, it will be a few hours. One idea that came to mind after I submitted my question was to break out the results column into individual booleans. So, my model would look more like: C

Re: Four Hop, Two Criteria Query

2010-05-27 Thread chr
On May 27, 11:46 am, Lee Hinde wrote: > So, if I were to display a list of notes, how would I join those two > together? if i get you right, you could accomplish this by using a model method get_weather(self): weather = Weather.objects.filter(weather_date=self.created, ... cheers, chr -- Yo

best approach to solve statistical problem

2010-05-27 Thread darren
I'm looking for ideas on the best way to approach this problem. Should I write raw SQL, stay with the ORM or even mix Javascript with either ORM or SQL? I want to keep up with player stats for a baseball team.  I've been reading up on aggregates and annotations.  And, I'm getting somewhere with it

Re: Creating a custom view in Django admin,

2010-05-27 Thread chr
On May 26, 7:02 pm, Dexter wrote: > Another thing: > > At the event model, it is unnecessary to display all the events in the > admin. How can I make sure only the events coming (ie > date__gte=datetime.now()) are displayed in the admin? i think a proxy model[1] might work where you set the defau

Re: Multitable inheritance - reverse relation

2010-05-27 Thread bohemian
I haven't think about it this way. It works (using "a_ptr__b"). Thank you for help Scott! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send em

password reset getting error - 'function' object is not iterable

2010-05-27 Thread Pankaj Singh
I am getting this error while accessing password reset page.I want to use custom template for password reset page instead of standard django page. how should I proceed. **

Re: db autoclobbering with automated tests

2010-05-27 Thread dmitry b
So, no one is running automated tests? On May 24, 4:16 pm, dmitry b wrote: > Hi, > > I'm in the process of setting up automated selenium tests for a django > app using Hudson.  As part of the build script, I'm starting up a test > server: > > $> python manage.py testserver --addrport 0.0.0.0:8080

IntegrityError with BooleanField and Postgresql

2010-05-27 Thread nameless
I have this simple Blog model: class Blog(models.Model): title = models.CharField(_('title'), max_length=60, blank=True, null=True) body = models.TextField(_('body')) user = models.ForeignKey(User) is_public = models.BooleanField(_('is public'), default = True) When I insert a

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Nuno Maltez
> ImportError: No module named mvc What's the "mvc" module? Python can't seem to find it. Is it in your python path? Nuno On Thu, May 27, 2010 at 4:20 PM, Chris Seberino wrote: > > I fixed the path issue that was causing the spinning but now I'm back > to getting import errors even with __init

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread backdoc
Check your apache logs. On Thu, May 27, 2010 at 10:06 AM, Chris Seberino wrote: > On May 25, 9:03 pm, Kenneth Gonsalves wrote: > > you need to add the path to the *parent* directory of your project, and > your > > project should have __init__.py in every folder where there are python > files > >

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Chris Seberino
I fixed the path issue that was causing the spinning but now I'm back to getting import errors even with __init__.py in my apache directory. Here is the exact error from Apache's error.log. ... [Thu May 27 10:18:18 2010] [error] [client 99.159.221.130] _default = translation(settings.LANGUAG

Re: Multitable inheritance - reverse relation

2010-05-27 Thread Scott Gould
Try: myB = B.objects.get(pk=1) myCs = C.objects.filter(a__b=myB) Regards Scott > I have model A in which there is field ForeignKey(B). I also have > model C which inherits from model A. None of these models is abstract. > Having B object, can I find all C objects pointing to it? When I use > som

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Chris Seberino
On May 25, 9:03 pm, Kenneth Gonsalves wrote: > you need to add the path to the *parent* directory of your project, and your > project should have __init__.py in every folder where there are python files Thanks. I added __init__.py to an apache directory I created in my project directory that inc

Re: making this app re-usable

2010-05-27 Thread Scott Gould
You're after get_model in django.db.models: model_class = get_model(*model_string.split('.')) See James Bennet's post in this topic: http://www.b-list.org/weblog/2007/nov/03/working-models/ Regards Scott On May 27, 12:13 am, Jeffrey Taggarty wrote: > Hey Guys, > > I am trying to build th

Change language when user logs into admin

2010-05-27 Thread filias
Hi, I want to change the language code to english everytime the user logs into the admin site. What is the best way to do it? Can I extend the initial admin view? Thanks in advance, -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: rendering to template help

2010-05-27 Thread Pirate Pete
hello again, i am trying to get a single entry from my db and then annotate the count and rating to it like we established above however it doesn't seem to be returning anything: videos = Video.objects.get(id=vid_id).annotate(rating_count=Count('rating'), rating_avg=Avg('rating__rating')) i even

Re: runtests.py fails with ImportError: No module named messages

2010-05-27 Thread Karen Tracey
2010/5/27 Filip Gruszczyński > I am trying to run tests on the trunk (rev 13307) and when I do, I get: > > grusz...@gruszczy-laptop:~/Programy/django/tests$ ./runtests.py > --settings test_sqlite > Traceback (most recent call last): > File "./runtests.py", line 205, in >django_tests(int(opt

Re: Django v1.2 TestCase doesn't seem to load fixtures except 'initial_data'

2010-05-27 Thread Karen Tracey
On Wed, May 26, 2010 at 4:28 PM, Bryan wrote: > I am using Django v1.2 > > The fixture I defined "forum_fixtures.json" don't seem to be loading > when I run tests. > > from django.test.client import Client > from django.test import TestCase > from utils import * > from forum.models import * > fro

Multitable inheritance - reverse relation

2010-05-27 Thread bohemian
Hello! I have model A in which there is field ForeignKey(B). I also have model C which inherits from model A. None of these models is abstract. Having B object, can I find all C objects pointing to it? When I use something like this: Bobject.C_set.all() there appears an error: 'AttributeError: B o

runtests.py fails with ImportError: No module named messages

2010-05-27 Thread Filip Gruszczyński
I am trying to run tests on the trunk (rev 13307) and when I do, I get: grusz...@gruszczy-laptop:~/Programy/django/tests$ ./runtests.py --settings test_sqlite Traceback (most recent call last): File "./runtests.py", line 205, in django_tests(int(options.verbosity), options.interactive, opti

Re: Using new messages framework within built-in admin ?

2010-05-27 Thread Nicolas Steinmetz
Nobody on this issue ? On 21 mai, 15:46, Nicolas Steinmetz wrote: > Hi, > > For some actions I made from the Django built-in admin, I would like > to improve the user experience with a better distinction between > sucess & error messages. > > With Django 1.1.x, I used to use Model admin actions [

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
On Thu, May 27, 2010 at 2:38 AM, Tom Evans wrote: > On Thu, May 27, 2010 at 10:35 AM, Daniel Roseman > wrote: > > Does this not work? > > > > note=Note.objects.get(whatever) > > weather=Weather.objects.filter( > >weather_date=note.created, > >zip_code=note.created_by__store__zip_code > >

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Tom Evans
On Thu, May 27, 2010 at 10:35 AM, Daniel Roseman wrote: > Does this not work? > > note=Note.objects.get(whatever) > weather=Weather.objects.filter( >    weather_date=note.created, >    zip_code=note.created_by__store__zip_code > ) > -- > DR. Think you need more coffee :) note=Note.objects.get(w

Re: Image deduplication and upload_to

2010-05-27 Thread Nuno Maltez
Hi, I think it's designed to do that. See the behaviour of the save/get_available_name methods on core/files/storage.py (in the django source). Maybe you can write your own storage that overrides this (never tried it, but should work). Nuno 2010/5/26 Ricardo Bánffy : > Hi folks. > > I want to pr

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Daniel Roseman
On May 27, 10:03 am, Lee Hinde wrote: > Hi; > > I have this model design: > > http://dpaste.com/hold/199818/ > > class Weather(models.Model): >     weather_date = models.DateField(auto_now_add=True,db_index=True) >     zip_code = models.CharField(max_length=20,db_index=True ) >     icon_data = mo

Re: Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
On Thu, May 27, 2010 at 2:03 AM, Lee Hinde wrote: > Hi; > > I have this model design: > > http://dpaste.com/hold/199818/ > > class Weather(models.Model): > weather_date = models.DateField(auto_now_add=True,db_index=True) > zip_code = models.CharField(max_length=20,db_index=True ) > ic

Four Hop, Two Criteria Query

2010-05-27 Thread Lee Hinde
Hi; I have this model design: http://dpaste.com/hold/199818/ class Weather(models.Model): weather_date = models.DateField(auto_now_add=True,db_index=True) zip_code = models.CharField(max_length=20,db_index=True ) icon_data = models.CharField(max_length=80) class Store(models.Model):