Ticket #480 (closed defect: fixed)

Opened 18 months ago

Last modified 18 months ago

Django adapter ignoring non `models.fields.*` properties.

Reported by: nick Owned by: nick
Priority: major Milestone: 0.4.1
Component: Adapter Version: 0.4
Keywords: Cc:
Fixed in revision: Branch:
Author:

Description

import pyamf

class Book(object):
    def _get_number_of_odd_pages(self):
        return 52

    numberOfOddPages = property(_get_number_of_odd_pages)

pyamf.register_class(Book, 'Book')

encoded = pyamf.encode(Book()).getvalue()
print pyamf.decode(encoded).next().numberOfOddPages

works as expected but:

class Book(models.Models):
    title = models.CharField(max_length=20)
    
    def _get_number_of_odd_pages(self):
        #some code that calculates odd pages
       return odd_page_total

    numberOfOddPages = property(_get_number_of_odd_pages)

does not include the numberOfOddPages property. This is a bug in the way the Django adapter is handling non-models.fields.* properties.

Change History

comment:1 Changed 18 months ago by nick

  • Status changed from new to accepted

comment:2 Changed 18 months ago by nick

  • Keywords review added
  • Owner changed from nick to thijs
  • Status changed from accepted to assigned

comment:3 follow-up: ↓ 4 Changed 18 months ago by thijs

  • Keywords review removed
  • Owner changed from thijs to nick

This fix was confirmed to be working by Lala on the  mailinglist.

Also tested with ParseDump and EchoTest, code looks good so ready to merge.

comment:4 in reply to: ↑ 3 Changed 18 months ago by thijs

Replying to thijs:

This fix was confirmed to be working by Lala on the  mailinglist.

'Lala' should be Bryan Hughes, sorry about that ;)

comment:5 Changed 18 months ago by nick

  • Status changed from assigned to closed
  • Resolution set to fixed

Merged in r2210.

Note: See TracTickets for help on using tickets.