tigeorgia / shenmartav

Website for shenmartav.ge
GNU General Public License v2.0
3 stars 9 forks source link

refactor attendance record #117

Closed sebastiantransparency closed 12 years ago

sebastiantransparency commented 12 years ago

the field Representative.attendance_record contains a string like 'votes/total (percentage)'. we also have a new field Representative.attendance_group.

it's probably better to model a new entity Attendance containing the fields: votes (int) total (int) percentage (float) group (int, choices)

and Representative contains a foreign key field attendance to it.

luckily the values in these fields are autogenerated and no editor has probably made any custom changes, so the database migration should be smooth.

this also makes sorting easy.

ddohler commented 12 years ago

Yep, I agree, let's do it. Later on this might also make it easier for us to calculate attendance on a per-term basis, because we could just add references to terms to the Attendance object, no?

sebastiantransparency commented 12 years ago

yes, we could just add a foreign key to Term at any later point (probably once we have Terms, as described in #95).