On 23 February 2012 00:30, naveed nav...@gmail.com wrote:
A slightly related question: In the grid, how can I show values from
referenced tables?
I have the table:
db.define_table('table1',
Field('field1'),
Field('usr', db.auth_user))
How can I show the user's first and last names in
No, there is no stacktrace in the logs only the warning. Also I have
tried passing the stream as payload but I get an error there as well.
Its stacktrace is:
File /base/data/home/apps/s~app-id/1.357014326405166801/applications/
abc/controllers/xyz.py:download, line 384, in report_download
File
Migration was not disabled. However, I made a new application
duplicating the original db procedures, and I was able to add a field
in the field definition in db.py.
The new one:
db = DAL('sqlite://storage2.db')
from gluon.tools import Auth
auth = Auth(db)
auth.define_tables()
Hi Anthony,
Thanks for you reply. I'll give your solution a try, and let you know
if it solved my problem.
Best regards,
Annet
how can i capture the logout time
i can easy capture the login time with help of .now() bt i couldn't
the logout time
how can we fetch the login time and logout time from the server
I need store both timing into my database
is there any way to change the path after Login by default in direct
to the index
nice one
thanks
On Feb 17, 8:55 pm, Anthony abasta...@gmail.com wrote:
w2p_fl: web2py field label
w2p_fw: web2py field widget
w2p_fc: web2py field comment
Each input field in a web2py SQLFORM gets a label, widget, and (optional)
comment. Those classes are added to the appropriate TD,
Thanks to both of you. I'll try these when I get to my office this
morning. Assume I'll be back with either good results or more questions :)
You're probably right, access to global variables in mulithreading
environment requires extra care.
You might find reading this helpful:
http://blog.notdot.net/2011/10/Migrating-to-Python-2-7-part-1-Threadsafe
Using the following controller the first page shows up and everything works
as expected until I select a next page of the grid.
First page:
Storage {'_formkey': 'c8868643-80d8-406a-b1b9-cb87304ad4aa', 'tt':
'article', '_formname': 'no_table/create', 'tabel': 'ufs'}
On the second page there is
Goggle bigtable support in DAL is already GAE specific. You can also access
entities by id (which is returned after insert) or key using DAL. Mixing in
native API is possible if needed too, as app portability is lost anyway
with GAE. And the non web2py specific things such as N:N relations,
I have written a calming reply yesterday but now I see it hasn't showed up.
Hm. I use the google groups web interface and this isn't the first time
this has happened. Ah well.
Anyway, it wasn't my intention to attack anyone, but it seems that I still
have a strong opinion about IE. I thought
I'm sorry, but I think you are on your own on this one :) Anyone who was
ever involved in coding CSS workarounds for IE6 remembers this nightmare
very strongly and would not go back to it even if paid lots of money :) If
you need your app to work perfectly on IE6, I suggest starting the
Hi All,
I have been wondering if there is somewhere a hidden method of using
regexps in queries.
I found this
discussionhttps://groups.google.com/d/topic/web2py/-XnMx24to8s/discussion on
the mailing list, where a way to do it was suggested and it was
said there that this will be added to
Yes please look in docs.
On Feb 23, 2012 5:33 AM, Prakhar Srivastava prakhar@gmail.com wrote:
is there any way to change the path after Login by default in direct
to the index
You have to manually restart the server to see changes in the module
directory. Life is simpler if you use Rocket for your local
development.
Modules are useful for common code. It doesn't make sense to have 15
controllers all doing pretty much the same thing.
Code in the modules directory
Getting the same error and just updated from the git repository.
10.102.50.37.2012-02-23.07-46-58.25a3ba02-828a-41d8-ae1d-daf22ab847df
type 'exceptions.AttributeError' 'NoneType' object has no attribute
'user_groups'
snippets from my db.py: (added to the original skeleton)
## create all
try that:
auth.settings.create_user_groups = False
Ciao
On Thu, Feb 23, 2012 at 1:50 PM, Larry Wapnitsky la...@kvetsch.com wrote:
Getting the same error and just updated from the git repository.
10.102.50.37.2012-02-23.07-46-58.25a3ba02-828a-41d8-ae1d-daf22ab847df
type
genius! I just need to read through and figure out how to do the proper
name/group mapping from AD to web2py.
Great framework, BTW, Massimiliano!
On 2/23/2012 8:08 AM, Massimiliano wrote:
auth.settings.create_user_groups = False
On Thursday, February 23, 2012 2:11:19 AM UTC-5, Prakhar Srivastava wrote:
is there any way to change the path after Login by default in direct
to the index
auth.settings.login_next = URL('default', 'index')
If the user requests a specific URL that requires login and gets redirected
to the
I solved the problem by using:
if request.vars.tabel:
tabel = request.vars.tabel
session.tabel = tabel
else:
tabel = session.tabel
if request.vars.tt:
tt = request.vars.tt
session.tt = tt
else:
tt = session.tt
But I stil do not
It should be made clear in the documentation that some db operations
must use web2py DAL concepts. In the original, I added a field once
using db.sqlexecute and once in the sqlite3 bash command line and they
do not show in sqlform indicating some operations must have a specific
format
On Thursday, February 23, 2012 4:46:10 AM UTC-5, Prakhar Srivastava wrote:
how can i capture the logout time
i can easy capture the login time with help of .now() bt i couldn't
the logout time
Note, the auth_events table already records all Auth events, including all
logins and logouts,
My fault for not bugging Massimo about it ;)
I suggest opening a ticket in google code referencing the original
post, the patch is mostly there.
On Thursday, February 23, 2012 2:27:44 AM UTC-5, Mchurch wrote:
**{'%s%s' % (Keyword, n): checked})
Anthony, can you explain it better? It's something that I would like
to understand very well.
'%s%s' % (Keyword, n) is Python string formatting -- if Keyword is hello
and n is 5, it will
On Thursday, February 23, 2012 2:09:23 AM UTC-5, Prakhar Srivastava wrote:
how can we fetch the login time and logout time from the server
I need store both timing into my database
As mentioned in another thread, this is automatically captured in the
auth_event table.
Anthony
thanks a lot!
On 23 Feb, 15:19, Anthony abasta...@gmail.com wrote:
On Thursday, February 23, 2012 2:27:44 AM UTC-5, Mchurch wrote:
**{'%s%s' % (Keyword, n): checked})
Anthony, can you explain it better? It's something that I would like
to understand very well.
'%s%s' % (Keyword, n) is
I opened an issue: http://code.google.com/p/web2py/issues/detail?id=678
Thanks for finding out how this should be done, I don't mind helping
nagging about it ;-)
Best,
Omri
Can i use web2py auth with Novell Edirectory
any sample code?
thank you
António
You can pass a dictionary to a function as if you are passing keyword
arguments.
kwargs = {a:1, b:2}
f(**kwargs) # this call is equal to f(a=1, b=3)
There is similar mechanism for positional arguments in Python:
args = [1, 2]
f(*args) # this call is equal to f(1, 2)
Is there a PHP like reference manual for Web2Py?
Or maybe an IDE that'll help a newbie, ex-PHPite like me build faster?
perhaps you can try the GAE mail class directly as shown
here: http://code.google.com/appengine/docs/python/mail/attachments.html ?
Aside from the book, there's the Epydoc auto-generated source code
documentation: http://www.web2py.com/examples/static/epydoc/index.html. You
might also find it helpful to just explore the source code directly. You
can use any IDE, and if you want auto-completion for the web2py API, you
can
I'm trying to use the following in my applications, but only one works at a
time:
db.ips.ipaddress.requires = IS_NOT_IN_DB(db, 'ips.ipaddress')
db.ips.ipaddress.requires = IS_IPV4()
How can I get them both to process?
Thank you,
Larry
requires can be a list, so you can :
db.ips.ipaddress.requires = [IS_NOT_IN_DB(db, 'ips.ipaddress')]
db.ips.ipaddress.requires.append(IS_IPV4())
you are a god amongst men! thank you!
On 2/23/2012 12:19 PM, Niphlod wrote:
db.ips.ipaddress.requires = [IS_NOT_IN_DB(db, 'ips.ipaddress')]
db.ips.ipaddress.requires.append(IS_IPV4())
On Thursday, February 23, 2012 12:11:48 PM UTC-5, Larry Wapnitsky wrote:
I'm trying to use the following in my applications, but only one works at
a time:
db.ips.ipaddress.requires = IS_NOT_IN_DB(db, 'ips.ipaddress')
db.ips.ipaddress.requires = IS_IPV4()
How can I get them both to
Thank you Anthony :)
On Thu, Feb 23, 2012 at 10:29 PM, Anthony abasta...@gmail.com wrote:
Aside from the book, there's the Epydoc auto-generated source code
documentation: http://www.web2py.com/examples/static/epydoc/index.html.
You might also find it helpful to just explore the source code
(newbie disclaimer :))
I'm logging in to my application via AD/LDAP. I can get the variable of
the username with no issue. What i need to do next is take this variable
and insert it into a field in a CRUD form and have it show in my database.
Thanks,
Larry
Thank you, Johann, I'll try this.
I am not sure how you connect to LDAP, but there is utilities to connect
LDAP with web2py. You should read about those in the book searching with
LDAP as keyword. If you only want to import LDAP user into web2py database
table, I suggest you to use the user table of the RBAC.
So then you can
The issue is not putting the username into the web2py database, but
another database that's storing information.
On 2/23/2012 2:32 PM, Richard Vézina wrote:
I am not sure how you connect to LDAP, but there is utilities to
connect LDAP with web2py. You should read about those in the book
Ok, but what's is the problem... I don't understand sorry.
Richard
On Thu, Feb 23, 2012 at 2:33 PM, Larry G. Wapnitsky la...@kvetsch.comwrote:
The issue is not putting the username into the web2py database, but
another database that's storing information.
On 2/23/2012 2:32 PM, Richard
I need to have the username added to another SQL table on submission of
a form.
This is some of the code:
db.define_table('ips',
Field('id', 'id'),
Field('ipaddress','string', length=15, unique=True),
Field('dateadded', 'datetime', default=request.now),
Field('reportedby',
You maybe have to redefine the auth_user models to append new fields...
If you add username field web2py will use the values stored there as login
automatically. But for that you have to redefine the user table.
Then you can use CRUD as well...
Richard
On Thu, Feb 23, 2012 at 2:37 PM, Richard
Ok,
So you need to create a foreign key relation... So you need requires=...
db.ips.reportedby.requires=IS_IN_DB(db, 'ips.id', '%(first_name)s
%(last_name)s %(username)s %(whateverfieldname)s')
If you have only one referenced user you will have to change the type of
reportedby to integer since
it's only one user that I need to enter into the database at a time, and
only the username. reportedby needs to be text due to another
application that uses the same database.
On 2/23/2012 2:51 PM, Richard Vézina wrote:
Ok,
So you need to create a foreign key relation... So you need
In that case I think you will have to build something on your side... Maybe
implement your own IS_IN_DB could be a solution... A hack could be this :
db.ips.reportedby.requires=str(IS_IN_DB())
But I don't think you will be able to define a foreign key... You will have
to enforce your integrity
I am pretty not sure about the hack, but you can try... It is pretty
dirty... And you will not be able to use represent except if you transform
back you id from string to int.
Why you don't just write a simple function that you other ressource will
call to get the ids under string format like
I'm pretty lost in everything you've described. I've been working with
web2py for 2+ days and am slowly getting the hang of it. If you could
dumb it down a bit, that would be helpful.
FYI - I can print the username using auth.user_id.username anyplace else
in a web page. I just need to
How your other system call you ips table? Directly at backend level? If so
you can't just use the proper field type to make work web2py correctly and
use plainfully you will have to master much more web2py and how it works to
make it works the way you need it to work.
If the orther program that
I apologize, but there is a bit of a language barrier here. What you've
written is very confusing to me
On 2/23/2012 3:14 PM, Richard Vézina wrote:
How your other system call you ips table? Directly at backend level?
If so you can't just use the proper field type to make work web2py
I uploaded a small (1mb) jpeg image to my local dev app server. In this
case the blob goes in the image file and is stored as a large string in an
'image_blob' field.
However when I retrieve this image it is displayed as a string, rather than
as an image.
Is there something else I need to do
Sorry, my english is terrilble sometimes...
I just thought about an other solution :
You could have two ips table one that interact with web2py and an other for
your other program that access ips table. Then you will have to trigger
data synchronisation between the 2 tables.
Richard
On Thu,
two tables does not simplify things.
why can i not just enter that variable into a crud submission?
On 2/23/2012 3:24 PM, Richard Vézina wrote:
Sorry, my english is terrilble sometimes...
I just thought about an other solution :
You could have two ips table one that interact with web2py and
Because you don't use the proper type for the field to allow web2py to work
properly...
An other solution :
remove db.auth_user, writable=False, readable=False from this line :
Field('reportedby', 'string', db.auth_user, writable=False,
readable=False),
Then you will be able to put what
found this:
yes you can do this:
db.mytable.myfield.default='best'
db.mytable.myfield.writable=False # user cannot change it
db.mytable.myfield.readable=False # user does not see it
before form=crud.create(db.mytable)
via http://osdir.com/ml/web2py/2010-08/msg01892.html
working for me.
On
Happy you solve your big problem
Richard
On Thu, Feb 23, 2012 at 3:37 PM, Larry G. Wapnitsky la...@kvetsch.comwrote:
found this:
yes you can do this:
db.mytable.myfield.default='best'
db.mytable.myfield.writable=False # user cannot change it
db.mytable.myfield.readable=False # user does
Hello,
I would like to learn Web2py but know nothing about programming. I'm
convinced it's the best language out there so I don't want to waste
time learning something that would not be applicable if I ended up
using Web2py (PHP, etc). Do I need to learn Javascript first? Do I
need to know
Do you know if those engines that support it, have the same regex
syntax?
On Feb 23, 9:41 am, Omri Har-Shemesh omri...@gmail.com wrote:
I opened an issue:http://code.google.com/p/web2py/issues/detail?id=678
Thanks for finding out how this should be done, I don't mind helping
nagging about it
Notice is works even without the []:
db.ips.ipaddress.requires = IS_IPV4(),
IS_NOT_IN_DB(db,
'ips.ipaddress')
tuples in python do not requires brackets, only commas.
On Feb 23, 11:20 am, Anthony abasta...@gmail.com wrote:
On Thursday, February 23, 2012
you need to set the
response.header['Content-type']='image/jpeg'
else the browser does not know what to do with the file.
On Feb 23, 2:23 pm, BrendanC bren...@gmail.com wrote:
I uploaded a small (1mb) jpeg image to my local dev app server. In this
case the blob goes in the image file and is
For web2py, you will need to learn python first and you can start by
reading the chapter dedicated to python in web2py book.
Richard
On Thu, Feb 23, 2012 at 3:34 PM, newbie ericgushi...@gmail.com wrote:
Hello,
I would like to learn Web2py but know nothing about programming. I'm
convinced
db.define_table('ips',
Field('id', 'id'),
Field('ipaddress','string', length=15, unique=True),
Field('dateadded', 'datetime', default=request.now),
Field('reportedby', 'string', writable=False, readable=False,
default=auth.user.username
if auth.user else
It was difficult to understand what he wants to do...
Richard
On Thu, Feb 23, 2012 at 3:48 PM, Anthony abasta...@gmail.com wrote:
db.define_table('ips',
Field('id', 'id'),
Field('ipaddress','string', length=15, unique=True),
Field('dateadded', 'datetime', default=request.now),
that works even better than what I found. Thanks, Anthony!
On 2/23/2012 3:48 PM, Anthony wrote:
db.define_table('ips',
Field('id', 'id'),
Field('ipaddress','string', length=15, unique=True),
Field('dateadded', 'datetime', default=request.now),
You pose an interesting challenge. Learn to use web2py without knowing
how to program
I think it can be done. I will try record a video tutorial for you.
It may take a couple of week. remind me if necessary.
Meanwhile you can take a more traditional approach:
1) learn to program using
So far there is six of us:
http://mdp.cti.depaul.edu/rsvp/default/respond_event/a481f9c5-7aa9-404d-86cb-501ea29e043a
Anybody else from this list will be at PyCon? RSVP using the link
above.
Look forward to see you there.
Massimo
On Thursday, February 23, 2012 3:34:08 PM UTC-5, newbie wrote:
Hello,
I would like to learn Web2py but know nothing about programming. I'm
convinced it's the best language out there so I don't want to waste
time learning something that would not be applicable if I ended up
using Web2py
Eventually, you will want to get deeper into Python, and there are plenty
of online resources for that.
For example: http://wiki.python.org/moin/BeginnersGuide/NonProgrammers
the table creation understanding requires an insight to google big
tablewhich is that big table actually does not have tables. it has
entries, and those entries contain data stored in key-value pairs. under
the covers are some secret key-value pairs that tell GAE that this entry
actually
Notice is works even without the []:
db.ips.ipaddress.requires = IS_IPV4(),
IS_NOT_IN_DB(db,
'ips.ipaddress')
tuples in python do not requires brackets, only commas.
Though note that tuples are not mutable, so no appending, inserting, etc.
in
Massimo, You are incredible!!
On 23 Feb, 21:51, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
...You pose an interesting challenge.I think it can be done...It
may take a couple of week. remind me if necessary
Meanwhile you can take a more traditional approach:
1) learn to
If you are patient, you might be able to learn enough programming by
downloading Web2y and following web2py.com/book. It includes a brief
overview of Python which is a great language for newbies. The Overview in
the book provides the exact code that you can type in to Web2py files to
run good
As an ex-PHPer myself, I find IDEs more of a hindrance. Python is a concise
language and Web2py a concise framework.
It's not a Python thing. It's a web development thing. URLs should
typically correspond to one resource.
That's an OK case for rewriting but quite different from the previous
example. Depending on how necessary it is to avoid an extra URL segment,
you could easily set it up as
I thought the content type settings were handled automatically by the
framework.
Anyway - for some reason setting the response.headers to 'image/jpeg' does
not work - just get an empty/blank page.
I must be missing something else re handling gae blob properties - here's
my test code:
Any
How about:
1) - Download and install the framework (and python)
2) - Read first few chapters of the manual (you might want to invest $10 in
the pdf manual and print off a few chapters for offline review) - Sometimes
it's easier to concentrate w/out having a terminal to distract you). Try to
One caveat:
While I agree that w3schools is a helpful resource (as I use it as a
regular reference), their examples do not promote best practices, most
notably absent is unobtrusive JavaScript. I had to *unlearn much *of what I
read on there.
For more information and better resources, include
Thanks for pointing that out, Chris. One nice feature of w3schools is the
try it functionality that let's you play around with some code and see
the results, though you can also do that with tools
like http://jsfiddle.net/.
Anthony
On Thursday, February 23, 2012 6:38:50 PM UTC-5, Chris May
I'm reading through the tutorial and just came across the part that
adds the code:
from gluon.tools import Auth
auth = Auth(db)
auth.define_tables()
def user():
return dict(form=auth())
And suddenly login, register, etc were enabled. This is the first
magic I've come across in web2py that I
The user() function is called with an additional argument in the URL (e.g.,
/user/login, /user/register, etc.). This extra argument is accessible via
request.args[0]. Now, the Auth class has a __call__ method, so the auth
object is callable. When you call it via auth(), the __call__ method
Thanks. I'm also wondering where the exposed URL's are located (/user/
login, /user/register, etc.). Can I customize these views?
On Feb 23, 9:34 pm, Anthony abasta...@gmail.com wrote:
The user() function is called with an additional argument in the URL (e.g.,
/user/login, /user/register,
On Thursday, February 23, 2012 10:00:37 PM UTC-5, davidkw wrote:
Thanks. I'm also wondering where the exposed URL's are located (/user/
login, /user/register, etc.). Can I customize these views?
The welcome app includes a /default/user.html view, which you can edit.
You can also create
Learnt something new today. Thanks Massimo :)
On Feb 24, 4:44 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
Notice is works even without the []:
db.ips.ipaddress.requires = IS_IPV4(),
IS_NOT_IN_DB(db,
'ips.ipaddress')
tuples in python do
pbreit, what program do you use to code with web2py?
Do you use the admin interface?
On Feb 24, 5:14 am, pbreit pbreitenb...@gmail.com wrote:
As an ex-PHPer myself, I find IDEs more of a hindrance. Python is a concise
language and Web2py a concise framework.
Thanks Anthony ,
I this thing with mr.sanjeet and i got the success bt is there any other
way to solve this problem
On Thu, Feb 23, 2012 at 7:24 PM, Anthony abasta...@gmail.com wrote:
On Thursday, February 23, 2012 2:11:19 AM UTC-5, Prakhar Srivastava wrote:
is there any way to change the
thanks Anthony
through function we got this
i have to try with the timestamps
On Thu, Feb 23, 2012 at 7:41 PM, Anthony abasta...@gmail.com wrote:
On Thursday, February 23, 2012 4:46:10 AM UTC-5, Prakhar Srivastava wrote:
how can i capture the logout time
i can easy capture the login time
Hmm, I'm still having trouble creating separate actions and views for
auth. The ones I create don't seem to override the default ones.
Is there any way I can expose auth as a controller? And rewrite the
methods in there? Thanks.
On Feb 23, 10:08 pm, Anthony abasta...@gmail.com wrote:
On
Apparently it's sort of possible but I don't think for the feint of heart:
https://groups.google.com/forum/#!searchin/web2py/override$20auth/web2py/dBRbPxRw8uQ/DLgJs-PgwAQJ
It is possible to manipulate from things in the user() function. For
example, mine looks like this:
def user():
if not
On Thursday, February 23, 2012 11:57:49 PM UTC-5, davidkw wrote:
Hmm, I'm still having trouble creating separate actions and views for
auth. The ones I create don't seem to override the default ones.
Is there any way I can expose auth as a controller? And rewrite the
methods in there?
I use a good text editor, TextMate for Mac. The only fancy features I think
are really necessary are a nice tree view of my directory, smart indenting
and syntax highlighting. I try an IDE with code completion every few months
and find it very distracting. The admin interface is not really
W3schools is perfectly fine. That fools thing is a little overblown.
I am added the some extra fields in the auth_user table and i want to hide
those fields when the user will go for the registration user can only see
the following fields during the registration:
- First name
- Last name
- email-id
- Password
- verify password
OK - Quick follow up here - I was able to display an blob image using the
call:
def list_image():
myid = 1# test
image=db(db.xim.id==myid).select(orderby=db.xim.title)
response.headers['Content-Type']='image/jpeg'
mystream = image.image_blob
return mystream
However
You can set the writable attribute of the extra fields to False. You can
change that attribute conditionally for registration vs. profile, etc. if
necessary (e.g., if request.args(0) == 'registration').
Anthony
On Friday, February 24, 2012 12:21:18 AM UTC-5, Sanjeet Kumar wrote:
I am added
On Thursday, February 23, 2012 11:07:15 PM UTC-5, Prakhar Srivastava wrote:
Thanks Anthony ,
I this thing with mr.sanjeet and i got the success bt is there any other
way to solve this problem
Can you be more specific about the problem? Why can't you use the suggested
solution? What have
Thanks, I wasn't trying to do anything specific. I'm just going
through the tutorial and trying to understand how stuff works.
Thanks for the link though. I hadn't found the settings info before,
and it's very helpful.
On Feb 24, 12:19 am, Anthony abasta...@gmail.com wrote:
On Thursday,
def user():
*if 'register' in request.args:
fields_to_hide = ['city', 'preferred_color', 'soccer_team']
for fieldname in fields_to_hide:
field = db.auth_user[fieldname]
field.readable = field.writable = False*
return
1 - 100 of 103 matches
Mail list logo