Re: Django And os.path Behavior

2008-12-05 Thread dayvo
Solved. I had to surround my folderpath field with smart_str according to http://docs.djangobrasil.org/ref/unicode.html#ref-unicode The only change needed in the example was on the last line: [EMAIL PROTECTED]:/home/published/www/django/catalog/music# cat demo.py import os import music.models

Re: Django And os.path Behavior

2008-12-05 Thread dayvo
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.contrib.auth.models import User import datetime class TagItem(models.Model): foreignID = models.IntegerField() description =

Re: Django And os.path Behavior

2008-12-05 Thread dayvo
Good question. That could affect the app if I were using relative path's or relying on the environment to locate files. The path's I'm using in the app are stored are absolute paths. They work correctly for path's that don't have unicode characters in them. My Django app works correctly with

Re: Django And os.path Behavior

2008-12-05 Thread dayvo
Thanks for the response Andy. The code does work fine in the interpreter. It's when the code is called from a web page where it throws an error. I know it has something to do with unicode but I can't understand why os.stat is behaving differently. To test from a view:

Django And os.path Behavior

2008-12-05 Thread dayvo
os.path.exists behaves differently if called from a django app. Why? Can I work around this? I need to check if pathnames exist where the path may have special/unicode characters. I also need to open files from that path. The path in this demo contains "El CamarĂ³n de la Isla", where the

Re: Error when querying with unicode data

2008-12-05 Thread dayvo
Please ignore. I've resolved this. --~--~-~--~~~---~--~~ 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

Error when querying with unicode data

2008-12-05 Thread dayvo
I have the following code: otherAlbums = models.Album.objects.filter (song_album__artist__name=artist).distinct().order_by('releasedate') when artist contains a unicode value, such as 'El CamarĂ³n de la Isla', then I receive the following: Exception Type:

Re: Hardy Upgrade And PythonPath

2008-04-30 Thread dayvo
Thank you! That solves my problem I was afraid they decided to rip out generic relationships. I know some people don't like using a model like that but the truth is that it's been used in practice for a long time. There are advantages to it in some situations. I'll take your advice and use

Re: Hardy Upgrade And PythonPath

2008-04-30 Thread dayvo
Thank you for the advice on this problem. I haven't touched Django since I finished this project. It's been about 4 months. Having had some more time to explore the issue, I believe the problem lies here: from django.contrib.contenttypes import generic In my models.py, I'm using generic

Hardy Upgrade And PythonPath

2008-04-29 Thread dayvo
I could use some help getting my Django website back up after an upgrade to Hardy Heron. Instead of using svn to get Django, I used synaptic this time. Now my site doesn't work and I'm a bit confused on path names. I believe Hardy installed Django to /var/lib/python-support/python2.5/ django