"record_type" should not be in record data
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.
>>> rec = Record(
>>> rec.record_type
'rec_type'
>>> rec.record_
'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_
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
- Vincenzo Di Somma (community): Approve
- Nicola Larosa (community): Approve
-
Diff: 444 lines (+116/-69)6 files modifieddesktopcouch/contacts/tests/test_record.py (+2/-3)
desktopcouch/records/doc/an_example_application.txt (+1/-1)
desktopcouch/records/record.py (+93/-58)
desktopcouch/records/tests/test_record.py (+17/-5)
desktopcouch/records/tests/test_server.py (+2/-1)
utilities/lint.sh (+1/-1)
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 |
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:
record_ type = data['record_type']
raise NoRecordTypeSpe cified
if 'record_type' in data:
else:
The record_type constructor parameter would then become mandatory.