Make the iterable interface of an Enumeration actually useful.
Make the iterable interface of an Enumeration actually useful.

It always annoyed me how iter(Enumeration) didn't return
iter(Enumeration.get_items()), meaning that you had to do:

   for enum in MyEnum.get_items():
       # [..]

to loop over an Enumeration's items.

It used to return the upper case "slugs" which are pretty much completely
useless - the only way you can use the upper case versions is to then call
getitem (or getattr!) *back* on the Enumeration you just got them from; you
can't use them as slugs or arguments to a model's EnumField as they are
the wrong case.

With this commit you can finally do:

    for enum in MyEnum:
        # [..]

Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@playfire.com>

playfire/django-enumfield