Sorry to resurrect an older thread, do let me know if I should create a new
one. I had this perfectly working as described in this thread. Then I
upgraded to Jupyter and things fell apart. The thing just doesn't have
profiles, startup folders, none of the way iPython Notebook used to set
things
Sorry, forgot to specify (but thought it's obvious). The app was configured
to use usernames.
On Saturday, March 1, 2014 10:51:32 PM UTC-8, Tim Richardson wrote:
>
> I assume you see this for a specific app.
> Is this app configured for login via usernames or via email addresses?
>
>
>
--
Res
Not sure how to report this so posting here, please let me know if there is
a separate bug tracking system.
Just upgraded an existing web2py installation to
2.8.2-stable+timestamp.2013.11.28.13.54.07 using the 'Check for upgrades'
button in Admin. Works fine so far except request_reset_password
>I still need to click login
> button right now.
Just add
@auth.login_required
on top of the controller functions you want to auto login from in the
consumers and if you are logged in at the CAS provider you will get
logged in here as well (I believe this what you are describing you
want to do now
> One login, one username for all.
> What approach should I do then?
You seem to be already on the right track:
1. Make your applications share a DB. You are already doing this
auth.define_tables(migrate=False). Debug that error you are getting or
post here the complete trace.
2. Make them share
Yes, the fact that your applications are sharing a DB connection
already means that you don't need CAS. Can you describe what you are
trying to do?
>I have my CAS working properly.
First, what do you mean by that?
CAS works out of the box. Here is how to test the scenario *I think*
you are describing:
1. From the web interface create three applications app1, app2, app3
(app1 and app2 will be consumers, app3 the CAS provider).
2. In app1 an
So on GAE this seems to be fine:
db(db.my_table.my_set.contains([1], all=False)).select()
while this:
db(db.my_table.my_set.contains([1,2], all=False)).select()
seems to always boil down to an OR somewhere deep bellow:
File "/base/data/home/apps/s~my_app/1.354557643063785927/gluon/
dal.py", lin
Appreciate it...
I have a controller/view like these:
def control():
if some_condition():
return dict(form=form)
else:
return dict(form=form, table=get_table())
{{extend 'layout.html'}}
{{=form}}
{{if table:}}{{=table}}{{pass}}
i.e. 'form' is always present in the view and 'table' sometim
This one has been torturing me for a while. Here is how to replicate
it consistently (and possibly fix it):
1. Create a brand new application (in my case named 'ttt')
2. In db.py say "auth.settings.expiration=10" (so sessions expire
quick)
3. In the default controller create a new function:
@auth
This got solved by using the fact that Field.default could be
manipulated *after* the Field has been created (following the above
line of examples):
def build_form(readonly=False):
#create fields or get from
db
field1=Field('test')
field2=db.my_table.best
#set
defaults
field1.d
> I think he wants to re-use an existing factory form, so presumably couldn't
> specify/change the default values after the form has already been created,
> right?
Correct. The code is more like:
def frm():
form=build_form(readonly=True)
return dict(form=form)
build_form is defined elsewh
I have some functionality which generates a custom SQLFORM.factory
form (reads/writes to different tables, handles uploads, etc.). All
works fine but somewhere down the flow I just wanted to display that
same form prefilled and readonly. For whatever reason I can't prefill
it and make it readonly a
Just rewrote the thing to use not nested Storages but dicts and the
problem went away. C'mon, GAE...
This one just hit me when I uploaded the app on GAE. No problems
whatsoever on the local development environment where I can pickle/
unpickle any Storage instance with Python 2.5.
The trace looks like:
Traceback (most recent call last):
File "/base/data/home/apps/s~b-stock-staging/1.354286568593
> You can do
> s.get(6,None)
Still have to anticipate what my keys are and write different code
accordingly. Which is fine in most cases I guess. Or may be I am
trying to be too generic here. Thanks for your input...
So gluon.storage.Storage is an amended dict subclass with dot notation
indexing added. With the additional twist that when a key is missing
s['missing_key'] will still raise the standard dict KeyError, while
s.missing_key will return None. All this is fine, only as long as your
keys are strings tho
Great, response.stream did it!
The exact code I end up using (in case someone else needs to get
around the 'no_table.XXX' file name scenario). Another reason I like
this approach (vs
http://mysite.com/my_app/my_cont/download/uploads/no_table.document.9b6546236b10.623456345667.png)
is the nonsensi
Have to go to the experts for this. I have a table for storing
arbitrary user data:
db.define_table('extra_attributes',
Field('user', db.auth_user),
Field('name'),
Field('type', requires = IS_IN_SET(('text','file'))),
Field('val
Or you can use full blown EAV -
http://en.wikipedia.org/wiki/Entity-attribute-value_model.
It may be overkill in many cases but is great for large sparse
matrices, depends on the details of your project...
response.view was what I was looking for (remember seeing it somewhere
but then lost it), thank you guys...
> Rather than providing links to /user/register and then redirecting to
> /register, why not just provide links directly to /register? You don't have
> to route requests to register or to vi
I am curious about the general case of how a view file can be reused
but here is my specific example. I need custom user registration and
profile pages so my controller (default.py) looks like:
def profile():
return dict(form=generate_profile_form())
def register():
return dict(form=gener
> from gluon import *
> def myfunction():
> foo = current.foo
Great, good to know... How do I apply this to current.cache though?
Sounds to me this automatically means I can't use the @cache(...)
decorator outside of a controller (Python just barfs at
@current.cache(...)). I guess I could stil
dules/***.py
>
> from gluon import *
> foo = current.foo
> # current already has session, request, response and T
>
> http://zerp.ly/rochacbruno
> Em 13/10/2011 04:38, "pepper_bg" escreveu:
>
>
>
>
>
>
>
> > Hi,
>
> > I have some helper
Hi,
I have some helper code in applications/myapp/modules/site_helpers.py.
I've been trying to cache the results of some of the functions there.
The current content is:
from gluon.shell import exec_environment
ee = exec_environment('applications/myapp/models/db.py')
cache = ee.cache
@cache('cach
26 matches
Mail list logo