right.... models... (not modules) that was a typo on my part .... On Tue, Nov 4, 2008 at 8:38 AM, mdipierro <[EMAIL PROTECTED]> wrote:
> > yes, as Yarko suggest you cannot import models, they are not modules. > The -M option will do it for you. > > % python web2py.py -S web2mon -M > > > On Nov 4, 8:18 am, yarko <[EMAIL PROTECTED]> wrote: > > 2 things: > > > > 1 - your iPython version seems a bit old (mine shows 0.9.1 - you can > > get an update fromhttp://launchpad.net/ipython) > > 2 - to load modules, you want to do: > > > > % python web2py.py -S web2mon -M > > > > Hope that helps. > > > > Yarko > > > > On Nov 4, 7:59 am, achipa <[EMAIL PROTECTED]> wrote: > > > > > Just familiarizing myself with ipython (with web2py) and a few things > > > strike me as odd. Am I misunderstanding what's supposed to be going on > > > here or does this sort of use need more contributor love ? > > > > > python web2py.py -S web2mon > > > INFO:root:Hard cron daemon started > > > web2py Enterprise Web Framework > > > Created by Massimo Di Pierro, Copyright 2007-2008 > > > Version 1.46 (2008-10-20 13:45:48) > > > WARNING:root:no psycopg2 driver > > > WARNING:root:no cx_Oracle driver > > > WARNING:root:no MSSQL driver > > > WARNING:root:no kinterbasdb driver > > > default applications appear to be installed already > > > Python 2.5.2 (r252:60911, May 7 2008, 15:21:12) > > > Type "copyright", "credits" or "license" for more information. > > > > > IPython 0.8.1 -- An enhanced Interactive Python. > > > ? -> Introduction to IPython's features. > > > %magic -> Information about IPython's 'magic' % functions. > > > help -> Python's own help system. > > > object? -> Details about 'object'. ?object also works, ?? prints more. > > > > > In [1]: db? > > > Object `db` not found. > > > > > In [2]: SQLDB > > > SQLDB > > > > > In [2]: SQLDB? > > > Type: type > > > Base Class: <type 'type'> > > > String Form: <class 'gluon.sql.SQLDB'> > > > Namespace: Interactive > > > File: /usr/src/web2py/gluon/sql.py > > > Docstring: > > > an instance of this class represents a database connection > > > > > Example: > > > > > db=SQLDB('sqlite://test.db') > > > db.define_table('tablename',SQLField('fieldname1'), > > > SQLField('fieldname2')) > > > > > In [3]: from applications.web2mon.models import db > > > > --------------------------------------------------------------------------- > > > <type 'exceptions.NameError'> Traceback (most recent call > > > last) > > > > > /usr/src/web2py/<ipython console> in <module>() > > > > > /usr/src/web2py/applications/web2mon/models/db.py in <module>() > > > ----> 1 db=SQLDB('sqlite://storage.db') > > > > > <type 'exceptions.NameError'>: name 'SQLDB' is not defined > > > > > ... > > > In [16]: ed applications/web2mon/controllers/default.py > > > Editing... done. Executing edited code... > > > > --------------------------------------------------------------------------- > > > <type 'exceptions.NameError'> Traceback (most recent call > > > last) > > > > > /usr/src/web2py/applications/web2mon/controllers/default.py in > > > <module>() > > > 7 > > > 8 response.menu=[ > > > ----> 9 ['Dashboard',False,t2.action('dash')], > > > 10 ['SQS',False,t2.action('sqs')], > > > 11 ['EC2',False,t2.action('ec2')], > > > > > <type 'exceptions.NameError'>: name 't2' is not defined > > > WARNING: Failure executing file: <applications/web2mon/controllers/ > > > default.py> > > > > > ... etc etc > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---