# major, minor, patch
VERSION = (0, 1, 1)


def get_version():
    version = '%s.%s' % (VERSION[0], VERSION[1])
    if VERSION[2]:
        version = '%s.%s' % (version, VERSION[2])
    return version


from .models import *


def get_option(name, default=None, store=True):
    qs = Option.objects.filter(name=name)
    if not qs.exists():
        if store:
            set_option(name, default)
        return default
    elif qs.count() == 1:
        return qs.get().get_value()
    else:
        data = []
        for opt in qs:
            val = opt.get_value()
            if val is not None:
                data.append(val)
        return data


def set_option(name, value=None):
    if isinstance(value, list):
        if len(value) == 0:
            set_option(name, None)
            set_option(name, None)
        else:
            for val in value:
                set_option(name, val)
    else:
        opt = Option.objects.create(name=name)
        opt.set_value(value)

@@ -199,32 +199,8 @@
 n%0A%0A%0A
-from .models import *%0A%0A%0A
 def 
@@ -239,24 +239,55 @@
 tore=True):%0A
+    from .models import Option%0A
     qs = Opt
@@ -901,32 +901,67 @@
  val)%0A    else:%0A
+        from .models import Option%0A
         opt = Op

fix imports on setup