Hi Alan and Anthony,
Thanks for your replies. This solution partially solved the problem:
db.NodeRelatedCard.targetID.represent = lambda targetID, row:
db(db.Organization.nodeID == targetID).select().first().name
In appadmin the targetID is now represented by the name of the
organization,
Dear All ,
How Can I Render HTML CSS Python code The are Retrieved from the
database ?
Best Regards ,
Dear All ,
How Can I Render HTML CSS Python code The are Retrieved from the
database ?
Best Regards ,
okay - Here are a few reasons -
*@Anthony *- What exactly is it that you are trying to hide? Can you give
an example?
Here is the example -
Please consider the below view page source (form when serialized) line when
I have filled up a form * using a database for my software BugBuster* in
The web2py recipes book is finally out:
http://www.packtpub.com/web2py-application-development-recipes-to-master-python-web-framework-cookbook/book
Congratulations to all those who contributed.
Massimo
On controller
from gluon.template import render
def myaction():
template = db(query).select().first().template_field
data = dict(key=value,...)
return render(template, context=data)
On terminal:
$ python web2py.py -S welcome -M
In [14]: from gluon.template import render
In
This isn't going to be like the other book right? Where I bought it then
the next day it was available for free online.
On Mon, Mar 12, 2012 at 12:18 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
The web2py recipes book is finally out:
From what I've read and tinkered with myself, it doesn't seem possible
to prevent others from finding a way to view your html source. My
observation is that you usually trade off security vs. ease of use.
The more locked doors and alarms, the more annoying your system
becomes for the typical user.
Any idea if future updates to the book will be free if the ebook version is
purchased?
Thanks!
Hello,
Can someone give me a simple example for Photo Gallery with Sliding content?
Thanks in advance!!!
Regards
Praveen
If you look in pugin_wiki, you will see slideshow.
On Mar 12, 9:36 am, Praveen Bhat praveenbha...@gmail.com wrote:
Hello,
Can someone give me a simple example for Photo Gallery with Sliding content?
Thanks in advance!!!
Regards
Praveen
Hello Peter,
I see the following:
def
slideshow(links=None,table=None,field='image',transition='fade',width=200,height=200):
## Embeds a slideshow
It gets the images from a table
- ``table`` is the table name
- ``field`` is the upload field in the table that contains images
-
To edit an image you need to pass the id of the row to SQLFORM.
Ex.:
row_id = 1
form = SQLFORM(db.ref, row_id)
2012/3/11 juvi1 juha.wilh...@gmail.com
thanks, but now form create always new image in database, and i want
update image.
how it can be done??
sunnuntaina 11. maaliskuuta 2012
This two examples you have given, from your web2py form and from pyjamas,
are they functionally equivalent? If they are, please post the javascript
for both pages too, so that we can really compare.
When you mention this secure tag in html5 or web2py 2.0, it seems to me
that you are still
Does anyone know when the web2py cookbook will be available please ?
Regards
Bussiere
Les nouvelles technologies offrent pleins de nouvelles possibilités,
pleins de possibilités d'erreurs surtout en fait.
insurance.aes256 : http://goo.gl/gHyAY
Thanks again
regards
Bussiere
Les nouvelles technologies offrent pleins de nouvelles possibilités,
pleins de possibilités d'erreurs surtout en fait.
insurance.aes256 : http://goo.gl/gHyAY
On Mon, Mar 12, 2012 at 1:43 AM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
you the fields
This two examples you have given, from your web2py form and from pyjamas,
are they functionally equivalent? If they are, please post the javascript
for both pages too, so that we can really compare.
When you mention this secure tag in html5 or web2py 2.0, it seems to me
that you are still
it renders the python code but it dosent render the html code in the
view so i can see the html code !
What exactly are you trying to do? Why you don't use the URL function?
Hi,
Thanks a lot for the replies.
Actually we are implementing FB login for our app. For this we want to
detect whether /user/login controller was a redirect from facebook (after
authentication) or a a user noramlly opened /user/login in their browser.
Sometimes FB reidrects to
Especially for posted values and such the source is less interesting.
Anything that is transmitted via http can be logged (and tricked!)
with tools like Charles or Fiddler anyway. This even holds for e.g.
flash based web apps except if you encrypt values before sending them.
On 12 Mrz., 10:30,
when you do return render(...) it renders the python code into html text
markup.
the browser is the responsible for rendering this markup.
or you can try to output this as pdf using pyfpdf.
what are you trying to do?
http://zerp.ly/rochacbruno
Em 12/03/2012 07:31, Hassan Alnatour
https://lh4.googleusercontent.com/-C5e04mE4s8I/T13jl7HXizI/AAU/ngyK-9pCkAA/s1600/Screenshot%2520at%25202012-03-12%252013%253A51%253A57.png
Sry. I dont understand. now all forms update same image (image_id1)
can i send img_id (in view) to form (in controller)?
I also try this code, but
this code work but i need create form in controller but how i send the
img_id variable in controller (form)?
{{for img in images:}}
imageimg width=85px
src={{=URL('download', args=img.file)}} /br/image
brbrbrbrbr
{{=img}}
{{=img.id}}
{{row_id=img.id}}
When using the following grid:
query = ((db.akb_authors.id.belongs(ids))
(db.akb_authors_article_link.author == db.akb_authors.uuid)
(db.akb_authors_article_link.article == db.akb_articles.uuid)
(db.akb_journal.uuid == db.akb_articles.journal))
left
Hi,
Following is the snippet from my db.py global file:
db = DAL('google:datastore')
from gluon.tools import Auth
auth = Auth(db, hmac_key=Auth.get_or_create_key())
auth.settings.login_url = URL('default','index')
auth.settings.logged_url = URL('user','profile')
auth.settings.login_next =
Hello,
I'm considering using DAL in a desktop application written with wxPython.
The problem I've come across is that DAL queries accept and return utf-8
encoded strings. wxPython operates with Unicode strings and I have to
convert every string that I send to or get from DAL to
Python Unicode
im trying to have somthing like this is the database , in a table
called pages :
h3{{=c.name}}/h3
img src={{=URL('download',args=c.image)}}/
and then get the record from the database and in the view but only
this :
{{=content}}
In controller
rendered = render(.)
return dict(rendered=rendered)
in view
{{=XML(rendered)}}
http://zerp.ly/rochacbruno
Em 12/03/2012 10:27, Hassan Alnatour halna...@gardeniatelco.com
escreveu:
im trying to have somthing like this is the database , in a table
called pages :
Why are you passing session=None to .process ?
http://zerp.ly/rochacbruno
Em 12/03/2012 09:43, Sushant Taneja sushant.tanej...@gmail.com escreveu:
Hi,
Following is the snippet from my db.py global file:
db = DAL('google:datastore')
from gluon.tools import Auth
auth = Auth(db,
The cookbook is still labelled as pre order.
When will it be out please ?
Regards
Bussiere
Les nouvelles technologies offrent pleins de nouvelles possibilités,
pleins de possibilités d'erreurs surtout en fait.
insurance.aes256 : http://goo.gl/gHyAY
On Mon, Mar 12, 2012 at 10:35 AM, lyn2py
Hello all,
I'm fairly knew to web2py and trying to find things out by myself as much
as I can. However, I have not been able to find how to create
logical/relationship URLs. Let's say I have a model named TopThing, which
has a 1-to-many relationship with MiddleThing, which also has a
The easy way is to add another controller edit_image and add a link to
this in each image.
(controller/default.py)
def edit_image():
row_id = request.args[0]
form = SQLFORM(db.ref, row_id)
if form.process().accepted:
response.flash = Image uploaded
else:
To convert a string to utf-8 you need to do two operations:
- decode the string to unicode (using the original file codec)
- encode the unicode string using utf-8 codec
This is what decoder.decoder function is doing but it is guessing the
original codec.
You need to either provide the right
Hi,
I passed the session=None since I was following example in the book.
I removed it from the process method and now I am using
login_form = auth.login()
if login_form.process(formname='login').accepted:
pass
elif login_form.errors:
response.write(request.vars)
def index():
login_form = auth.login()
if login_form.process(session=None,formname='login').accepted:
pass
elif login_form.errors:
response.write(request.vars)
return dict()
to display the form I have used the SQLForm in HTML technique as mentioned
in
Curious if the issue I have with my app coulb become from the new pg8000
driver??
https://groups.google.com/forum/?fromgroups#!searchin/web2py/%5Bweb2py%5D$20my$20app$20not$20works$20with$20web2py$201.99.7/web2py/i7wx6JVTOtw/JlaULRp8G0AJ
Do I have to change anything in my connection string with
Thanks for an explanatory answer.
I will try this out.
On Monday, March 12, 2012 7:49:28 PM UTC+5:30, Anthony wrote:
def index():
login_form = auth.login()
if login_form.process(session=None,formname='login').accepted:
pass
elif login_form.errors:
Check out the RESTful web services
functionality:
http://web2py.com/books/default/chapter/29/10#Restful-Web-Services,
in
particular,
http://web2py.com/books/default/chapter/29/10#parse_as_rest-(experimental).
You could also handle this specific case in a controller action, with all
the
Actually we are implementing FB login for our app. For this we want to
detect whether /user/login controller was a redirect from facebook (after
authentication) or a a user noramlly opened /user/login in their browser.
Sometimes FB reidrects to /user/login#_=_ and sometimes to
Dear ALL,
I want to use Facebook and linked in and open iD and the normal auth
form form login and registration , how can i do that and when i use
this things for my website where dose the user register ??
Best Regards,
I just ordered it and saw that it would be available on the 15th. I was
going to order both hardcopy and electronic until I saw that shipping
cost to the US was over $14. I just got the e-version.
-Jim
On 3/12/2012 8:49 AM, bussiere bussiere wrote:
The cookbook is still labelled as pre
The other book would be version 4 of the official manual. Bought it because
I didn't think it would be free online until much later.
On Mon, Mar 12, 2012 at 8:02 AM, Jim Steil j...@qlf.com wrote:
I just ordered it and saw that it would be available on the 15th. I was
going to order both
I had to change my connection string to this:
db_users = DAL('postgres:psycopg2://warplyde_fto:password@localhost
/warplyde_fto')
On Mon, Mar 12, 2012 at 7:23 AM, Richard Vézina ml.richard.vez...@gmail.com
wrote:
Curious if the issue I have with my app coulb become from the new pg8000
Now it could be very easy to pass wrong values using some hacking
techniques by malicious people (inshort hackers) and send wrong information
into the database.
Making your code invisible would not prevent hackers from submitting
invalid values. The reason is that hackers can generate
In digging through the discussions here I've come across two auth methods
that allow for checking a user's authorization:
auth.is_logged_in()
and
auth.has_permission()
These are really useful, but aren't documented in the web2py book (They're
used a couple of times in other recipes, but
Thank for the answer!
But unfortunately for me it's not the origin of my problem it seems.
Richard
On Mon, Mar 12, 2012 at 11:12 AM, Bruce Wade bruce.w...@gmail.com wrote:
I had to change my connection string to this:
db_users = DAL('postgres:psycopg2://warplyde_fto:password@localhost
Thanks
Just as needed for my project.
Bussiere
Les nouvelles technologies offrent pleins de nouvelles possibilités,
pleins de possibilités d'erreurs surtout en fait.
insurance.aes256 : http://goo.gl/gHyAY
On Mon, Mar 12, 2012 at 4:02 PM, Jim Steil j...@qlf.com wrote:
I just ordered it
I think pretty everithing can be find in this chapter if you read it
carefully.
http://web2py.com/books/default/chapter/29/9#Authorization-and-CRUD
Your is_member =
auth.has_membership(group_id, user_id, role)
*
*
*
*
Does it help?
Richard
On Mon, Mar 12, 2012 at 11:34 AM, monotasker
Why are you doing this: auth=Auth(globals(),db) ? globals will not even be
processed it will only look at the first param and set it to db if the db
(second param) doesn't exist.
auth = Auth(db) is how it should be
Also I think this is where your problem is:
auth.settings.table_user = auth_table
Ah . . . you're right. Sorry for not reading more carefully. I think some
of this *has* been documented better since the version 3 book too, which is
great.
Ian
On Monday, March 12, 2012 11:44:01 AM UTC-4, Richard wrote:
I think pretty everithing can be find in this chapter if you read it
Finally you are missing some required fields in your new auth table:
Look at: http://web2py.com/books/default/chapter/29/9#Customizing-Auth to
see the required fields.
On Mon, Mar 12, 2012 at 8:46 AM, Bruce Wade bruce.w...@gmail.com wrote:
Why are you doing this: auth=Auth(globals(),db) ?
auth.has_membership and auth.has_permission are both documented
here: http://web2py.com/books/default/chapter/29/9#Authorization
Anthony
On Monday, March 12, 2012 11:34:11 AM UTC-4, monotasker wrote:
In digging through the discussions here I've come across two auth methods
that allow for
Thanks for your help.
I am developping this app since pretty old version of web2py, I wrote that
2 years ago, so...
I will try the thing you mention and I report back...
On Mon, Mar 12, 2012 at 11:49 AM, Bruce Wade bruce.w...@gmail.com wrote:
Finally you are missing some required fields in
I'm currently running Version 1.99.2 on my Ubuntu Linux server. Is there an
easy way to upgrade to the latest version (1.99.7)?
My web2py installation says Checking for upgrades..., but it never
finishes checking! I presume that if it were to finish checking, there
would be a way to upgrade
I am strongly suggest to you to not updating that way. Or if you do so,
backup your web2py folder before.
What I usually do:
download latest source from download page
backup my staging/prod web2py installation
remove the old installation : cd /home/www-data/ rm -Rf web2py/
Uncompress the new
I do something similar but much much more efficient.
My project is under git version control. When upgraded I create a new
branch, unpack the new version of the code, test, if it didn't break
anything I then switch to the old branch and merge the new branch into it.
This prevents you from have to
PS: I have my git set to an account that can't ssh to my server. Therefor I
have to ssh then switch user to pull/push to my repository.
On Mon, Mar 12, 2012 at 10:11 AM, Bruce Wade bruce.w...@gmail.com wrote:
I do something similar but much much more efficient.
My project is under git version
I tried customizing the form. I have to set the id of the form element to
login.
To achieve the above I used the following statement in controller:
login_form = auth.login()
# Configure form properties
login_form.attributes['_id']='login'
But it's not working. The generated form does not
You could inherit from DAL and overwrite the methods with wrappers that do
the decoding/encoding where needed.
I guess typically only insert, update, select and the constructor have to
be wrapped.
There is also the db_codec keyword argument for DAL constructor defaulted
to utf-8. But I'm
Use Fabric for about the samething, but since Horrido not to use version
control I leave thing basic.
Richard
On Mon, Mar 12, 2012 at 1:12 PM, Bruce Wade bruce.w...@gmail.com wrote:
PS: I have my git set to an account that can't ssh to my server. Therefor
I have to ssh then switch user to
That should work. Can you show the view code? Also, note you can just do:
login_form['_id'] = 'login'
Anthony
On Monday, March 12, 2012 1:19:45 PM UTC-4, Sushant Taneja wrote:
I tried customizing the form. I have to set the id of the form element to
login.
To achieve the above I used the
I want each of my app menu items to have a distinct class to ease theming
(I'm using background images to provide icons in place of text). It looks
like the MENU helper doesn't allow _class arguments in the items in
response.menu. So I can just modify the MENU helper, but am I missing some
way
Hi,
I tried both but none seems to be working. Here's my view code:
div id=formContainer
table
{{=login_form.custom.begin}}
tr
td
colspan='2'{{=login_form.custom.widget.email}}/td
/tr
I think you can do:
(T('my item'), True, A('My item', _href=URL('default', 'index'), _class =
'my_item_class', id = 'my_item_id'), []),
2012/3/12 monotasker scotti...@gmail.com
I want each of my app menu items to have a distinct class to ease theming
(I'm using background images to provide
Hello,
I notice that in the book auth table customisation explication has
changed...
I would like to know if this still good :
auth=Auth(globals(),db)
crud=Crud(globals(),db)
Since in the book it is now just :
auth = Auth(db)
Thank you.
Richard
auth=Auth(globals(),db)
crud=Crud(globals(),db)
The above will still work, but globals() will simply be ignored, as it is
no longer required (instead, the Auth and Crud classes now use the
current object to access the relevant global environment objects).
Anthony
Thanks Anthony.
Richard
On Mon, Mar 12, 2012 at 2:29 PM, Anthony abasta...@gmail.com wrote:
auth=Auth(globals(),db)
crud=Crud(globals(),db)
The above will still work, but globals() will simply be ignored, as it is
no longer required (instead, the Auth and Crud classes now use the
current
What's not working? When you view the HTML code of the rendered page in the
browser, is the id not there, or is it just that some client-side CSS or JS
isn't working as expected? If the latter, the problem could be that you
have put the form beginning and ending code inside the table/table tags
That does it. Great! Was this in the book somewhere?
Ian
On Monday, March 12, 2012 2:08:18 PM UTC-4, Martin.Mulone wrote:
I think you can do:
(T('my item'), True, A('My item', _href=URL('default', 'index'), _class =
'my_item_class', id = 'my_item_id'), []),
2012/3/12 monotasker
Does the example app that comes with web2py show flash/errors correctly on
Firefox 10 + Windows?
If so, it would mean you didn't copy all the required CSS rules or you are
missing a class/id/tag in your layout.
Can you post the parts of your css code that aren't working?
Ian
On Sunday, March 11, 2012 7:39:42 AM UTC-4, frasse wrote:
Hi
I like to use my custom css and add it to my application base.css mess
my application. I have remove base.css and move classes .flash
and .error to my custom
The rendered form is as:
form action= enctype=multipart/form-data method=post
...
/form
It has no attribute id.
On Tuesday, March 13, 2012 12:05:02 AM UTC+5:30, Anthony wrote:
What's not working? When you view the HTML code of the rendered page in
the browser, is the id not there, or is it
I think you can do:
(T('my item'), True, A('My item', _href=URL('default', 'index'), _class =
'my_item_class', id = 'my_item_id'), []),
Yes, in fact, the third item in the tuple can be any HTML helper (which
could include nested helpers), and the MENU helper will simply render that
Hmm, works when I try it. Can you show the full controller code you have
now?
On Monday, March 12, 2012 2:46:57 PM UTC-4, Sushant Taneja wrote:
The rendered form is as:
form action= enctype=multipart/form-data method=post
...
/form
It has no attribute id.
On Tuesday, March 13, 2012
On Monday, March 12, 2012 2:33:44 PM UTC-4, Richard wrote:
Are those also part of current now?
service=Service(globals())
mail = Mail(globals())
Yes for Service; doesn't apply for Mail.
My login is pretty much vanilla Web2py. No changes to default.py
users.
In the model I have this:
comment = ''
if request.controller=='auth_user':
comment = SPAN('Must be at least 12 characters in length',
_style='color:orange;'
)
error_message = '' and error_message = None are treated as the samething.
Try:
error_message = ' '
Haven't tried but that may give you a black message like you want.
On Mon, Mar 12, 2012 at 12:02 PM, Cliff cjk...@gmail.com wrote:
My login is pretty much vanilla Web2py. No changes to
Thanks!
:)
Richard
On Mon, Mar 12, 2012 at 3:01 PM, Anthony abasta...@gmail.com wrote:
On Monday, March 12, 2012 2:33:44 PM UTC-4, Richard wrote:
Are those also part of current now?
service=Service(globals())
mail = Mail(globals())
Yes for Service; doesn't apply for Mail.
Yes the example app that comes with web2py show correctly on
Firefox 10 + Windows.
I greed that I am missing some classes from base.css. but I can not
found what .
Here is what I did.
I copy .flash .error to my css file (the_look.css).
It is the copy code:
-
With all the post arguing about no models... I'm asking myself: why web2py
have models folder if it isn't the best way to do the work? only for
background compatibility?
what's the reason to load the models every time you make a request? is
because the automatic migrations?
are only
agreed
On Mon, Mar 12, 2012 at 12:16 PM, Pepe Araya pepea...@gmail.com wrote:
With all the post arguing about no models... I'm asking myself: why web2py
have models folder if it isn't the best way to do the work? only for
background compatibility?
what's the reason to load the models every
Well I've compiled pypy-1.8 from source (without jit) and found that is
slower than python whyle executing web2py
here are my test results
*PYPY*
ab -n 10 -c 5 http://127.0.0.1:8000/
This is ApacheBench, Version 2.3 $Revision: 655654 $
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
Thanks, Bruce.
Tried that approach, but it still gave me the error div on the form,
though there was no message.
If the password is long enough, I get the standard login failed
message in flash.
If the password is too short, login gives me the red error banner,
even if it's blank.
On Mar 12,
This works.
custom_auth_table.password.requires = CRYPT()
if request.args(0) != 'login':
custom_auth_table.password.requires = [
IS_STRONG(min=12, max=128, upper=None, lower=None,
number=None, special=None, error_message=' '),
CRYPT()
]
Could also be handled in
Hi,
My previous related post:
https://groups.google.com/d/topic/web2py/TxACULvgxik/discussion
Following is my url path structure to access websites for multiple
Organizations (ORG)
http:// domain.com / app / web / site / ORG / args ? vars
I can successfully access the website for DEMO ORG
Maybe related to this: https://bugs.pypy.org/issue1051. Have you tried 1.7?
On Monday, March 12, 2012 3:31:56 PM UTC-4, Francisco Costa wrote:
Well I've compiled pypy-1.8 from source (without jit) and found that is
slower than python whyle executing web2py
here are my test results
*PYPY*
There is discussion about optimization of web2py.
Basically, MVC is correct approach, but the way web2py implement it seems
to make scalling problematic.
Web2py works pretty well for a couples of tables let says 20 to 50 tables,
but behind that the models files become long and since they have to
With models, grid and smartgrid you can prototype an application very
quickly and know that the database works the way it should.
That's the main attraction of these three things, at least for me.
On Mar 12, 3:16 pm, Pepe Araya pepea...@gmail.com wrote:
With all the post arguing about no
Are you sure min form IS_STRONG is apply?
It may be override by the empty CRYPT()??
CRYPT has min_length that could be used for that and if you want to use the
default of auth here you go :
CRYPT(min_length=auth.settings.password_min_length,
error_message=T('too short'))
Richard
Hi!
I was on the page and I tried to update a slice but got the
http://www.web2pyslices.com/admin/default/ticket/init/80.99.230.108.2012-03-12.16-43-41.f19c427c-46c8-4120-a189-29f2707ad6d7
ticket :(
No I suddenly logged out and if I try to log in via google I got the google
page with access
Richard, good question.
Yes, it is working the way I want it to.
On login, if I enter an invalid email or invalid password, I get the
invalid login message. I don't get any messages from either
validator.
Using my hand-built form for changing passwords, if I enter a password
that is too short
Regarding the flash message moving to the side, I believe that the
positioning of the flash div is normally done relative to the auth_navbar
div. (i.e., if I set left:0 for .flash in base.css the flash div is aligned
with the auth_navbar's left-hand margin. So if you have removed auth_navbar
Well I've compiled pypy-1.8 from source (without jit)
wow, how many hours it took?
and found that is slower than python
of course pypy nojit is slower,
no need to compile it by yourself,
you can see that on http://speed.pypy.org/comparison/
On Monday, March 12, 2012 7:46:50 PM UTC, Anthony wrote:
Maybe related to this: https://bugs.pypy.org/issue1051. Have you tried
1.7?
Nop, i've tried the last source from bitbucket
On Monday, March 12, 2012 8:36:35 PM UTC, Vasile Ermicioi wrote:
Well I've compiled pypy-1.8 from source (without jit)
wow, how many hours it took?
1h30m
and found that is slower than python
of course pypy nojit is slower,
no need to compile it by yourself,
you can see that on
I followed your instructions, but when I try to access admin/default/index,
I get the following error message:
admin disabled because unable to access password file
So apparently your instructions are incomplete. All I'm trying to do is
update my production system as easily as possible. I
Hi,
I found a workaround to the problem. I need to assign the id login to the
form so that certain CSS and JS can be applied to the form elements. Since
I was unable to assign id to the form, I assigned the id login to the
table element. The login is now working.
But another problem has
I found a workaround to the problem. I need to assign the id login to
the form so that certain CSS and JS can be applied to the form elements.
Since I was unable to assign id to the form, I assigned the id login to
the table element. The login is now working.
Ah, I forget that
1 - 100 of 133 matches
Mail list logo