Hi,
I'm having a realy weird problem. I created Django models for some
legacy data and I'm doing some tests on Windows XP with Django 0.96.1
and sqlite.
I'm parsing the data (a few big CSV text files) and generating a JSON
fixture file, which I use to initialize the database. The file is
quite big (~250 MB) and Django's error messages are not very helpful,
so it took me a few hours of head-scratching until I found out what's
wrong, but I managed to reduce it to the simple problem bellow:
1. An application "testapp"
2. A models.py file:

## -*- coding: utf-8 -*-

from django.db import models

class Test(models.Model):
        #id = models.PositiveIntegerField(primary_key=True)
        f1 = models.CharField(maxlength=65, blank=True, null=True)

3. A test.json file:

[{"pk": "203", "model": "testapp.Test",
        "fields":
        {"f1": "\u00c3"}}]

4. I delete the db file and then from the command line I run:
python manage.py syncdb testapp
python manage.py loaddata fixtures/test.json

If I leave the line with the custom primary key commented everything
is fine and I get:
Installed 1 object(s) from 1 fixture(s)

However if I use a custom primary key, i.e. uncommented the line in
models.py I get an error:
Problem installing fixture 'fixtures/test.json': 'ascii' codec can't
decode byte 0xc3 in position 0: ordinal not in range(128)

It's really strange, as I'm not changing anything else and can't see
how the type of the primary key has any connection to the database
unicode support.
Any ideas? Is it a known problem and is it SQLite only?

Best,
Plamen Dragozov

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to