How do I avoid circular imports?
One possibility is, of course, to move the import of Resolution into the `resolution` function. This definitely works, but it feels dirty. :(
 You can use `Proxy` for this.

http://docs.peewee-orm.com/en/latest/peewee/models.html?highlight=proxy#circular-foreign-key-dependencies

I use peewee in my webapp http://lesetagebu.ch, and it's great! Thank you. But I have a problem:

All my models lived in a models.py, but the file was several hundred lines long and hard to manage. So I refactored each model into its own file in ./models.

But now I have problems with circular imports. For example:

``` python
# models/user.py (irrelevant parts omitted)

from .rootmodel import RootModel
from .resolution import Resolution

class User(RootModel):
    username = CharField(unique=True)
    password = CharField()

    def resolution(self):
        year = arrow.now('Europe/Berlin').year

        try:
            resolution = self.resolutions.where(
                (Resolution.year == year)
            )

            if resolution.count() == 0:
                raise(DoesNotExist)
        except DoesNotExist:
            resolution = Resolution.create(
                amount=0,
                active=True,
                year=year
            )
        return sresolution
```

``` python
# models/resolution.py (irrelevant parts omitted)

from .rootmodel import RootModel
from .user import User

class Resolution(RootModel):
    amount = IntegerField()
    active = BooleanField()
    year = IntegerField()
    user = ForeignKeyField(User, related_name='resolutions')
```

This is the traceback:

```
Traceback (most recent call last):
  File "run.py", line 1, in <module>
    import lesetagebuch.main as main
  File "/Users/Daniel/dev/python/lesetagebuch/lesetagebuch/main.py", line 19, in <module>
    from lesetagebuch.models import *
  File "/Users/Daniel/dev/python/lesetagebuch/lesetagebuch/models/__init__.py", line 1, in <module>
    from .apikey import APIKey
  File "/Users/Daniel/dev/python/lesetagebuch/lesetagebuch/models/apikey.py", line 6, in <module>
    from .user import User
  File "/Users/Daniel/dev/python/lesetagebuch/lesetagebuch/models/user.py", line 14, in <module>
    from .resolution import Resolution
  File "/Users/Daniel/dev/python/lesetagebuch/lesetagebuch/models/resolution.py", line 8, in <module>
    from .user import User
ImportError: cannot import name 'User'
```

The problem is, I need the User in the resolution.py, because I need to define the Foreign Key, but I also need the Resolution in the user.py, because I need to be able to create a new Resolution instance.

In Django, there seems to be a way by using strings: http://stackoverflow.com/questions/4379042/django-circular-model-import-issue, but that doesn't work in peewee, because the first argument of ForeignKeyField needs to be a class.

Maybe the solution is quite obvious, but I can't find it. What do you recommend?
