crits/crits — pull request #124 by mgoffin (2014-06-26 22:26:56+00:00)
Title: Sectors

This adds the ability to track what sector(s) a top-level object applies to. The list of available sectors is based off of the DHS Critical Infrastructure Sectors list.

Some of this code might seem familiar ;) It's heavily based off of the bucket list code that already exists. For the sake of maintainable code I didn't try to de-duplicate the bucket lists and sectors code. If the two features wind up diverging further I'd rather the code be separated than try to unwind it all.

It is another field on the "Details" page for all top-level objects. It uses the tagit jquery library (which we use for bucket lists and campaign aliases). The list of available options is pre-populated to choose from and drops down on field focus. You cannot add a sector that is not in the available list through the tagit interface.

This also adds in sector count tracking similar to bucket lists as well as searching. There is a management command to add the sectors to the database as well as one to clear and update the counts if they get out of whack.