Room and Organization opt fields should be replaced with an arbitrary variable=value scheme

Bug #1169557 reported by Morten Brekkevold
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
Wishlist
John-Magne Bredal

Bug Description

The opt1-4 fields of the Room and Organization models are woefully inadequate. Users want more flexibility when adding custom data to these models.

Using the PostgreSQL hstore contrib, coupled with the django-hstore package, a dictionary-like field for custom data can be added to any model, and we won't have to codify these things into the schema itself. Yay schemaless! ;-)

Revision history for this message
John-Magne Bredal (john-m-bredal) wrote :

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.

Changed in nav:
assignee: nobody → John-Magne Bredal (john-m-bredal)
status: New → In Progress
milestone: none → 4.1.0
Revision history for this message
John-Magne Bredal (john-m-bredal) wrote :
Changed in nav:
status: In Progress → Fix Committed
summary: - Room and Organization opt fields should be replaced with a arbitrary
+ Room and Organization opt fields should be replaced with an arbitrary
variable=value scheme
Changed in nav:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers