Hi!

I am trying to implement something like a jubber web application, using
django and flex

The server code should send a list of users who's online. Here's how I
defined a model

class ActiveList(models.Model):

    STATUS_CHOISES = (
        (u'F', u'free'),
        (u'B', u'busy'),
        )
    user = models.ForeignKey(User, unique=True)
    status = models.CharField(max_length=2, choices = STATUS_CHOISES)


The view look like this

def getActiveUsers(request):
    activeList = ActiveList.objects.all()

    data = serializers.serialize("json", activeList, fields = (u'user',
'status'))
    return HttpResponse(data, mimetype='application/json')


The question, how can I return username of user in fields. I want the JSON
response to contain value user.username instead of id of user oject

Thanks,
Oleg

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to