amitu/importd — pull request #10 by alendit (2013-02-25 17:52:36+00:00)
Title: Implements basic models support.

As you said, not having models pretty much defeats the purpose of a single-file framework, so I hacked together a basic implementation.

Basically, I hijack the metaclass-magic, django uses to load models and mock application and models modules.

Some design decisions:

* both application models and django.db.models are accessible through d.models. May be somewhat confusing, but I found it quite intuitive
* Models access is case-insensitive (like in django get_model)

I updated foo.py, go to /edit/ and enter 2 values, which are saved in the DB on post. /index/ will then list values of every saved object.

There is convertion support, the example app doesn't work after convertion, unfortunately. There is some fhurl-magic in lines 250-252, I wasn't sure how to handle properly. I'll open a separate issue for it.