try this :
,links = [lambda row:
A(
SPAN(_class='icon magnifier')
,'View Post'
,_class='button',_title='View Post'
,_href=URL(args=["view", db.person, row.id])
)
]
On Monday, November 21, 2011, Rahul wrote:
> Hi Johann,
> That is correct but I just wanted
I am pretty sure the error is not the code you showed us. You are
somwhere assigning something to =T(...) where it expects a string.
On Nov 21, 11:30 pm, Adrian Edwards wrote:
> Hello,
>
> I'm having difficulty getting inserts to work with tables that have
> references and I'm sure its something
Hello,
I'm having difficulty getting inserts to work with tables that have
references and I'm sure its something stupid I'm doing wrong.
Hopefully you guys can point me in the right direction.
I have the following 2 tables.
db.define_table('event_users',
Field('event', 'reference events'),
Thanks Massimo. I hadn't included the error handling bit.
db[the_table] works! Thanks Bruno.
I am bit lost in this thread. Can you summarize the issue?
On Nov 21, 7:55 pm, villas wrote:
> Yes, that's a good idea and it does seem to work.
> On the downside, I have a huge number of fields and I think the query will
> still fetch them all. Also I have to make a very long list of
> field.r
As Bruno suggested:
def add():
tablename = request.args[0]
if not tablename in db.tables(): error() # or other set of allowed
tables.
form = SQLFORM(db[tablename])
On Nov 21, 8:49 pm, monotasker wrote:
> I'm trying to abstract several content creation controllers into one
> controlle
What do you mean does not work properly? What do you see, what do you
get?
On Nov 21, 6:12 pm, villas wrote:
> Why doesn't the as_list() seem to work when fields have been specified?
>
> Try this:
>
> >>>db(db.table.id == 1).select().as_list() #works fine
>
> Now this:>>>db(db.table.id == 1).s
try
db[the_table]
http://zerp.ly/rochacbruno
Em 22/11/2011 00:49, "monotasker" escreveu:
> I'm trying to abstract several content creation controllers into one
> controller. I want to use request.args[0] to set the db table in which the
> new row will be created. So far I've got this:
>
> def a
I'm trying to abstract several content creation controllers into one
controller. I want to use request.args[0] to set the db table in which the
new row will be created. So far I've got this:
def add():
the_table = request.args[0]
tb = "db.%s" % the_table
form = SQLFORM(tb)
but I'm g
can't remember the symptions, but when using the bulk load option for
appconfig to upload/download data i have had to do the following:
#/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appse
IS_IN_SET and IS_IN_DB only produce dropdown widgets when they are not
within a list of validators. The book mentions this for IS_IN_DB, but not
for IS_IN_SET.
Anthony
On Monday, November 21, 2011 9:27:35 PM UTC-5, villas wrote:
>
> After giving it a little more thought, I suppose the solution
Yes, we should probably come up with a better solution.
On Monday, November 21, 2011 8:55:57 PM UTC-5, villas wrote:
>
> Yes, that's a good idea and it does seem to work.
> On the downside, I have a huge number of fields and I think the query will
> still fetch them all. Also I have to make a v
After giving it a little more thought, I suppose the solution is to use an
onvalidation function.
However, it is still worthy of mention that something in the book does not
seem to provide an expected result.
Yes, that's a good idea and it does seem to work.
On the downside, I have a huge number of fields and I think the query will
still fetch them all. Also I have to make a very long list of
field.readable = False.
So, if a better solution appears, I would be very grateful.
However, in any cas
This example is given in the validators section of the book:
requires = [IS_INT_IN_RANGE(0, 8), IS_IN_SET([2, 3, 5, 7],
error_message='must be prime and less than 10')]
It does not seem to work. If I attempt to combine IS_IN_SET with any
other validator, the dropdown list doesn't work.
On Monday, November 21, 2011 5:08:18 PM UTC-5, villas wrote:
>
> Hi Anthony,
>
> Nearly got it! That was certainly helpful.
>
> I can show a VirtualField with your lambda idea, but only when I don't
> specify fields=(...).
>
Hmm, I'm not sure why that is. What if you don't specify any fields b
Why doesn't the as_list() seem to work when fields have been specified?
Try this:
>>>db(db.table.id == 1).select().as_list()#works fine
Now this:
>>>db(db.table.id == 1).select(db.table.id,db.table.x).as_list()
#doesn't work properly with fields
Am i missing something? I think as_dict()
Please try the nightly build and let me know.
On Nov 21, 10:07 am, Matt wrote:
> On Nov 13, 10:54 am, Massimo Di Pierro
> wrote:
>
> > I think this should be be fixed in both stable and trunk.
>
> I am still seeing this error with 1.99.2, should it have been fixed
> there?
>
>
>
>
>
>
>
> > On N
If you use the web2py binary distribution it comes with its own
python. It does not install it. It stays in the web2py folder. It is
like a portable version of python. If you wish you use your existing
python version, you must run from source.
On Nov 21, 5:06 pm, Robert Shaver wrote:
> I am havin
Your patch is good (for pam and other methods that allow the app to
handle the password) and it is in trunk
On Nov 21, 3:35 pm, Matt Broadstone wrote:
> On Mon, Nov 21, 2011 at 3:25 PM, Massimo Di
> Pierro wrote:
> > Good point. Basic auth may not work with PAM. Please open a ticket.
>
> OK, iss
yes. this was fixed the same day.
On Nov 21, 10:24 am, Matt wrote:
> has this patch made it into the codebase? I'm looking at my checkout of
> 1.99.2 and it doesn't seem to be there (and trunk as well, from the looks
> of it). Of course, it may have been written differently, I was only
> checking
I am having exactly the same problem. I'm on Windows 7 64 bit. I searched
my disk for Python and found 6,647 occurrences of the word. From the
various names on the files I believe that I have versions 2.5, 2.6.1 and
2.6.6 as a result of installing web2py, OpenOffice, InkScape and Blender.
So wh
Hi Anthony,
Nearly got it! That was certainly helpful.
I can show a VirtualField with your lambda idea, but only when I don't
specify fields=(...).
Unfortunately this means that I have to show every single field in the
table, which isn't practical.
I tried to include fields(..., db.tabl
On Mon, Nov 21, 2011 at 3:25 PM, Massimo Di Pierro
wrote:
> Good point. Basic auth may not work with PAM. Please open a ticket.
>
OK, issue created: http://code.google.com/p/web2py/issues/detail?id=532
Also, in the comments section I've included a patch to allow PAM
authentication. As I note in t
Does anyone know anything about this problem?
On Fri, Nov 18, 2011 at 12:33 AM, Vinicius Assef wrote:
> I'm making some tests with Auth and I'm facing one problem.
>
> This is my controller: http://pastebin.com/CNigd5qL
> I have a normal login form in default/index
>
> I'm following this flow:
>
Good point. Basic auth may not work with PAM. Please open a ticket.
On Nov 21, 1:26 pm, Matt Broadstone wrote:
> Is it possible to use PAM for basic auth? I have basic auth working
> (thanks to Hong-Khoan Quach's patch), however I can't seem to link it
> to PAM. We are using PAM successfully for
I will take a patch
On Nov 21, 11:27 am, Vinicius Assef wrote:
> How about including this function in Auth?
>
> --
> Vinicius Assef.
>
>
>
>
>
>
>
> On Mon, Nov 21, 2011 at 10:43 AM, VIREN PATEL wrote:
> > Hi Bruno,
>
> > Thanks a lot that was really helpful and solved mine and Shiv problem
>
>
Tried to install appliance "Email Form" but "Unauthorized" message - what
is wrong?
Exactly - I needed to go everywhere and change to lowercase. But it works
now.
Is it possible to use PAM for basic auth? I have basic auth working
(thanks to Hong-Khoan Quach's patch), however I can't seem to link it
to PAM. We are using PAM successfully for web based user
authentication, but basic auth seems to be ignoring this.
Thanks,
Matt
Using the method at
http://groups.google.com/group/web2py/browse_thread/thread/641df72d9f897b1b/31f7a52cfcbdb7da?lnk=gst&q=google+authentication+GAE#31f7a52cfcbdb7da
on 1.99.2, I am getting "redirect loop" error in the browser:
This webpage has a redirect loop
The webpage at
http://localhost:8080
Thank you! Good to know that it's an existing limitation rather than an
overlooked bug. If that would be in the book, it will save time trying to
figure out what's wrong.
Dmitry
That actually works! Many thanks for the suggestion. I wish that could be
in the book if that's the recommended approach.
Dmitry
For me it does not works wit Uppercase app name even in rocket server.
maybe as a static method ( I did not tested, but may works
On Mon, Nov 21, 2011 at 3:54 PM, Dmitry Vukolov wrote:
> class MyVirtualFields(object):
> def total_price(self):
> return self.support_function(self.item.unit_price,
> self.item.quantity)
@*staticmethod*
def sup
That is one the restrictions when working with keyed tables.
Here are the original notes (see #5):
1) primarykey is a list of the field names that make up the primary
key
2) all primarykey fields will have NOT NULL set even if not specified
3) references are to other keyed tables only
4) referenc
In the Official web2py Book I read about DAL's Virtual Fields that:
"...each method of the class that takes a single argument (self) is a new
virtual field."
It seems however that any function of the class is treated as a new field
and called to calculate its value. As an example I added a supp
On Monday, November 21, 2011 7:06:25 AM UTC-5, villas wrote:
>
> Massimo,
>
> I tried the expressions, but it did not seem to work. Could you consider
> providing an example so we could get that working?
>
> I would be delighted if VirtualFields could be displayed. Do you think
> that this
When using trunk and to work on GAE I needed to rename
my app and all internal references to it to lowercase.
In my application which is hosted on GAE I have backup/restore
functions which use export_to_csv_file/import_from_csv_file.
While this is not a practical backup/restore for GAE (restore would
take far too long and timeout, so for this purpose I use GAE bulk
loader tool), I have used it in the past
Is the problem on GAE only? Do you also get the problem when running with
dev_appserver?
Greetings!
I seem to be having a problem using DAL with legacy databases, namely those
without an existing AUTO_INCREMENT field:
db.define_table('manufactured_by',
Field('product', 'string'),
Field('brand', 'string'),
primarykey=['product', 'brand'])
With a similar setup the update(
On Monday, November 21, 2011 10:38:27 AM UTC-5, thodoris wrote:
>
> 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" en
How about including this function in Auth?
--
Vinicius Assef.
On Mon, Nov 21, 2011 at 10:43 AM, VIREN PATEL wrote:
> Hi Bruno,
>
> Thanks a lot that was really helpful and solved mine and Shiv problem
>
> Thanks,
> Viren
>
> On Mon, Nov 21, 2011 at 5:35 PM, Bruno Rocha wrote:
>>
>> Create this
I ended up creating a virtualenv with the needed libraries within the
modules folder and using the virtualenv python binary to execute the
script within the web2py environment. I feel it's a bit hackish, but
I'll clean it up in the future.
What I do find interesting is that the script is actually
has this patch made it into the codebase? I'm looking at my checkout of
1.99.2 and it doesn't seem to be there (and trunk as well, from the looks
of it). Of course, it may have been written differently, I was only
checking for the exact strings
On Nov 13, 10:54 am, Massimo Di Pierro
wrote:
> I think this should be be fixed in both stable and trunk.
>
I am still seeing this error with 1.99.2, should it have been fixed
there?
> On Nov 12, 10:38 am, Tito Garrido wrote:
>
>
>
>
>
>
>
> > Is it already fixed?
>
> > On Thu, Sep 22, 2011 at
Thanks, Anthony.
On Mon, Nov 21, 2011 at 1:09 PM, Anthony wrote:
>> But, according to your define_table()'s, these tables can only be
>> managed (insert or update) with a logged user, or default contents
>> will raise an excpetion because there's no logged user.
>
> The defaults won't raise an ex
Hi Rob,
what webserver are you running right now?
Kenneth
Hi Phyo,
Thanks for your response.
My current environment is a dedicated server machine with a single web
server which servers multiple web separate sites on sub-domains and
dedicated IP addresses. The configuration at this level h
On Monday, November 21, 2011 10:05:02 AM UTC-5, Robert Shaver wrote:
>
> I guess I misread something. I thought I could download web2py and install
> it with a built-in web server ... Rocket I think was the name. (I haven't
> researched Rocket yet.) Are you saying that these features are addresse
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 wrote:
> > But, accordi
Hi Phyo,
Thanks for your response.
My current environment is a dedicated server machine with a single web
server which servers multiple web separate sites on sub-domains and
dedicated IP addresses. The configuration at this level has always been
handled by an administrator so I know less about
Ok, now that this works seems I'm still in trouble.
The page I'm loading is one that has a table that I'm trying to make
clickable and a form to enter more data.
Here is the controller:
@auth.requires_login()
def budget():
db.expense.parent_table.default = request.args(0)
db.expense.categ
>
> But, according to your define_table()'s, these tables can only be
> managed (insert or update) with a logged user, or default contents
> will raise an excpetion because there's no logged user.
>
The defaults won't raise an exception (as long as auth is defined prior to
the table definitions),
Dear Massimo,
Thank you for your quick response. I heard your interview on FLOSS Weekly
and that's how I discovered web2py.
I guess I misread something. I thought I could download web2py and install
it with a built-in web server ... Rocket I think was the name. (I haven't
researched Rocket yet
>
> db.videos.table.requires = IS_IN_DB(db(db.table.author_id==auth.user.id),
> db.table.id, '%(title)s')
>
Maybe db(db.table.author_id == (auth.user and auth.user.id))
That will return no records when there is no auth.user.
Anthony
On 21 nov, 07:45, Tom Campbell wrote:
> I would avoid this by putting Python on the path, then web2py
> somewhere outside of Program Files, which I would claim is bad form
> anyway. Like a web2py directory off root, maybe? I can post a little
> tutorial for a manual Windows install of web2py il
On Mon, Nov 21, 2011 at 12:41 PM, thodoris wrote:
> Two questions:
>
> and i want the videos.table field to take values only from the entries
> that the same user has entered or Null
>
> NoneType' object has no attribute 'id' , because the user initially is
> not logged in so there is no auth.user
Thanks,
you guys rock community support.
Two questions:
I have the following scheme:
db.define_table('table',
Field('title'),
Field('author_id', default=auth.user_id,readable=False,
writable=False),
...
)
db.define_table('videos',
Field('author_id',default=auth.user_id,readable=False,
writable=False),
Field('table',
yes. in gluon/dal.py
TIMINGSSIZE = 100
That means we only store up to 100 queries. You will see the memory
grow bot only up to a point. You can also decrease the number:
import gluon.dal
gluon.dal.TIMINGSIZE = 20
On Nov 21, 4:10 am, szimszon wrote:
> Is that fixed already?
Thanks to Anthony, this is an important fix that will speed up a lot
complex apps.
On Nov 21, 3:03 am, Ids wrote:
> Checked it just now with Version 1.99.3 (2011-11-20 21:10:53) dev
> Everything now works ok, no more unnecessary database queries from
> auth decorators. Thanks
>
> On Nov 19, 9:37
Rahul, this is a str.split() error and it happens when there are less
pieces than str.split() expects.
An example:
>>> fullname = 'John Smith'
>>> (first_name, last_name) = fullname.split(" ")
>>> print 'first:', first_name, '- last:', last_name
John - Smith
>>> fullname = 'John'
>>> (first_name,
Ok, I'll now follow the web2py book, something I should have done
to start with :-/
I'm trying to install web2py as a windows 7 service and used an options.py file
as described in the book.
But it fails to install, it says (in dutch: Error installing service:
Access denied. (5))
web2py>web2py.exe
On Mon, 2011-11-21 at 04:48 -0800, Rahul wrote:
> my model (db.py)-
>
> db.define_table('updates',
> Field('description', 'text'),
> Field('updated_on','date', readable=False,
> writable=False, default=now),
> Field('posted_by', readabl
The ['id'] middle arg of the ajax function works only with forms, and it
looks for the name attribute in form inputs for check its val().
your code needs to be something like this:
{{extend 'layout.html'}}
*
$(document).ready(function () {
$('.row').click(funtion(){*
* ** ajax('ech
Hi All,
Is there a solution for below traceback I posted (I am on 1.99.2,
win7, firefox,ie9). Tried search for a solution in below thread .. no
help ...
http://groups.google.com/group/web2py/browse_thread/thread/fc4a30879f5590e/59d060e8ded6eae0
Traceback
1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.1
Hi Bruno,
Thanks a lot that was really helpful and solved mine and Shiv problem
Thanks,
Viren
On Mon, Nov 21, 2011 at 5:35 PM, Bruno Rocha wrote:
> *Create this function in some model*
> *
> *
>
>> *def new_user(first_name, last_name, email, passw):
>> **users = db(db.auth_user.email==
Rahul, it is a very good thing that you are trying to pull all this info
together. I am sure it will help the documentation effort. Thanks.
Massimo,
I tried the expressions, but it did not seem to work. Could you consider
providing an example so we could get that working?
I would be delighted if VirtualFields could be displayed. Do you think
that this would be possible?
Regards,
David
*Create this function in some model*
*
*
> *def new_user(first_name, last_name, email, passw):
> **users = db(db.auth_user.email==email).select()
> **if users:
> **return users[0].id
> **else:
> **my_crypt = CRYPT(key=auth.settings.hmac_key)
> **
Hi Vincenzo,
The folder to which you need write permission is
/path/to/web2py/applications/yourapplication/errors
Note that uwsgi may run as a different user to Cherokee.
I use Cherokee with Web2Py & keep my installation notes here:
http://eden.sahanafoundation.org/wiki/InstallationGuidelinesChe
Hi,
I want to import the user details from XL file and register in the
user_auth table.
If you can share info on how to register the users programmatic way, it
will be of great help.
Thanks & Regards
Shiv
Thanks for sharing Information.
I have used Tornado, Gevent and socket.io and its working fine.
Best Regards
Shiv
On Fri, Nov 18, 2011 at 9:01 AM, Matt Gorecki wrote:
> I am able to send socket.io events with this code:
> https://gist.github.com/1375505
>
> It's based off an answer I found on S
Hey All,
I have added a slice for SQLForm.grid in web2py slices. I hope it
is of help to everyone starting up with it.
Slice#148 (May be it needs proper formatting)
http://www.web2pyslices.com/slices/take_slice/148
Villas, I have added the SQLForm.grid syntax derived from your code
thread pr
I think repeats=0 is not working, try with another value like 999, 99
2011/11/21 Manuele
> **
> Hi,
> I'm using web2py version 1.99.2 with the new scheduler. I have a scheduled
> function that is run once a day at the same time with this parameters:
>
> Start Time: 2011-11-10 01:30:00
>
Is that fixed already?
Hi!
Is it OK that if I type something in autocomplete field then TAB to the
suggestions then hit ENTER but nothing is changed in the field? It is not
completed.
Tnx.
Hi
I just downloaded web2py package on a ubuntu server and i set up with
cherokee + uwsgi. The uwsgi connection string is
> /usr/local/bin/uwsgi -s 127.0.0.1:43658 -M -p 8 -z 15 -L -l 128
> /var/www/argomenti.in/web2py/wsgihandler.py --pythonpath
> /var/www/argomenti.in/web2py
>
When i try to
There is this important rule that all programers must respect: write code
YOU can understand.
Khalil
Hi,
I'm using web2py version 1.99.2 with the new scheduler. I have a
scheduled function that is run once a day at the same time with this
parameters:
Start Time: 2011-11-10 01:30:00
Next Run Time: 2011-11-22 01:30:00
Stop Time:2020-01-01 00:00:00
Repeats:0
Period:
Checked it just now with Version 1.99.3 (2011-11-20 21:10:53) dev
Everything now works ok, no more unnecessary database queries from
auth decorators. Thanks
On Nov 19, 9:37 am, Ids wrote:
> Ok. Will try it monday when I get back to work and have access to a computer
> with web2py.
When routes.py is the pattern based system,
it works locally, but uploading to the GAE
cannot find the icons, stylesheets, etc.
On the server I see the massage:
select routing parameters: BASE
Hi all,
I'm trying to have a ajax callback function whenever I click a certain row.
I'd like that row to return the id of the record the row represents.
I'm at loss as to the middle argument for the ajax function. I checked the
function in the controller gets called but the argument is wrong.
I
85 matches
Mail list logo