Comment 1 for bug 1169557

Revision history for this message
John-Magne Bredal (john-m-bredal) wrote : Re: Room and Organization opt fields should be replaced with a arbitrary variable=value scheme

hstore extension added to postgres. django-hstore used for easy crud in models.

SeedDB modified to implement hstore field for storing key value pairs. Custom implementation of SeedDB interface is based on django-hstores implementation of it in django admin - the field itself is a textarea with a dictionary as content. GUI is created with javascript, and consists of form elements for manipulation of the dictionary. On edit or create the modified dictionary is stored as is.

Bulk import adapted to new field. As is dump.py.

Report and Room info modified to use the new field type. Output in report is ugly, and should be prettified in some way (maybe some sql-magic can help?).

Problems:
- creating the hstore extension in an existing database and adding django-hstore leads to possible problems with type converting. A fix for this is created in django-hstore, but not yet released. This has to be considered before releasing this code. The error will manifest itself in not being able to edit or add new rooms and organizations, which is considered critical.
- the fix consists of setting a variable in settings.py that manifests itself in django-hstore trying to register the hstore extension on every database connection. This will lead to a slight performance degradation.
- the "best" fix is to enable the hstore extension in template1 and recreate the database. This is considered impractical.