"record_type" should not be in record data

Bug #674487 reported by Nicola Larosa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
desktopcouch
Fix Released
Medium
Eric Casteleijn
desktopcouch (Ubuntu)
Fix Released
Medium
Eric Casteleijn

Bug Description

On current trunk:

>>> from desktopcouch.records.record import Record
>>> rec = Record(record_type='rec_type', record_type_version='rec_type_ver')
>>> rec.record_type
'rec_type'
>>> rec.record_type_version
'rec_type_ver'
>>> rec.items()
[('record_type', 'rec_type')]

"record_type" is metadata, not data, and has no business being included in the record data: calling code has to filter it out all the time. Notice how "record_type_version", correctly, is not included in the record data.

This has been discussed, and agreed upon, with thisfred. Not trying to push it or anything, mind you. ;-)

This is probably going to break all sort of tests everywhere: not a good enough reason to leave it there, though.

Related branches

Revision history for this message
Nicola Larosa (teknico) wrote :

Also, given that "record_type" is not being included in record data anymore, the Record constructor should also not try to extract it from passed in data, as it does now:

        if record_type is None:
            if 'record_type' in data:
                record_type = data['record_type']
            else:
                raise NoRecordTypeSpecified

The record_type constructor parameter would then become mandatory.

Changed in desktopcouch:
assignee: nobody → Eric Casteleijn (thisfred)
importance: Undecided → Medium
milestone: none → 1.0
status: New → Triaged
Changed in desktopcouch:
status: Triaged → In Progress
Changed in desktopcouch:
status: In Progress → Fix Committed
Changed in desktopcouch (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Eric Casteleijn (thisfred)
milestone: none → natty-alpha-1
Changed in desktopcouch (Ubuntu):
milestone: natty-alpha-1 → natty-alpha-2
Changed in desktopcouch:
status: Fix Committed → Fix Released
Changed in desktopcouch (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.