Bumped version to 0.0.5

Fixed problem where fields contained shared values by
performing a shallow copy on all fields during Record instantiation.
That way, each record has its own copy of the field instances, rather
than the shared class-wide instance provided by the definition.
This commit is contained in:
Binh 2011-10-29 14:03:03 -05:00
parent 4023d46b4a
commit 7cb8bed61e
4 changed files with 28 additions and 23 deletions

View file

@ -1,6 +1,6 @@
from record import *
VERSION = (0, 0, 3)
VERSION = (0, 0, 5)
RECORD_TYPES = [
'SubmitterRecord',
@ -146,3 +146,16 @@ def verify_records(records):
verify_required_records(records)
verify_record_order(records)
def test_unique_fields():
r1 = EmployeeWageRecord()
r1.employee_first_name.value = "John Johnson"
r2 = EmployeeWageRecord()
print 'r1:', r1.employee_first_name.value, r1.employee_first_name, r1.employee_first_name.creation_counter
print 'r2:', r2.employee_first_name.value, r2.employee_first_name, r2.employee_first_name.creation_counter
if r1.employee_first_name.value == r2.employee_first_name.value:
raise ValidationError("Horrible problem involving shared values across records")