Serialization

4 views
Skip to first unread message

diofeher

unread,
Jan 19, 2010, 9:57:36 AM1/19/10
to django-multilingual
Hello guys,
I'm trying to do a serialization of a model that contains multilingual
fields.

My models.py:

class Project(models.Model):
name = models.CharField(u'nome', max_length=200)
slug = models.SlugField(u'slug', max_length=50, unique=True)
...
class Translation(multilingual.Translation):
description = models.TextField(u'descrição')
class Meta:
db_table = 'portfolio_languages_table'

and at my views.py:

def category_ajax(request):
...
out = HttpResponse()
data = serializers.serialize('json', projects,
stream = out, use_natural_keys=True,
cls=LazyEncoder)
return out

All the fields excepting description are being serialized.
What I should do to serialize it too?

[]'s

diofeher

unread,
Feb 11, 2010, 8:58:28 AM2/11/10
to django-multilingual
Anyone?

Diógenes A. Fernandes Hermínio

unread,
Feb 11, 2010, 9:28:41 AM2/11/10
to django-multilingual
I've already get it with Django FullSerializers [1]

[]'s

http://code.google.com/p/wadofstuff/wiki/DjangoFullSerializers

--
Diógenes Augusto Fernandes Hermínio
http://diofeher.net/
Reply all
Reply to author
Forward
0 new messages