I suppose it was lost in the duscussions going on. I will bump it
again. :)
On May 4, 4:56 pm, Jason Brower wrote:
> I am not using any special view for the profile page...
> This is the relevent stuff in my model...
> db.define_table('users',
> SQLField('nickname', 'string', length=20),
Less that two days ago Thadeus made a request:
http://web2py.uservoice.com/forums/42577-general/suggestions/702804-block-tags-for-templates?ref=comments
for this to be supported in web2py:
http://docs.djangoproject.com/en/dev/topics/templates/#template-inheritance
Today Thadeus sent me pa
On May 4, 4:19 pm, ScOut3R wrote:
> Here it goes. First of all, I'm not a developer by profession, not
> even a web developer. You'll notice it on the design. By the way, I
> like the default style mdipierro. ;)
>
> The app is about storing personal dvds, music cds, books and keep
> track of any
can you also print
os.getcwd() and request.env.web2py_path
On May 4, 10:26 pm, Matthew wrote:
> From console:
>
> >>> db._folder
>
> 'applications/myapp/databases'>>> request.folder
>
> 'applications/myapp'
>
> Print statements from search_test.py, the unit test:
>
> applications/myapp/databas
Mind that you can call them all at once
auth.settings.login_methods.append(method1)
auth.settings.login_methods.append(method2)
auth.settings.login_methods.append(method3)
On May 4, 10:53 pm, kike wrote:
> I have wrote a diferent class to validate the credential of the user
> in LDAP because th
I have wrote a diferent class to validate the credential of the user
in LDAP because the provides by web2py don't work with the LDAP I
use, but all the user for my aplication are not in that LDAP, because
of this I use the autentication provided by web2py in auth an I need
agregate my other auten
+1
On May 4, 10:39 pm, Mariano Reingart wrote:
> I'm using Apache & mod_wsgi
>
> I'm looking at the other thread that massimo suggests changes to
> apache.conf, but after using fast_download (changing headers and using
> stream) it runs really quickly!
>
> (I know, serving through apache would be
I'm using Apache & mod_wsgi
I'm looking at the other thread that massimo suggests changes to
apache.conf, but after using fast_download (changing headers and using
stream) it runs really quickly!
(I know, serving through apache would be even faster, but in this case
I prefer portability and a eas
>From console:
>>> db._folder
'applications/myapp/databases'
>>> request.folder
'applications/myapp'
Print statements from search_test.py, the unit test:
applications/myapp/databases
applications/myapp
On May 4, 10:27 pm, mdipierro wrote:
> and what is in db._folder?
>
> On May 4, 9:27 pm, md
With apache you can do
AliasMatch ^/appname/default/customDownload/(.*)
\
/home/www-data/web2py/applications/appname/uploads/
$1
Order
Allow,Deny
Allow from
all
On May 4, 10:17 pm, Yannick wrote:
> Hehe Thanks for the note...
>
> Thanks for the clarification... The Htm
Which web server?
On May 4, 10:17 pm, Yannick wrote:
> Hehe Thanks for the note...
>
> Thanks for the clarification... The Html loading is not slow it's fine
> BUT loading the pictures are still kind of slow even when I only
> stream them... here is a code I have in my custom download method:
>
Hehe Thanks for the note...
Thanks for the clarification... The Html loading is not slow it's fine
BUT loading the pictures are still kind of slow even when I only
stream them... here is a code I have in my custom download method:
def customDownload():
response.stream(open(os.path.join(request.
What webserver are you using?
You could use the X-Sendfile header if it supports it. This way the
webserver will send cache headers and web2py does not have to serve
them.
--
Thadeus
On Tue, May 4, 2010 at 9:25 PM, mdipierro wrote:
> response.stream (which you use) handles if-modified-since
Now I know the problem and the solution
Let's go:
In db.py I put this:
Field('data_hora','datetime', default=now,
requires=[IS_DATETIME(format='%d-%m-%Y %H:%M'), IS_NOT_IN_DB(db,
'agenda.data_hora')], unique=True, label=T('Data/Hora')),
and in web2py_ajax.html I customize the default date
and what is in db._folder?
On May 4, 9:27 pm, mdipierro wrote:
> Perhpas something is causing the test script to pick up the wrong
> database. What is in request.folder from console?
>
> On May 4, 8:44 pm, Matthew wrote:
>
> > Thanks for the quick reply!
>
> > They are in the db. That's why runn
Perhpas something is causing the test script to pick up the wrong
database. What is in request.folder from console?
On May 4, 8:44 pm, Matthew wrote:
> Thanks for the quick reply!
>
> They are in the db. That's why running the code from the console works
> and why it's puzzling that the script do
response.stream (which you use) handles if-modified-since and range
requests automatically.
On May 4, 9:04 pm, Mariano Reingart wrote:
> I thought so,
>
> I had to modify mydownload so browsers do client-side caching,
> speeding up the web-page load:
>
> def fast_download():
> # very basic se
Just take the web2py binary distribution. Unzip, start it, upload your
app via admin (as "init"), stop web2py.
Copy web2py.app on the USB drive and you are done.
On May 4, 9:01 pm, Yarko Tymciurak
wrote:
> I'm trying to build a distributable version of an app for mac (and
> it's my first time tr
I thought so,
I had to modify mydownload so browsers do client-side caching,
speeding up the web-page load:
def fast_download():
# very basic security:
if not request.args(0).startswith("sponsor.logo"):
return download()
# remove/add headers that prevent/favors caching
del
I'm trying to build a distributable version of an app for mac (and
it's my first time trying to do this for a mac).
I've tried "make app" from the web2py install directory;
I've tried "python setup_app.py py2app" (which I think should work);
I am missing some step - has anyone built a web2py ma
Master Massimo,
just a detail: This form still not saved a data because this error
in submit and looking in GAE dataviewer I see that the kind/table
agenda not was created / not exist.
I think in disable the requires and insert a record and after re-
enable this requires, because IMHO this r
Thanks for the quick reply!
They are in the db. That's why running the code from the console works
and why it's puzzling that the script doesn't since the same
environment is set up.
On May 4, 9:28 pm, mdipierro wrote:
> I do not think that line is the problem. Are the records in the db
> alrea
show -> slow.
Note to self: do not type in the dark.
On May 4, 8:16 pm, Massimo Di Pierro wrote:
> You need to understand why it is show. It is show to load the age or
> to load the pictures (because there are lots of the m in the page)?
> caching the select only affect the time to download
I do not think that line is the problem. Are the records in the db
already or are they stored by the unit_test?
On May 4, 8:12 pm, Matthew wrote:
> I'm attempting to unit test a method by
> followinghttp://web2py.com/AlterEgo/default/show/260. If I run the query
> inside
> the console, it works
Can you explain more?
On May 4, 8:11 pm, kike wrote:
> I have defined a method to logins in a logins.py, file external to
> web2py, and I want agregate to login_methods, for example if my metod
> names MyMethod and is in a file called logins.py how I agregated to
> auth.settings.login_methods.ap
you have corrputed data in the db. You stored something in a field
that was a "string" and now is a "date". web2py cannot get the record
out because it is not what it should be.
On May 4, 7:11 pm, Leandro - ProfessionalIT
wrote:
> Hi Friends,
>
> I'm developing a 'calendar' (agenda in portugu
caching downloads does not make sense. This is because the role of
download is to check permissions to download a file (if they are set).
if you cache it then you do not check. If you do not need to check do
not use download. Use
def mydownload():
return
response.stream(open(os.path.join(requ
You need to understand why it is show. It is show to load the age or
to load the pictures (because there are lots of the m in the page)?
caching the select only affect the time to download the html page but
does not affect the pictures since you are caching the list of
function names not no
I'm attempting to unit test a method by following
http://web2py.com/AlterEgo/default/show/260. If I run the query inside
the console, it works fine. If I run it in my unit tests, it returns
no results (NOTE that there are no errors in the unit test).
Here is the query:
rows = db(db.flavor.id>
I have defined a method to logins in a logins.py, file external to
web2py, and I want agregate to login_methods, for example if my metod
names MyMethod and is in a file called logins.py how I agregated to
auth.settings.login_methods.append(MyMethod).
Thank for your help
Thank you. That is exactly what i needed!
On May 4, 3:15 pm, mdipierro wrote:
> def set_company_name(form):
> # use form.vars.id
>
> On May 4, 4:26 pm, Sheldon <8cylin...@gmail.com> wrote:
>
> > I have an app that has users for multiple companies registering
> > and then are later approv
Hi Friends,
I'm developing a 'calendar' (agenda in portuguese) app and this app
is deployed in GAE.
My db.py
# the data_hora field have a brazilian format and I cannot have two
records in the same data/time (only a event in a date/time)
db.define_table('agenda',
Field('data_hora','datetime
Seems translated texts cannot be used as keys for dictionaries or
values to be iterated for lists/tuples:
SPONSOR_LEVELS=(T("Organizer"),T("Sponsor"))
...
random.shuffle(response.sponsors[SPONSOR_LEVELS[1]])
Traceback (most recent call last):
File "gluon/restricted.py", line 178, in restricted
Hello mate,
I used a lot of pictures in my application. Currently what I'm doing
is I cache the DAL Select like this:
"db().select(db.photo.fileupload, db.photo.id, cache=(cache.ram,
3600))"
And when the users upload new pictures, in the "onaccept" function I
clear the cache like this:
- ca
To cache images, I'm trying to do:
@cache(request.env.path_info,60,cache.ram)
def download(): return response.download(request,db)
But seems that is not working:
http://www.web2py.com.ar/raf10dev/default/index
(see images at sidebar, if you quickly reload pages, they fail)
The book says somethin
Hi Massimo,
the issue is that delete can't work directly on the
google.appengine.ext.db.Query object. In the delete function, items is
an instance of that Query object, and has to be transformed into a
list of google.appengine.ext.db.Models - which is what the fetch
function does.
In fact, it does
ok, keep us posted.
On May 4, 11:51 am, Avik Basu wrote:
> It seems to work fine from the interactive shell. And after I ran
> that command from the interactive shell, I think that I no longer have
> the "invalid function" when calling the action. So, perhaps it was a
> problem with items that
I do not understand. What is sendgrid? How is different from any other
smpt server?
On May 4, 12:48 pm, Oscar wrote:
> Does Web2Py have sendgrid.com API support? it uses an smtp mail server
> and API for create emails under their rules. You can see the API for
> python athttp://cl.ly/r29and examp
I had lots of problems with slickgrid and use jqgrid instead.
Slickgrid is sleek but the documentation is lacking and contains code
like this
var BoolCellFormatter = function(row, cell, value, columnDef,
dataContext) {
return value ? "" : "";
};
Which seams to assume a folder structure like
s
def set_company_name(form):
# use form.vars.id
On May 4, 4:26 pm, Sheldon <8cylin...@gmail.com> wrote:
> I have an app that has users for multiple companies registering
> and then are later approved by an administrator for that
> particular company. The problem is that I need to insert a
on a second thought. This could conflict with close_all_instances and
needs some more thought.
On May 4, 5:13 pm, mdipierro wrote:
> we should and it should call
>
> self._connection.close()
>
> On May 4, 5:00 pm, Thadeus Burgess wrote:
>
> > We do not have a db.close().
>
> > However I figured
we should and it should call
self._connection.close()
On May 4, 5:00 pm, Thadeus Burgess wrote:
> We do not have a db.close().
>
> However I figured the problem. In most other db systems (sqlalchemy,
> django, etc) use the ``sqlite://:memory:`` syntax, whereas web2py dal
> uses ``sqlite:memory:`
Thank you for reporting this. Please check my fix in trunk.
Massimo
On May 4, 4:16 pm, Christophe Plat wrote:
> This issue on web2py is related to GAE issue 3119 (http://
> code.google.com/p/googleappengine/issues/detail?id=3119).
> I'm using web2py 1.77.3.
>
> In gql.py, line 702 to 709:
>
> de
We do not have a db.close().
However I figured the problem. In most other db systems (sqlalchemy,
django, etc) use the ``sqlite://:memory:`` syntax, whereas web2py dal
uses ``sqlite:memory:``.
However, db.close() would be helpful for external scripts like cron ?
--
Thadeus
On Tue, May 4, 2
db.close() ?
On May 4, 4:22 pm, Thadeus Burgess wrote:
> More info:
>
> I have an "sqlite://:memory:" dal connection. I am reusing this memory
> database for unit testing.
>
> I need to completely remove the database on my def tearDown() function.
>
> Something like
>
> db._cursor.close()
>
> How
I have an app that has users for multiple companies registering
and then are later approved by an administrator for that
particular company. The problem is that I need to insert a value
into the users record (in this case a company name) so that the admin
for that company can then approve that use
More info:
I have an "sqlite://:memory:" dal connection. I am reusing this memory
database for unit testing.
I need to completely remove the database on my def tearDown() function.
Something like
db._cursor.close()
However the database still seems to be in memory when I load it up again.
--
T
Not 100% sure of your problembut do you output session.flash,
response.flash, and register.errors anywhere in your view? what you
describe sounds like a validation problem, but if you don't output the
register.errors you don't see the what the problem is. (at least i
had this difficulty when
Here it goes. First of all, I'm not a developer by profession, not
even a web developer. You'll notice it on the design. By the way, I
like the default style mdipierro. ;)
The app is about storing personal dvds, music cds, books and keep
track of any lent items and a wishlist. That's pretty basic,
Annet,
have you tried:
# defines all needed tables without migration/table files
auth.define_tables(migrate=False)
where you configure auth for your app?
cfh
On May 4, 9:44 am, annet wrote:
> I have one application (called base) in which I define all the tables
> for th
This issue on web2py is related to GAE issue 3119 (http://
code.google.com/p/googleappengine/issues/detail?id=3119).
I'm using web2py 1.77.3.
In gql.py, line 702 to 709:
def delete(self):
self._db['_lastsql'] = 'DELETE WHERE %s' % self.where
(items, tablename, fields) = self._sele
I have a DAL instance that I want to tear down so the database becomes unlocked.
How can I accomplish this?
--
Thadeus
Please, do tell!
--
Thadeus
On Tue, May 4, 2010 at 3:20 PM, mdipierro wrote:
> We look forward to hear verything. ;-)
>
> On May 4, 1:07 pm, ScOut3R wrote:
>> Hey There!
>>
>> My first web2py application started as a learning course and the
>> application was designed for personal use but I
thank you!
On May 4, 9:13 am, mdipierro wrote:
> In trunk!
>
> On May 4, 10:56 am, howesc wrote:
>
> > Hello,
>
> > it seems that the "if LOGGING:" block of fcgihandler.py is out of
> > date. can we update it to:
>
> > if LOGGING:
> > application = gluon.main.appfactory(wsgiapp=gluon.main.w
That pointer is my fault. Mariano just reproduced the original slide
design. My original idea was to point request, response, and session
to the index() example but, since reponse did not fit, I just pointed
the arrow up.
On May 4, 2:52 pm, Jonathan Lundell wrote:
> On May 4, 2010, at 12:47 PM, M
We look forward to hear verything. ;-)
On May 4, 1:07 pm, ScOut3R wrote:
> Hey There!
>
> My first web2py application started as a learning course and the
> application was designed for personal use but I thought that maybe the
> public would be interested in it. Is this the right place to
> "adv
On May 4, 1:07 pm, ScOut3R wrote:
> Hey There!
>
> My first web2py application started as a learning course and the
> application was designed for personal use but I thought that maybe the
> public would be interested in it. Is this the right place to
> "advertise" a web2py based app which might
I am trying to integrate a javascript library (slickgrid) and can't
seem to figure out where to place the images folder referred to by
components of the library.
in my view .html file:
in slick.editors.js there are referances like:
'../images/calendar.gif'
and
Hey There!
My first web2py application started as a learning course and the
application was designed for personal use but I thought that maybe the
public would be interested in it. Is this the right place to
"advertise" a web2py based app which might interest the community?
If yes, then I'll writ
On May 4, 2010, at 12:47 PM, Mariano Reingart wrote:
> On Tue, May 4, 2010 at 3:49 PM, Jonathan Lundell wrote:
>>
>> What does it mean that response has a pointer to request?
>>
>
> Maybe because that is more clear than a pointer to db.py, default.py
> and/or index.html
What I'm asking, thoug
On Tue, May 4, 2010 at 3:49 PM, Jonathan Lundell wrote:
>
> What does it mean that response has a pointer to request?
>
Maybe because that is more clear than a pointer to db.py, default.py
and/or index.html
Best regards,
Mariano Reingart
http://www.web2py.com.ar
http://www.sistemasagiles.com.ar
On May 4, 2010, at 11:01 AM, Mariano Reingart wrote:
> Fixed.
>
> I've also
> * added: db(query).update(field=val)
> * added: @cache('key', 3600, cache.ram) -removed ('domain') from amfrpc-
> * modified: T('message') => ‘translation’
> * added: “ajax(url,[id1,id2,...],target)”
>
> Mariano Reing
On May 4, 9:22 am, mdipierro wrote:
> Try replace
>
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
> auth.settings.login_methods.append(ldap_auth(
> mode='ad', server='dc01',
> base_dn='ou=Users,dc=domain,dc=com'))
>
> with
>
> from gluon.contrib.logi
Had this from a while ago. Not sure if this is what you are looking
for.
http://rapidshare.com/files/383518290/web2py_cheatsheet.pdf.html
On May 4, 10:33 am, mdipierro wrote:
> Almost perfect. You lost a 'r' in r-espose and there is ] that takes
> unnecessarily an entire line. I will replace mi
Ah, perhaps :)
You can always stick it in a w2p.css.
If you need to upgrade the w2p.css (which does not happen that often)
it will be placed in the welcome app if you update from the
repository.
For appadmin, I usually have to copy new versions over manually.
--
Thadeus
On Tue, May 4, 2010
Fixed.
I've also
* added: db(query).update(field=val)
* added: @cache('key', 3600, cache.ram) -removed ('domain') from amfrpc-
* modified: T('message') => ‘translation’
* added: “ajax(url,[id1,id2,...],target)”
Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com
On
perhaps it's time I dropped the css I've adopted from web2py! :)
On May 4, 6:04 pm, Thadeus Burgess wrote:
> I do not understand. I do not have any web2py css files.
>
> --
> Thadeus
>
>
>
> On Tue, May 4, 2010 at 11:58 AM, Carl wrote:
> > thanks for responding.
>
> > how do you deal with Web2py
Does Web2Py have sendgrid.com API support? it uses an smtp mail server
and API for create emails under their rules. You can see the API for
python at http://cl.ly/r29 and example at http://cl.ly/o1B.
Regards,
Oscar.
Almost perfect. You lost a 'r' in r-espose and there is ] that takes
unnecessarily an entire line. I will replace mine with yours.
On May 4, 11:56 am, Mariano Reingart wrote:
> Like this?
>
> Mariano Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.com
>
> On Tue, May 4, 2010 at
I am wondering if there is a way to debut web2py apps. I would like to
see what functions are being called and what data is being passed to
them.
I am trying to get auth to work with form.custom.widget, but everytime
I submit, the widget doesn't insert the record into the database, it
simply refre
I do not understand. I do not have any web2py css files.
--
Thadeus
On Tue, May 4, 2010 at 11:58 AM, Carl wrote:
> thanks for responding.
>
> how do you deal with Web2py upgrades: an upgrade that modifies its
> css. Have you split from Web2py's css files, do you handle them
> outside of Clev
thanks for responding.
how do you deal with Web2py upgrades: an upgrade that modifies its
css. Have you split from Web2py's css files, do you handle them
outside of CleverCSS or a third way?
On May 4, 5:27 pm, Thadeus Burgess wrote:
> I use clevercss for large projects, which is similar to SAS
Like this?
Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com
On Tue, May 4, 2010 at 1:28 PM, mdipierro wrote:
> Excellent! A few suggestions to keep up with recent changes:
>
> SQLDB(...,pools=...) should be DAL(...,pool_size=...)
>
> add response.files.append('htt
It seems to work fine from the interactive shell. And after I ran
that command from the interactive shell, I think that I no longer have
the "invalid function" when calling the action. So, perhaps it was a
problem with items that were accumulating in the cache. I'll report
back if it breaks agai
I have one application (called base) in which I define all the tables
for three other applications. In the three applications I use the same
db.py file. In these db.py files I set migrate=False on all tables.
One of these applications is a CMS, in which I enabled Authorization
and Authentication.
Excellent! A few suggestions to keep up with recent changes:
SQLDB(...,pools=...) should be DAL(...,pool_size=...)
add response.files.append('http://somewhere/file.css')
replace
response.author, response.description and response.keywords
with
response.meta.author, response.meta.description
I use clevercss for large projects, which is similar to SASS.
However, for dynamic css I use it as a template. And for small apps I
just write css straight up in the static folder.
--
Thadeus
On Tue, May 4, 2010 at 9:12 AM, Carl wrote:
> hi,
>
> Is anyone using SASS to manage their CSS defi
db(db.user.id==1).update( **dict(first_name='Jack', title='CEO' ) )
or
db.user[1] = dict(first_name='Jack', title='CEO')
On May 4, 10:56 am, PanosJee wrote:
> Hello everyone I hope you are doing fine.
>
> I want to update a record but I do not know in advance the fields i
> want to update. I
In trunk!
On May 4, 10:56 am, howesc wrote:
> Hello,
>
> it seems that the "if LOGGING:" block of fcgihandler.py is out of
> date. can we update it to:
>
> if LOGGING:
> application = gluon.main.appfactory(wsgiapp=gluon.main.wsgibase,
> logfilename='httpserver.log',
>
db.user[5].update_record(last_name='Vlachoyannis',
title='CTO', salary=180)
Ok, remade.
This one is B/W only and fits in half legal, to be easily printable
What do you think?
Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com
On Mon, May 3, 2010 at 4:20 PM, mdipierro wrote:
> The source (which I cannot find) was a Comic Life file. Unless y
Hello everyone I hope you are doing fine.
I want to update a record but I do not know in advance the fields i
want to update. I would like to create a dict with the fields and do
the following.
db(db.user.id==1).update( dict(first_name='Jack', title='CEO' ) )
db(db.user.id==2).update( dict(last_n
Hello,
it seems that the "if LOGGING:" block of fcgihandler.py is out of
date. can we update it to:
if LOGGING:
application = gluon.main.appfactory(wsgiapp=gluon.main.wsgibase,
logfilename='httpserver.log',
profilerfilename=None)
i'd also like to figure out the
On May 4, 2010, at 4:26 AM, canna wrote:
> Thank you for the answer
> so how would you share functions between controllers easily? without
> passing global objects to the functions all the time?
> is the only way is to bundle it all in one class that will be
> initialized with the 'db' variable?
>
Try replace
from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods.append(ldap_auth(
mode='ad', server='dc01',
base_dn='ou=Users,dc=domain,dc=com'))
with
from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.sett
hi,
Is anyone using SASS to manage their CSS definitions?
http://sass-lang.com/
And if so, how have you managed web2py's css files?
thanks
I tried
--
from gluon.tools import *
auth=Auth(globals(),db) # authentication/authorization
from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods.append(ldap_auth(
mode='ad',
I tried testing to see if using {{=form}} and just using the venilla
form produced by auth would work. It seems that auth is just not
inserting new users into the db no matter what I do...whether I just
use {{=form}} or I customize my own... How do I check where auth is
getting stuck?
On May 4,
I am not using any special view for the profile page...
This is the relevent stuff in my model...
db.define_table('users',
SQLField('nickname', 'string', length=20),
SQLField('first_name', 'string', length=15),
SQLField('last_name', 'string', length=15),
SQLField('ph
Can someone point me to some examples of usage of form.custom.widget
for auth? I am looking for example code.
On May 3, 5:59 pm, waTR wrote:
> Solved previous problem. However, the form won't actually insert into
> the database...am I missing something?
>
> On May 3, 5:36 pm, waTR wrote:
>
>
It is your choice. In any language when you use functions in modules
you have to pass variables to them.
I like the idea of instantiating a class. That is how Auth, Crud and
Service work too.
On May 4, 6:26 am, canna wrote:
> Thank you for the answer
> so how would you share functions between con
> I tried rebooting the server but after some time it starts to consume
> a lot of memory again. There's only one user for now
do you have some kind of automated actions(like xml-rpc calls, js
scripts using json-rpc) and you forgot to disable sessions for this
actions with session.forget?
Thank you for the answer
so how would you share functions between controllers easily? without
passing global objects to the functions all the time?
is the only way is to bundle it all in one class that will be
initialized with the 'db' variable?
or there is other way?
On May 4, 1:49 pm, mdipier
I tried to store and reload the session the following way
in db.py i added
import pickle
#--
def session_load(form = None):
global session
auth_session = db(db.auth_session.user ==
auth.user.id).select().first()
session = pickle.loads(auth_session.session)
def se
A module is a module. You can import stuff form the module but the
module will not see variables defined in the calling environment.
In the module you can defined a function that takes db as parameter,
import the funciton and call it with the db instance. You will have
the problem not just for db,
hi all,
I want to share a bunch of functions between controllers, so I moved
them to a module called 'utilities' in the modules folder, and in the
controller I import the module as suggested here in the forum:
import applications.myapp.modules.utilities as util
reload(util)
the problem is, it's n
96 matches
Mail list logo