def meta(*args, **kwargs): if not args and kwargs: return lambda classobj: settingsobj.Settings()._register( appname, classobj, **kwargs) if len(args) != 1: raise TypeError, "register(classobj) takes one argument, %d given" % ( len(args)) return settingsobj.Settings()._register(appname, args[0], **kwargs)
def setUp(self): settingsobj.Settings._reset() self.settings = settingsobj.Settings() register = appsettings.register('test') register(Cheese) register(readonly=True)(RDOnly) register(Globals, main=True)
__FILENAME__ = admin import appsettings from django.contrib import admin from appsettings.models import Setting if appsettings.SHOW_ADMIN: admin.site.register(Setting) # vim: et sw=4 sts=4 ########NEW FILE######## __FILENAME__ = app import settingsobj settings = settingsobj.Settings() if not settingsobj.Settings.discovered: from appsettings import autodiscover autodiscover() # vim: et sw=4 sts=4 ########NEW FILE######## __FILENAME__ = fields from django.forms import widgets from django import forms from django.utils import simplejson #from django.core import validators class ListWidget(widgets.Input): input_type = 'text'