Hello,
I have come uppon the following. If i declare the following field
Field('test', notnull=True,
requires=IS_IN_SET([1,2,3,4],multiple=False),widget=SQLFORM.widgets.checkboxes.widget),
The expected behaviour should be to be able to select only one checkbox.
What is happening is that i am
I have a query that returns many (45) results and i want to l present
10 rows per page and have links at the bottom with the page numbers
(1,2,3,4,5 and maybe a button next or previews). How can i implement
this in web2py?
Thnx
I set the auth.settings.expiration time but the user is not automatically
logged out after the specified time
I have tried setting
auth.settings.expiration = 1
in db.py after before calling
auth.define_tables()
Thanks for your answers guys. I have another question related to this topic.
Say i want to reference an authorized user instead of a person table:
db.define_table('cat',
Field('name'),
Field('owner', db.auth_user,
default=auth.user_id,readable=False,writable=False),)
So that the
I have a field
Field('uUser2', db.auth_user, default=auth.user_id),
at some moment i added ondelete=CASCADE
later i changed it to ondelete=NO ACTION
but when i checked my db i had
KEY `rUser2__idx` (`ruser2`),
CONSTRAINT `sounds_ibfk_1` FOREIGN KEY (`ruser`) REFERENCES `auth_user`
What do you mean handle it in application logic? How/when do i detect from
my app that a user has been deleted?
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
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.
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
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...
I am trying to migrate users from phpBB whose passwords have been encrypted
with php_pass. There is a python module that mimics the functionality of
php_pass and i am wondering what is the best way to override the default
encryption of web2py.
Is it sufficient to override CRYPT() using
My compliments as well to both Massimo and all contributors.
Keep up the good work guys!
Thodoris
On Dec 7, 9:08 am, chandrakant kumar k.03chan...@gmail.com wrote:
Programmers don't get the glory they deserve,http://goo.gl/yRJbR.
On Wed, Dec 7, 2011 at 12:34 PM, Vineet vineet.deod
I have found myself doing multiple times in my views:
{{if auth.user:}} # checking that a user in logged in and
{{if auth.user.id == my_table.author_id:}} # if he is the author of a
table entry
SHOW SOMETHING ONLY TO THE AUTHOR OF THIS TABLE
{{pass}}
{{pass}}
I am thinking that
I am trying to use the LOAD component and i have some questions. I
would like to pass an argument to the LOAD function which is a table
row but it is converted to a string and i can't access the row
attributes. There is a way to pass them by value but i would prefer to
pass the row instead (or a
= table.like + 1
table.update_record(like=like)
# something here ??
Thanks for all the help
On Dec 6, 11:22 am, thodoris pasxi...@gmail.com wrote:
I am trying to use the LOAD component and i have some questions. I
would like to pass an argument to the LOAD function which is a table
I didn't know about the callback argument. Thanks a lot for the tip.
In the above case then it is not necessary then.
I was going to use something quite complicated for something simple.
Is it possible for the callback to affect multiple fields, or else
what happens if there are fields with the
...
if s == 1:
return something
elif s == 2:
return something else
else:
session.flash = Message
return ???
Is this possible???
On Dec 6, 4:12 pm, Anthony abasta...@gmail.com wrote:
On Dec 6, 9:49 am, thodoris pasxi...@gmail.com wrote:
I didn't know about
I have the following
featured = (0,1,2,3,4,5)
Field('rank','list:integer',requires=IS_IN_SET(featured, zero='rank'),
readable=False, writable=False),
So this field can only be set from appadmin and is set by default to
[] when a record is made, IIUC.
I want to select the tables that have been
Is there any way to keep the value that was inserted on an upload
field after failing to validate the form due to another field, so that
the user doesn't have to search for the file again?
I have this field
db.define_table('B',
Field('my_table', db.A, notnull=False, ondelete=SET NULL),
db.B.my_table.requires = IS_EMPTY_OR (
IS_IN_DB(db(db.A.author_id==auth.user_id),
db.A.id, '%(title)s'))
That means that my_table can have references from A but only the
Is there a way to change the submit button into clickable text (like
an _href) next to a field?
Lets say i have this form:
form = SQLFORM.factory(Field('my_table'))
I found the solution myself
In order to save the change i have to use: update_record
On Nov 30, 12:07 pm, thodoris pasxi...@gmail.com wrote:
I have this field
db.define_table('B',
Field('my_table', db.A, notnull=False, ondelete=SET NULL),
db.B.my_table.requires = IS_EMPTY_OR
Is there a way to change the submit button into clickable text?
Lets say i have this form:
form = SQLFORM.factory(Field('my_table'))
and i can do
table = form.element() to get the element
table.append(INPUT(_type='submit', _value='submit')): this appends the
submit button next to the
Hello,
Simple question:
auth.user.id returns an integer
but if i define a field in a table:
Field('author_id', default=auth.user_id)
author_id is a string
and if i want in a later step to compare these values it doesn't seem
good tactic to do str(auth.user.id)
Hello,
I have this Field
Field('cover','upload',notnull=False,autodelete=True),
When the form is displayed you click on browse you can select the
file. But once a file is selected you cannot undo your choice. There
is always the choice to reload the page that holds the form and clean
the field
in that string field
and delete the filename. As an alternative, I suppose you could add a
button/link with some Javascript that automatically clears the field when
clicked.
Anthony
On Tuesday, November 29, 2011 10:18:32 AM UTC-5, thodoris wrote:
Hello,
I have this Field
Field
where can i update the response.headers before form.accepts returns
True?
Because i guess that if i update it after form.accepts returns then
the response has already been sent.
Thodoris
I want to do the following:
I want to add a key to response.headers
response.headers['success']='True'
after a successful file upload and also redirect.
The problem is that i also want to redirect after successful upload
but redirect makes a new reasponse.headers and i lose the key i want
to
On Monday, November 28, 2011 8:15:02 AM UTC-5, thodoris wrote:
I want to do the following:
I want to add a key to response.headers
response.headers['success']='True'
after a successful file upload and also redirect.
The problem is that i also want to redirect after successful upload
I have a form that has an upload field.
If i add a cancel button to the form that for example redirects to
'index' the cancel is stopped but what if i wanted to cancel the
upload from an app??
I am asking this cause i am uploading a file from an iphone app to the
database but when i cancel that
I have a form that has an upload field.
The file can be big and i would like to add a cancel button to cancel
the upload.
If i add a cancel button to the form that for example redirects to
'index' the cancel is stopped but what is the logic behind it. Is some
value returned and the form fails??
']['success']=True
Thodoris
the user initially is
not logged in so there is no auth.user.id
How can i solve this?
Second question, if the user had entered a lot of entries which is the
best way to display the dropdown list of tables???
Thodoris
Thanx for the help guys, what i did finally is
db.videos.table.requires = IS_EMPTY_OR
(IS_IN_DB(db(db.table.author_id==auth.user_id), db.table.id, '%
(title)s'))
What about displaying a BIG dropdown list of tables entries? Any
help here ???
On Nov 21, 4:09 pm, Anthony abasta...@gmail.com
Hello,
I have a text field in my db with a default instructive text like
Enter your comment here, but i would like when the user tries to
input text, the default text to disappear without having to delete it
manually
UTC-5, thodoris wrote:
Hello,
I have a text field in my db with a default instructive text like
Enter your comment here, but i would like when the user tries to
input text, the default text to disappear without having to delete it
manually
i use is called Replenish (http://web2py.com/
layouts/static/plugin_layouts/layouts/Replenish/index.html).
Thodoris
Hello,
i would like to do the following but i am not sure how to do it.
I want to define a field like
rank = (0,1,2,3,4,5)
Field('rank','list:integer',requires=IS_IN_SET(rank)),
but i would like to implement the restriction that if for example 1 is
already set, it won't appear in the list.
I want to do the following
def some_function():
a = ...
b = ...
if auth.is_logged_in():
c = ...
else:
c = None
return (a=a,b=b,c=c)
And in the view some_function.html
{{if c is not None:}}
do something here
{{pass}}
which is the best practice to do it?
There is nothing wrong, i just want to know if this is a clean way
to do what i do above or there is a better way.
Thodoris
On Nov 15, 1:26 pm, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
Whats wrong in what you just described?
{{if c != None:}}
Kenneth
I want to do
in.
Also, do you need to do something with the value of c in the logged in
case? If not, then just test for a logged in user directly in the view.
{{if auth.user:}}
Anthony
On Tuesday, November 15, 2011 7:37:10 AM UTC-5, thodoris wrote:
There is nothing wrong, i just want to know
Hello,
I am trying to integrate the Janrain Social Widget to my project.
For the moment i have user authentication with Janrain but i am having
problems adding the Social Widget.
The instructions from Janrain say:
1) Download the rpx_xdcomm.html file and place it in the root
directory of your
/#!topic/web2py/CDHOUqtICn8
I executed the setup-web2py-ubuntu.sh script and the everything works
ok from the webpage.
What i want to do is upload a file using curl.
If i don't use authentication, using the following command the file is
uploaded:
curl -F file=@/home/thodoris/Documents
Hi,
I have tested the patch against 1.99.2 stable version of web2py and it
works.
auth.settings.allow_basic_login=True has to be set in order to be able to
upload files using curl.
Thodoris
Yes it is related and there is a patch for this. More details on the
above link.
On Oct 28, 2:27 pm, szimszon szims...@gmail.com wrote:
Could be related:https://groups.google.com/forum/#!topic/web2py/lLCCUrwB5x0
using
curl. But i would like apply the authentication restriction. So i
register a user with username: t...@nowhere.com and password: and
i try the following command
curl --verbose -u t...@nowhere.com: -F file=@/home/thodoris/
Downloads/test.rtp -F _formname=files/None
http://127.0.0.1:8000
Hi, i have come across the same problem. Do you have any idea when will the
patch be included in a realease?
Hi Hong-Khoan,
Sure, send it to me and i will try it.
Regards,
Thodoris
application that is written in C++ to the web server. I am new to
web2py so i would appreciate any advice.
Thodoris
Hi,
I am wondering what is the best way to count how many times a file has
been downloaded. I have the following:
db.define_table('image',
Field('file', 'upload'),
Field('downloads','integer', default=0,readable=False,
writable=False))
I have a view that has the following:
{{=A(Download,
On Thursday, October 27, 2011 11:39:22 AM UTC-4, thodoris wrote:
Hi,
I am wondering what is the best way to count how many times a file has
been downloaded. I have the following:
db.define_table('image',
Field('file', 'upload'),
Field('downloads','integer', default=0,readable=False
51 matches
Mail list logo