Changes between Initial Version and Version 1 of Ticket #16127


Ignore:
Timestamp:
05/30/2011 11:25:12 AM (4 years ago)
Author:
ramiro
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16127

    • Property Patch needs improvement unset
    • Property Component changed from Database layer (models, ORM) to Core (Serialization)
    • Property Needs tests unset
    • Property Needs documentation unset
    • Property Triage Stage changed from Unreviewed to Accepted
  • Ticket #16127 – Description

    initial v1  
    33
    44models.py
    5 
     5{{{
    66class Pessoa(models.Model):
    77    nome = models.CharField(max_length=50)
     
    2020    def __unicode__(self):
    2121            return "%s, %s" % (self.nome, self.cpf)
     22}}}
    2223
    2324views.py:
    24 
     25{{{
    2526def load_proprietarios(request):
    2627    data = serializers.serialize('json',Proprietario.objects.defer('cpf','telefone','celular','data_nascimento','data_inclusao',),ensure_ascii=False))
    2728    return HttpResponse(data, mimetype="application/javascript")
     29}}}
    2830
    2931This is the output:
    30 
     32{{{
    3133[{"pk": 1, "model": "proprietario.proprietario_deferred_celular_cpf_telefone_data_inclusao_data_nascimento", "fields": {}}]
     34}}}
    3235
    3336Note that the "id" and the "nome" fields (class Proprietario / class abstract Pessoa) does not appear after defer() method.
Back to Top