disqus/django-bitfield — pull request #20 by anton-ryzhov (2012-08-29 16:02:50+00:00)
Title: Check limits & dict initialization

Two different, but dependent features:

#### Check limits ####
Check count of flags and raise error if BigIntegerField can't handle it correctly.

#### Dictionary initialization ####
Initialization with dictionary with integer keys. Safer in case of refactoring, flags meaning depends on constant key, not on its position.

```python
from bitfield import BitField

class MyModel(models.Model):
flags = BitField(flags={
0: 'awesome_flag',
1: 'flaggy_foo',
# 2-9 reserved for future use
11: 'wrong_place_added_key', # added on refactoring
10: 'baz_bar',
})
```