How to share authentication across applications?
I get
table = self.createform(xfields)
File "applications/init/modules/plugin_solidform.py", line 96, in createform
n = len(self.flat_fields)
KeyError: 'article_eq'
when I use the following code:
fields = ['id',
'title',
'primaryauthor',
'author
Ok, after reading up on user_signature, I don't really like to turn it off.
If I do turn it off, I'd like at least something that will allow the same
for anonymous users.
Is there anyway I can generate a user_signature for some anonymous user?
Thanks,
Tsvi
Dear All,
i am trying to use mod_wsgi with apache on fedora i installed web2py
in var/www/ and i unzipped it , and i edited the httpd.conf and added
the virtual host script but it keeps giving me this error with i do "$
service httpd start "
the error is :
bad user name : root@linux
what to d
I'm adding extra fields to auth_user as,
auth.settings.extra_fields['auth_user']= [
Field('user_type', requires=IS_IN_SET('Admin', 'Staff'))]
But, in the Register form I'm getting a listbox with single letter options
like, a, d, m, i, n.
Is there something missing?
You might pass a sequence or dictionary instead of single arguments:
IS_IN_SET([A, B, C])
or
IS_IN_SET({"a": a, "b": b, ...})
Seems that IS_IN_SET is reading the input as a list of characters
On 15 dic, 08:29, "Chandrakant Kumar" wrote:
> I'm adding extra fields to auth_user as,
> aut
I was looking in the book for an option to change the default path of
a web2py application folder, so when using appadmin to modify it or
requesting actions from a browser makes web2py use another folder than
the original /.../applications/app path.
I found the "Execution environment" section but
passing a dictionary worked fine.
On Thu, 15 Dec 2011 17:36:29 +0530, Alan Etkin wrote:
You might pass a sequence or dictionary instead of single arguments:
IS_IN_SET([A, B, C])
or
IS_IN_SET({"a": a, "b": b, ...})
Seems that IS_IN_SET is reading the input as a list of characters
On 15 dic
In another thread, Anthony mentioned that it is possible to share
objects between apps if i recall correctly (i think using import). So
i suppose you could replace an auth object with other from another
application to share it.
In the book there is an authentication example wich uses one app for
c
Yes it has. The sample code runs on 1.99.2.
Updated for 1.99.4 it shows the same behavior. Grid displays no
information from the dogs table.
On Dec 15, 12:12 am, Jim Steil wrote:
> Yes
>
> On 12/14/2011 10:25 PM, Nik Go wrote:
>
>
>
>
>
>
>
>
>
> > columns support has been dropped, right?
>
>
Bump
> (db.mytable.id == 3).select()
It appears as a one length tuple that has a select() method.
Wouldn't such changes bring compatibility issues with former formats?
Sorry, that is more likely to be a bool object with a select() method.
Since a single comparison is supposed to return such object and not a
sequence
On 15 dic, 10:14, Alan Etkin wrote:
> > (db.mytable.id == 3).select()
>
> It appears as a one length tuple that has a select() method.
>
> Wouldn't
import string
import random
mykey = ''.join(
random.choice(string.ascii_lowercase+string.digits)\
for x in range(32)
)
session.auth.hmac_key = mykey
Read up on hmac_key in the online book. Unfo
http://web2py.com/book/default/chapter/04#Cooperation
I have cooperating applications which share several tables. It's a
royal pain keeping them from stepping on each other when I upgrade the
models because of the migrate issue described in the book.
In retrospect perhaps I should have gone for
You can differentiate based on the request, like this:
if len(request.args) > 2 and request.args[-3] == 'edit':
fields = [] # what you want to show for editing
else:
fields = [] # what you want to show on the initial grid
form=SQLFORM.grid(blah, ... fields=fields ...)
This is handy for lots
>
> A Query is not, as some web2py docs claim, just a WHERE clause. It
> superficially resembles a WHERE clause, but it also implicitly encodes
> the joining of tables.
>
Though I believe it joins tables by using the WHERE clause (as opposed to
JOIN, which is used when you pass the "join" or "lef
probably problem with mod_wsgi
any solutions?
andrej
After the user registers, you should probably redirect him to a login
page that politely says something like:
Thank you for registering. Log in now to get access to the all the
features of our fantastic site.
On Dec 14, 11:37 pm, Anthony wrote:
> On Wednesday, December 14, 2011 11:24:20 PM UT
Thank you Johann, you got me thinking!
So if I have a bunch of records and some are existing in the tables
already, I would have to go through each of them to perform a
update_or_insert. Am I wrong to say that this method is resource
intensive? Is there a way to ease the db load?
(And I understan
Hello folks,
I'm trying to use Scheduler but as soon as I start web2py with -K option
I'm receiving:
exec ccode in environment
File "applications/gt2/models/db.py", line 331, in
myscheduler = Scheduler(db,dict(teste=teste))
NameError: name 'Scheduler' is not defined
Do I need to import
I would be happy to participate in a survey like this.
On Dec 15, 12:42 pm, Vineet wrote:
> Good idea. On stackoverflow.com, one can accept an answer & rate
> comments. But on google groups, AFAIK, there isn't any such
> provision.
> We, the web2py community, may develop a web2py app for taking s
Have you looked at routes.py?
http://web2py.com/book/default/chapter/04#URL-Rewrite
Or did I misunderstand your question?
On Dec 15, 8:47 pm, Alan Etkin wrote:
> I was looking in the book for an option to change the default path of
> a web2py application folder, so when using appadmin to modify
If you want single sign-on functionality, check out
CAS: http://web2py.com/book/default/chapter/08#Central-Authentication-Service.
Otherwise, you could have multiple apps share the same db for the Auth
tables -- though all apps will need to use the same hmac key. If you want
login to apply to a
The grid dropdown box for custom queries has an empty first line.
Is there something I can do about it without digging into the
javascript?
I share the auth tables as described by Anthony.
This means putting the app tables in a separate model file to be
processed after db.py.
Processing is alphabetical.
On Dec 15, 9:16 am, Anthony wrote:
> If you want single sign-on functionality, check out
> CAS:http://web2py.com/book/default/chap
I want to have a working demo of my app for anybody that comes to the site.
If they decide to stay I save their data, otherwise I delete it with a cron
job.
I understand the signature is supposed to prevent hijacking of the session.
I don't want the data to be compromised, even for a anonymous gues
Nico,
Yes, it works !
Actually the code is there for the error check reason so instead of comment
out, I moved the line 92 - 94 after line 105 where result variables is
declared.
The attached file is the modified "ldap_auth.py" and I will send the patch
to Massimo shortly.
Looks like this:
-
On Dec 15, 2011, at 3:29 AM, Chandrakant Kumar wrote:
> I'm adding extra fields to auth_user as,
> auth.settings.extra_fields['auth_user']= [
> Field('user_type', requires=IS_IN_SET('Admin', 'Staff'))]
>
> But, in the Register form I'm getting a listbox with single letter opti
that's great!
On Thu, Dec 15, 2011 at 12:43 PM, Omi Chiba wrote:
> Nico,
>
> Yes, it works !
> Actually the code is there for the error check reason so instead of comment
> out, I moved the line 92 - 94 after line 105 where result variables is
> declared.
>
> The attached file is the modified "l
I know that if i declare the following
db.define_table('person',
Field('name'),)
db.define_table('cat',
Field('name'),
Field('owner',db.person))
db.cat.owner.requires = IS_IN_DB(db, db.person.id)
Then if i delete a person, all the cats of this person will be deleted.
But i declare the cat table
Well i guess that doing
db.define_table('cat',
Field('name'),
Field('owner',db.person,default=db.person.id))
db.cat.owner.requires = IS_IN_DB(db, db.person.id)
does the job.
I added this code (reset_email_lower) to registration
too. But I checked the database and see the following:
1) I create a new user account with email all lower case.
2) the app logs in as default.
3) Log out.
4) I try to create a new user account with same email but
first letter a capital. I see
This is a solution but look at the following, if i declare
db.define_table('person',
Field('name'),)
db.define_table('cat',
Field('name'),
Field('owner',"integer",db.person,default=db.person.id))
db.cat.owner.requires = IS_IN_DB(db, db.person.id)
the reference is broken. Is there another s
By reference is broken i mean that if i remove at some point the person,
the cat that belongs to that person is not removed...
anyone plz?
i tried searching and looking through online documentation for smartgrid,
but can't figure out how to attach onblur to a dropdown field, and then to
insert value into another field based on dropdown selection.
I'm newbie to web2py but I really love it... and have to make this app
Hello,
Can I make a virtual field class generic and how?
Here my virtual field class :
from utils import md5_hash
class v_f_s(object):
def hmd5(self):
return md5_hash('|'.join(str(self.test1[k]) for k in
db.test1.fields()))
I would like to pass "test1" as a argument or getting it f
oh, now i understand, thanks for your explanation jonathan.
On Thu, 15 Dec 2011 21:13:42 +0530, Jonathan Lundell
wrote:
On Dec 15, 2011, at 3:29 AM, Chandrakant Kumar wrote:
I'm adding extra fields to auth_user as,
auth.settings.extra_fields['auth_user']= [
Field('
I have not posted the PDF version yet. Tech problems. The only 4th
edition is the softcover print.
On Dec 14, 3:11 pm, greenpoise wrote:
> is the book @ lulu the pdf version or hard cover?
>
> On Dec 10, 9:44 am, Angelo Compagnucci
> wrote:
>
>
>
>
>
>
>
> > Massimo, I'll hack on this, but first
You need to store the original filenames in a different field. If I
remember there is an eaxmple in the manual.
On Dec 14, 3:45 pm, Alan Etkin wrote:
> If you want to store filenames with the original name (not encoded)
> you must create a custom
> form:http://stackoverflow.com/questions/8008213
:-)
On Dec 14, 3:34 pm, howesc wrote:
> http://www.starmakerstudios.com/uses web2py backend with a coffee
> script/backbone front end. so web2py provides all the data, and the
> coffee/backbone does the layout/interactions. point being that it has been
> done before. :)
>
> cfh
Sorry I had missed this. Will fix shortly.
On Dec 14, 5:33 pm, Paolo Caruccio wrote:
> I already wrote how i fixed the issue (tested only IE9, chrome 15, firefox
> 8 and Opera 11.60 on windows7) in a previous thread
> (https://groups.google.com/d/msg/web2py/AjoKneQCOEA/rFYgbg7GMLAJ).
>
> to corr
I have proposed this once and there was opposition to the change.
On Dec 15, 1:46 am, Brian Will wrote:
> The problem is that Set is superfluous, oddly named, and thereby makes
> the whole DAL confusing to learners. I experienced this confusion
> myself when learning web2py, and now I find it's a
is there a pattern for displaying form values in the URL that the form
submits to?
I'd like a form submitted that accepts three values to look like this:
.../default/birthdate/2/9/2011
in this way users can copy or bookmark the page that displays the results
of the submission.
this birthdate(
from scheduler import Scheduler
On Dec 15, 8:10 am, Tito Garrido wrote:
> Hello folks,
>
> I'm trying to use Scheduler but as soon as I start web2py with -K option
> I'm receiving:
> exec ccode in environment
> File "applications/gt2/models/db.py", line 331, in
> myscheduler = Schedule
We have a number of apps for takings survey. Most are old and could be
improved. This is a recent one stripped to its barebones.
http://tests.web2py.com/depoll
On Dec 14, 10:42 pm, Vineet wrote:
> Good idea. On stackoverflow.com, one can accept an answer & rate
> comments. But on google groups,
Looks like we need a 1.99.5 thanks Omi
On Dec 15, 9:43 am, Omi Chiba wrote:
> Nico,
>
> Yes, it works !
> Actually the code is there for the error check reason so instead of comment
> out, I moved the line 92 - 94 after line 105 where result variables is
> declared.
>
> The attached file is the
def birthdate():
day,month,year = request.args(0),request.args(1),request.args(2)
On Dec 15, 11:31 am, Carl wrote:
> is there a pattern for displaying form values in the URL that the form
> submits to?
>
> I'd like a form submitted that accepts three values to look like this:
>
> .../default/
I think the important here is not to have a survey app in web2py but to
survey the users of web2py about web2py.
with or without a survey app in web2py
Let me suggest LimeSurvey. Its excellent
2011/12/15 Massimo Di Pierro
> We have a number of apps for takings survey. Most are old and coul
and what happens if the user enters the value on the form and submits the
form rather than enters the values directly in an URL?
how do the three values get added to the URL?
Basically, what I want is to instruct web2py that should be treated as if it were , so i would be able to use the admin interface and run that
app in the web server without the need to store the applicacion files
into the applications web2py path.
I see that routes.py has configurable parameters
Bump!
Richard
On Thu, Dec 15, 2011 at 11:56 AM, Richard wrote:
> Hello,
>
> Can I make a virtual field class generic and how?
>
> Here my virtual field class :
>
> from utils import md5_hash
>
> class v_f_s(object):
>def hmd5(self):
>return md5_hash('|'.join(str(self.test1[k]) for k
On Thursday, December 15, 2011 1:17:02 PM UTC-5, Carl wrote:
>
> and what happens if the user enters the value on the form and submits the
> form rather than enters the values directly in an URL?
>
> how do the three values get added to the URL?
>
I suppose after receiving the form submission, yo
What quesitons?
On Dec 15, 11:56 am, António Ramos wrote:
> I think the important here is not to have a survey app in web2py but to
> survey the users of web2py about web2py.
> with or without a survey app in web2py
>
> Let me suggest LimeSurvey. Its excellent
>
> 2011/12/15 Massimo Di Pierro
>
On Thursday, December 15, 2011 12:30:43 PM UTC-5, Massimo Di Pierro wrote:
>
> I have proposed this once and there was opposition to the change.
Do you recall the arguments against?
How to make this possible:
I have only email/password as login.
Want email to be changed to lower case at the register
page and stored as a lower case to the database.
Made this for login/reset password, how to make it
for register page as well?
Registering with mixed case creates a new user a
I'm trying to establish one to many relation with auth_user, but i'm
getting this error:
Traceback (most recent call last):
File "/home/chandra/dev/web2py/gluon/restricted.py", line 194, in
restricted
exec ccode in environment
File "/home/chandra/dev/web2py/applications/job
On Thursday, December 15, 2011 11:42:42 AM UTC-5, thodoris wrote:
>
> This is a solution but look at the following, if i declare
>
>
> db.define_table('person',
> Field('name'),)
>
> db.define_table('cat',
> Field('name'),
> Field('owner',"integer",db.person,default=db.person.id))
> db.cat.own
I'm writing a plugin that needs to work with any arbitrary db table. The
table name is passed to my controller, and that string (the variable
'tablename') is used in building a query. I can't just do db.tablename, so
instead I'm doing db[tablename] and it generally seems to work. But when I
do
To Massimo,
Don´t you have questions to all of us? about web2py?
As a user I would like to know from all users ,for example
what other tools people use with web2py
Are you using web2py for personal use or commercial
What do you like more in web2py.
What you like less in web2py.
and so on...
201
Does this code get run before your db.auth_user table has been defined?
On Thursday, December 15, 2011 1:49:31 PM UTC-5, Chandra wrote:
>
>
> I'm trying to establish one to many relation with auth_user, but i'm
> getting this error:
>
> Traceback (most recent call last):
>File "/home/chandra
Have you tried adding the IS_LOWER validator to the email field when the
register form is submitted?
On Thursday, December 15, 2011 1:43:27 PM UTC-5, Constantine Vasil wrote:
>
> How to make this possible:
>
> I have only email/password as login.
>
> Want email to be changed to lower case at the
no, i'm sharing the auth tables from another application in a separate
model (auth.py) and this code is defined in db.py. so, alphabetically
auth.py is exceuted first.
On Fri, 16 Dec 2011 00:27:59 +0530, Anthony wrote:
Does this code get run before your db.auth_user table has been defined?
Still no web2py love, but some nice features.
http://www.jetbrains.com/pycharm/whatsnew/
and here is the link for voting for web2py support.
http://youtrack.jetbrains.net/issue/PY-1648?projectKey=PY
'web2py the Rodney Dangerfield of Python web frameworks'
I used your suggestion for 'reset_email_lower' from this thread
but it doesn't works with register. It works for login/reset_password
but not with register.
https://groups.google.com/forum/#!topic/web2py/1QjBUy62jP8
I added this code (reset_email_lower) to registration
too. But I checked the data
OK, I found a workaround by doing a double inner-join:
tb = db[tablename]
rowlist = db((tb.author == db.authors.id) & (tb.work ==
db.works.id)).select()
I'm still confused, though, by the difference between db.tablename and
db[tablename]. Why do they act differently in queries?
I looked through some of the source code and couldn't find any evidence
that an app or the applications folder could reside elsewhere (except with
a sym link).
Is a sym link really not an option for you?
But did you try using the IS_LOWER validator?
On Thursday, December 15, 2011 2:09:33 PM UTC-5, thstart wrote:
>
> I used your suggestion for 'reset_email_lower' from this thread
> but it doesn't works with register. It works for login/reset_password
> but not with register.
>
> https://groups.goog
Is this two separate databases -- one from the other app for Auth, and one
for this app? If so, I don't think you can join tables across databases.
Also, does the other app call its user table 'auth_user', or is it using a
different name for that table?
Anthony
On Thursday, December 15, 2011 2
It's issue #565.
This is actually my first PATCH in the community !
On Dec 15, 11:34 am, Massimo Di Pierro
wrote:
> Looks like we need a 1.99.5 thanks Omi
>
> On Dec 15, 9:43 am, Omi Chiba wrote:
>
>
>
>
>
>
>
> > Nico,
>
> > Yes, it works !
> > Actually the code is there for the error check re
Both apps are using same mysql database. masterapp calls it auth_user and
it is present in the database, as i checked it in mysql console.
On Fri, 16 Dec 2011 01:13:02 +0530, Anthony wrote:
Is this two separate databases -- one from the other app for Auth, and
one
for this app? If so, I do
Try to do this :
class v_f_s(object):
def hmd5(self):
return md5_hash('|'.join(str(self[-1][k]) for k in
db[self[-1]]fields()))
But I get "object is unsubscriptable" error...
I don't know if it possible to add a __getitem__ to the virtual field class
that could allow me to access class
I disagree. this
SELECT * FROM table where field ILIKE '%|featured|%';
is valid SQL. % does not need to be escaped in SQL and, in fact, it is
used for pattern patching:
http://www.postgresql.org/docs/7.4/static/functions-matching.html
Perhaps new-relic may have a bug.
On Dec 14, 5:30 pm, pbrei
I don't think the act differently...
db.tablename and db[tablename] are synonym I think and let you do something
like this :
db(db[request.args(0)].id == 1).select(...)
Where request.args(0) is your table name coming from your URL...
In the example you give in your first post you seems to have
Not sure what's going on.
On Thursday, December 15, 2011 2:47:23 PM UTC-5, Chandra wrote:
>
> Both apps are using same mysql database. masterapp calls it auth_user and
> it is present in the database, as i checked it in mysql console.
>
> On Fri, 16 Dec 2011 01:13:02 +0530, Anthony wrote:
>
> >
>
> In the example you give in your first post you seems to have forget the
> field you want to make a constraint for...
>
> in db(db.tablename.fieldname == something).select(...) this part
> "db.tablename.fieldname == something" is equal to "where
> tablename.fieldname = something" in raw SQL.
Are you sure you got the right win32? e.g. it needs to match the Python
version number (2.6) and bit width (32? 64?) of your interpreter.
If you start Python independently, can you "import win32con" without error?
bulk insert is not really bulk except on GAE, although it might potentially
be in the future. The non GAE implementation at this point is:
def bulk_insert(self, table, items):
return [self.insert(table,item) for item in items]
No database seems to override it.
Perhaps there is no choice for this. I wanted to avoid writing setup
script code for each operating system (well, i mean for win and linux
and maybe mac) to link the folder.
Thanks anyway for the help.
On 15 dic, 16:35, pbreit wrote:
> I looked through some of the source code and couldn't find a
I tend to agree. Even if it's not "best practice" (probably debatable), it
should still be supported by New Relic).
I am planning on implementing mongodb bulk inserts. They should be a bit faster.
Van: web2py@googlegroups.com [mailto:web2py@googlegroups.com] Namens nick name
Verzonden: donderdag 15 december 2011 23:11
Aan: web2py@googlegroups.com
Onderwerp: [web2py] Re: bulk_insert
bulk insert is not rea
Both auth_user tables contain the "org" field with an identical
definition, right?
On Dec 15, 1:49 pm, "Chandrakant Kumar" wrote:
> I'm trying to establish one to many relation with auth_user, but i'm
> getting this error:
>
> Traceback (most recent call last):
> File "/home/chandra/dev/web2py
Although it does seem like psycopg prefers parameterization.
could you please post a code how to that for register especially?
I found a workaround to keep the connection available.
Every 5 minutes, the desktop app fires an event wich calls this
command:
db["_adapter"].connection.reset()
This only works for a postgres database interface.
I still couldn't find the cause for the connection irreversible
closing
I think th
def user():
if request.args(0) == 'register':
db.auth_user.email.requires.insert(0, IS_LOWER())
[rest of code]
Note, the above assumes there is already at least one validator defined for
the email field (which there should be by default) -- otherwise, just do
requires=...
Anthon
Thank you, I will test it.
On Dec 16, 7:13 am, Massimo Di Pierro
wrote:
> I disagree. this
>
> SELECT * FROM table where field ILIKE '%|featured|%';
>
> is valid SQL. % does not need to be escaped in SQL and, in fact, it is
> used for pattern patching:
>
> http://www.postgresql.org/docs/7.4/static/functions-matching.html
Are you perhaps introspecting the type of the cursor object in some
way and changing behaviour based on that? We wrap the cursor object
returned by DBAPI2 module and so you wouldn't see original psycopg2
cursor type.
Graham
On Dec 16, 10:02 am, Graham Dumpleton
wrote:
> On Dec 16, 7:13 am, Massi
Okay, have an answer.
Looks like we may be falling into a bit of undefined territory within
the DBAPI2 specification that I can see and different DBAPI2 modules
behave differently.
Some will take parameters as evaluating False to mean no parameters
and so not trigger doing any variable substituti
Thanks Anthony. I don't think I've seen that in the docs.
On Thursday, December 15, 2011, Anthony wrote:
> Try
>
> IS_IN_DB(..., multiple=(0, 3))
>
> The "multiple" argument to IS_IN_SET and IS_IN_DB can be a list or tuple
> specifying a minimum and maximum number of items to be selected (strictl
I'm still trying to resolve my problem, and desperately need someone's help
:)
When I try to add a new sku to a purchase order, I would like to
prepopulate "CPU" field with the value from db.sku.cpu (determined by a
dropdown).
http://127.0.0.1:8000/test/default/list_purchase_orders/purchase_ord
Thanks for investigating. Is it something that is fixable on NewRelic's
end? Or would Web2py need to change how it submits the query?
>From my brief research, it does seem like psycopg expects queries to be
parameterized (ie, using string substitution). However my query works fine
when not wrap
Isn't that the default behavior? I mean, after registration a user is
automatically logged in.
Anyway, what I did was when a currently logged-in and unverified user's
account is verified or updated by the admin, his status will be updated
when he checks his profile (or logs out and logs in again.)
Try this:
db.po_sku.default=lambda v,r: db.sku[r.sku_id].cpu
On Friday, December 16, 2011, Adi wrote:
> I'm still trying to resolve my problem, and desperately need someone's
> help :)
>
> When I try to add a new sku to a purchase order, I would like to
> prepopulate "CPU" field with the value fr
i put it as suggested, but it didn't work...
another problem is "onchange', when a different value gets selected in
dropdown how to pass the accompanying db.sku.cpu to db.po_sku.cpu field.
Great! Thanks Cliff
On Thursday, December 15, 2011, Cliff wrote:
> You can differentiate based on the request, like this:
>
> if len(request.args) > 2 and request.args[-3] == 'edit':
> fields = [] # what you want to show for editing
> else:
> fields = [] # what you want to show on the initial g
I found a fix but I am not qualified to determine if it should go in as a
patch.
I basically added a % on each side. I think %% distills down to % without
triggering a substitution.
http://code.google.com/p/web2py/source/browse/gluon/dal.py#1924
From:
key = '%|'+str(second).replace('|','||').r
I am making a change on New Relic side. You can't do what you are doing as
that then will cause wrong thing to happen for when New Relic not used.
So am changing things to accommodate for what psycopg2 interprets as
default argument.
The issue hasn't come up before because Web2Py is the only fr
Ah .. so you want it processed as soon as the drop-down is selected? That
would need some Ajax magic.
On Friday, December 16, 2011, Adi wrote:
> i put it as suggested, but it didn't work...
>
> another problem is "onchange', when a different value gets selected in
> dropdown how to pass the accom
1 - 100 of 133 matches
Mail list logo