This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from sqlalchemy import Column, Integer | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import Session | |
from sqlalchemy.ext.hybrid import hybrid_property | |
Base = declarative_base() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
def oneline_print(message): | |
sys.stdout.write('\r%s' % message) | |
sys.stdout.flush() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from django.test import TestCase | |
from django.core.urlresolvers import reverse | |
from django.test.client import RequestFactory | |
class RequestTest(TestCase): | |
def setUp(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
class DottedDict(object): | |
pass | |
def dotted_dict(src_dict): | |
assert isinstance(src_dict, dict) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
class DotChainedAttrs(object): | |
def __getattr__(self, name): | |
__dict__ = object.__getattribute__(self, '__dict__') | |
if name not in __dict__: | |
__dict__[name] = DotChainedAttrs() | |
return __dict__[name] |
NewerOlder