akngs/ecogwiki — pull request #16 by jangxyz (2013-12-22 14:13:33+00:00)
Title: Refactor models into packages

For code clearance, I tried splitting the `models.py` module into a package.

Every class is in a separate file, so no more 1,500 lines of python! Also note that constants and functions like `md` and `is_admin_user()` is extracted into a separate file named `utils.py`.

The previous code does not need to change anything, because `models/__init__.py` includes any other classes to itself. Hence the following code will remain the same meaning:

```python
from models import WikiPage
```

However there still is a dependency problem remaining when calling ACL check methods, because the logic relies on the `.config` WikiPage. I tried localizing the call, but currently it's not much elegant. Feel free to improve the code.