#NEWLINE# def init( ) : #NEWLINE# #INDENT# setup ( ) #NEWLINE# manage . call ( 'uliweb makeproject --yes TestProject' ) #NEWLINE# os . chdir ( 'TestProject' ) #NEWLINE# path = os . getcwd ( ) #NEWLINE# manage . call ( 'uliweb makeapp Test' ) #NEWLINE# f = open ( 'apps/Test/models.py' , 'w' ) #NEWLINE# f . write ( "\nfrom uliweb.orm import *\n\nclass User(Model):\n    username = Field(str)\n    birth = Field(datetime.date)\n    email =Field(str)\n    \nclass Group(Model):\n    name = Field(str)\n    members = ManyToMany('user')\n    manager = Reference('user')\n    \nclass Blog(Model):\n    sid = Field(str)\n    subject = Field(str)\n" ) #NEWLINE# f . close ( ) #NEWLINE# f = open ( 'apps/settings.ini' , 'w' ) #NEWLINE# f . write ( "\n[GLOBAL]\nINSTALLED_APPS = [\n'uliweb.contrib.redis_cli', \n'uliweb.contrib.orm', \n'uliweb.contrib.objcache', \n'Test'\n]\n\n[LOG]\nlevel = 'info'\n\n[LOG.Loggers]\nuliweb.contrib.objcache = {'level':'info'}\n\n[MODELS]\nuser = 'Test.models.User'\ngroup = 'Test.models.Group'\nblog = 'Test.models.Blog'\n\n[OBJCACHE_TABLES]\nuser = 'username', 'email'\ngroup = 'name'\nblog = {'key':'sid'}\n" ) #NEWLINE# f . close ( ) #NEWLINE# manage . call ( 'uliweb syncdb' ) #NEWLINE# app = manage . make_simple_application ( project_dir = f )