[web2py] Re: DAL has not attribute db when field is a reference to another table

2014-03-06 Thread PN
Problem found and fixed - it was in my own code. I was using the wrong format to reference another table, changed it to match what is specified in the web2py book and all is well. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Sourc

[web2py] Re: DAL has not attribute db when field is a reference to another table

2014-03-06 Thread PN
On further digging, I see that this set of lines - around 2018 in dal.py were changed from a much simpler version that did not use self.db. However, I still don't see why the code throws a self.db error on line 2018, instead of in, say a few lines about it when the code again references self.db

[web2py] DAL has not attribute db when field is a reference to another table

2014-03-06 Thread PN
When I use a query which uses a reference type field, I get the error: 'DAL' object has no attribute 'db' In my code below, db.Units.site_id is a reference field. The error only happens when I use this field and not on other fields of the table. The relevant traceback seems to be: File "C:

[web2py] Re: I'm speaking at Melbourne PUG about web2py, 30 mins. Tips/e.g. slides?

2014-03-06 Thread samuel bonill
would be great to talk about admin-plus (A-PLUS) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received

[web2py] Re: Nested SQLform.factory

2014-03-06 Thread Anthony
Again, you can't use SQLFORM.factory just to insert a single input into a form -- it creates a whole form of its own. If you want to make use of the IS_IN_DB validator to build the options for a SELECT widget, you can do something like: SELECT([OPTION(v, _value=k) for k, v in IS_IN_DB(d

[web2py] wcscpy_s error back in 2.9.4 release

2014-03-06 Thread mkerins
I just downloaded version 2.9.4 onto a Windows XP Professional Service Pack 3 machine and get the error "The procedure entry point wcscpy_s could not be located in the dynamic link library msvcrt.dll" when I execute web2py.exe -- Resources: - http://web2py.com - http://web2py.com/book (Document

Re: [web2py] Re: recaptcha doesn't work in a component (LOAD)

2014-03-06 Thread Tim Richardson
On Friday, 7 March 2014 03:22:56 UTC+11, Paolo Valleri wrote: > > I agree with lightdot, the parameter is redundant. > Mind that recaptcha library is splitted into two files, the first one > (challenge) internally load a second one (recaptcha_canary.js). You made > the former to be loaded with

[web2py] Re: how to get scheduler_run.id for reporting after setting task via scheduler.queue_task()

2014-03-06 Thread Tim Richardson
book PRs go into a bit of holding pattern anyway. I should test it, I normally do before a PR but I admit not yet for this (although it's great functionality and I will easily justify testing it). On Friday, 7 March 2014 04:11:24 UTC+11, Niphlod wrote: > > did not test it yesterday but hopefully

[web2py] Re: I'm speaking at Melbourne PUG about web2py, 30 mins. Tips/e.g. slides?

2014-03-06 Thread Tim Richardson
inspire9, Richmond (next to Richmond station) http://www.meetup.com/Melbourne-Python-Meetup-Group/ On Friday, 7 March 2014 09:20:47 UTC+11, Simon Ashley wrote: > > Where's it being held? >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/we

[web2py] Re: Can I specify a display name in emails sent via auth.settings.mailer?

2014-03-06 Thread User
Anyone? On Wednesday, February 5, 2014 6:26:01 PM UTC-5, User wrote: > > I would like the from address of automated emails for user registration, > retrieve password, etc to have a display name. How can I do this? > > Currently my mailer is defined similar to: > > mail = auth.settings.mailer > m

[web2py] Re: Nested SQLform.factory

2014-03-06 Thread xgp . latino
Hi all, and thanks for your replies. I intent to use the sqlform.factory to create dropdown list from DB data as inputs for a form. Why.? Because i want to use predefine values store on DB as a list for dropdown. The form actually works as view, but only the 1st input value of the 1st dropdown

[web2py] I tried to implment Redis-queue by going over Bruno's slice and it is giving me an error.

2014-03-06 Thread Kenneth
I went over http://www.web2pyslices.com/slice/show/1579/web2py-and-redis-queue and seems like it's giving me an error when I tried to dequeue all the tasks which are sending emails --- 23:06:12 UnpickleError: (*'Could not unpickle.', ImportError('No module named gluon.tool

[web2py] Re: I'm speaking at Melbourne PUG about web2py, 30 mins. Tips/e.g. slides?

2014-03-06 Thread Simon Ashley
> > Where's it being held? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "

[web2py] Re: How to post a request to a web api

2014-03-06 Thread Anthony
And for GET requests, you can also use the simpler web2py fetch function: http://web2py.com/books/default/chapter/29/14/other-recipes#Fetching-an-external-URL. Anthony On Thursday, March 6, 2014 11:44:58 AM UTC-5, Leonel Câmara wrote: > > You dont have the requests module. It's available in pyt

[web2py] Re: Nested SQLform.factory

2014-03-06 Thread Anthony
SQLFORM.factory generates an entire HTML form, not just an individual field. I suppose you could extract an individual input element from the form (via the server side DOM), but you might as well just use the INPUT() helper in that case. Why are you trying to use SQLFORM.factory there rather th

[web2py] Re: how to get scheduler_run.id for reporting after setting task via scheduler.queue_task()

2014-03-06 Thread Niphlod
did not test it yesterday but hopefully it works as documented :P On Thursday, March 6, 2014 6:51:02 AM UTC+1, Tim Richardson wrote: > > > > >> That's because when you queue a task you don't have (yet) a scheduler_run >> record. Moreover returning the result of the task to a "queueing" operation

[web2py] Re: session not recognising membership

2014-03-06 Thread Niphlod
Seem to recall that groups are only added to session at the login time (i.e. if you login, then add membership, you won't find them in session). Did you try to logout and login ? On Thursday, March 6, 2014 10:30:16 AM UTC+1, Johann Spies wrote: > > What can cause session on my server to not reco

[web2py] Re: How to post a request to a web api

2014-03-06 Thread Leonel Câmara
You dont have the requests module. It's available in python-requests.org Alternatively you can use urllib2 to do it which is included in the stdlib, it's not much harder, but the code is a lot messier. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.co

Re: [web2py] Re: recaptcha doesn't work in a component (LOAD)

2014-03-06 Thread Paolo Valleri
I agree with lightdot, the parameter is redundant. Mind that recaptcha library is splitted into two files, the first one (challenge) internally load a second one (recaptcha_canary.js). You made the former to be loaded with "ajax", the second is loaded dynamically in both the cases. Moreover the rea

[web2py] How to post a request to a web api

2014-03-06 Thread horridohobbyist
I'm trying to use a RESTful API by issuing a post. I found this tidbit on the Internet: http://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py But it seems to be outdated, as I cannot import 'requests'. What's the procedure for working with a web API? (I suppose I could use jQuery

Re: [web2py] Re: Nested SQLform.factory

2014-03-06 Thread Kiran Subbaraman
You are probably looking for "cascading dropdowns", where the selection of a value in one determines the options in other dropdowns? See if this helps: http://www.web2pyslices.com/slice/show/1724/cascading-dropdowns-simplified . I remember seeing a few more of these on web2pyslices (please sear

[web2py] Copying the database...

2014-03-06 Thread Jason Brower
I have been trying the following and want to make sure of some things: http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=list%3A#Copy-data-from-one-db-into-another I used to run SQLite and now it is running postgres. However, I would like to backup the DB to SQ

[web2py] Re: need help with query

2014-03-06 Thread 黄祥
perhaps something like : *not tested* max = db.track_trace.created_on.max() max_result = db().select(max).first()[max] query_having = (db.track_trace.id_status == 11) db().select(db.track_trace.id_reparaties, db.track_trace.id_reparaties, max_result, groupby = db.track_trace.id_reparaties, hav

[web2py] Re: importing modules to test file using pytest

2014-03-06 Thread Mandar Vaze
Ian The following is still useful after more than a year. Thanks !! I made some modifications - mostly my specific paths before calling run_pytest, and my run_test.py is in scripts folder rather than bin. I'm getting an error : NameError: name 'db' is not defined I'm running it as : python w

[web2py] Re: need help with query

2014-03-06 Thread Bastiaan van der Veen
Hi, I made the query with SQL: select id_reparaties, id_status, max(created_on) from track_trace group by id_reparaties desc having id_status=11 this gives me the correct results as far as I can see. How do I translate this into a web2py dal query? Op donderdag 27 februari 2014 13:47:46 UTC+1

[web2py] Re: web2py_htmltable styling - source code to be corrected?

2014-03-06 Thread Massimo Di Pierro
Yes please. We'll take the patch. Thanks. On Thursday, 6 March 2014 06:33:56 UTC-6, Kiran Subbaraman wrote: > > Hello, > I noticed that the web2py_htmltable has a inline style, as shown here: > https://github.com/web2py/web2py/blob/4a65e773ce24c1160287cfd39073f0b8feac9d8d/gluon/sqlhtml.py#L2557 >

[web2py] Re: how to resize an expand_one rendered content

2014-03-06 Thread Massimo Di Pierro
You have to use CSS. On Wednesday, 5 March 2014 19:57:05 UTC-6, Samuel Sowah wrote: > > How can I resize the youtube or vimeo embed or google doc viewer whenever > i call expand_one() on a url? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2

Re: [web2py] Re: recaptcha doesn't work in a component (LOAD)

2014-03-06 Thread LightDot
Well, if people want to use ajax for the recaptcha, they can make a load component out of it. I think that the parameter really is redundant... Anyway, thanks for spotting & fixing this. Regards On Thursday, March 6, 2014 11:56:40 AM UTC+1, Tim Richardson wrote: > > > > On Thursday, 6 March 20

[web2py] web2py_htmltable styling - source code to be corrected?

2014-03-06 Thread Kiran Subbaraman
Hello, I noticed that the web2py_htmltable has a inline style, as shown here: https://github.com/web2py/web2py/blob/4a65e773ce24c1160287cfd39073f0b8feac9d8d/gluon/sqlhtml.py#L2557 This generates an ugly scroll bar when viewed in InternetExplorer 11 (maybe similar issues with the lower versions to

[web2py] Re: Bug in request_reset_password

2014-03-06 Thread Tim Richardson
Do you have the time to report this at: http://code.google.com/p/web2py/issues/list >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this

Re: [web2py] Re: recaptcha doesn't work in a component (LOAD)

2014-03-06 Thread Tim Richardson
On Thursday, 6 March 2014 18:29:40 UTC+11, Paolo Valleri wrote: > > I haven't tested, just an idea, instead of adding a new parameter, what > about checking current.request.ajax ? > > I didn't know about that. Does that mean that the client_side parameter in redirect is redundant? people may

Re: [web2py] 'DAL' object has no attribute 'contract'

2014-03-06 Thread Johann Spies
'contract' is not equal to 'Contract' Python is case sensitive. Regards Johann On 5 March 2014 23:21, Koffi Dossou wrote: > *hello, * > * am new to web2py and coming up with the ff errors* > Error ticket for "contractapp"Ticket ID > > 12.229.79.151.2014-03-05.21-18-34.c56c8936-772c-45

Re: [web2py] when i write folloing code and run i got error. i am new to web2py plz tell me where i am wrong

2014-03-06 Thread Johann Spies
Check in models/db.py which database is defined there (probably db = ...). The error message said you have not defined dbu. I suspect you should use 'db'. Regards Johann On 6 March 2014 07:43, Ravi wrote: > > import datetime > now=datetime.datetime.now() > > dbu.define_table('files', >Fi

[web2py] Re: need help with query

2014-03-06 Thread Bastiaan
> > I tried some variations but no correct output so far > max = db.track_trace.created_on.max() recs = db().select(max,db.track_trace.id_status, groupby=db.track_trace. id_reparaties) With this I get the max date, but not the id_status that belongs to that date -- Resources: - http://web2py

[web2py] how to resize an expand_one rendered content

2014-03-06 Thread Samuel Sowah
How can I resize the youtube or vimeo embed or google doc viewer whenever i call expand_one() on a url? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- Y

[web2py] Re: need help with query

2014-03-06 Thread Bastiaan
hmm another reply just gets deleted, immediately after posting(something wrong with my other account I think) I tried somethings now and I am a step closer: max = db.track_trace.created_on.max() recs = db().select(db.track_trace.id_status, max, groupby=db.track_trace. id_reparaties) Now I get th

[web2py] Re: web2py don't start

2014-03-06 Thread LB
> OK, downloaded the last release and now I can run it from the source (the > windows compiled version doesn't start yet)... > I'm going to study it, but I run python 2.7: there is any problem with it? Thanks to everybody, LB -- Resources: - http://web2py.com - http://web2py.com/book (Docume

[web2py] when i write folloing code and run i got error. i am new to web2py plz tell me where i am wrong

2014-03-06 Thread Ravi
import datetime now=datetime.datetime.now() dbu.define_table('files', Field('title', "string", unique=False), Field('file', 'upload', autodelete=True), Field('datecreated','datetime',default=now,readable=False)) ..error Traceback (most recent call last): File "/home/ravi/web2p

[web2py] how to resize expand_one content

2014-03-06 Thread Samuel Sowah
How do i resize (width, length) of the embedded content from youtube or vimeo links or a file that opens in the google doc viewer? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/

[web2py] Re: Nested SQLform.factory

2014-03-06 Thread xgp . latino
Anthony, It is just a form with 2 sqlform.factory based on DB dropdown lists. 1st values passes to form.vars, second do not. Is it possible to have many sqlform.factory based on DB dropdown lists on same form ?? Thanks.! On Wednesday, March 5, 2014 9:11:58 AM UTC-5, Anthony wrote: > >

[web2py] Re: web2py 2.9.4 is OUT

2014-03-06 Thread Dan Feeney
I don't know whether this was a problem in 2.9.3, but I am having a problem with 2.9.4. I updated my local development copy of web2py to 2.9.4 today, and it works just fine in Rocket. However, when I updated my production site, which is running on Apache2/WSGI, I find that my applications run w

[web2py] 'DAL' object has no attribute 'contract'

2014-03-06 Thread Koffi Dossou
*hello, * * am new to web2py and coming up with the ff errors* Error ticket for "contractapp"Ticket ID 12.229.79.151.2014-03-05.21-18-34.c56c8936-772c-453b-b2f2-7d4d2042bff7 'DAL' object has no attribute 'contract'Versionweb2py™Version 2.8.2-stable+timestamp.2013.11.28.13.54.07PythonP

[web2py] Re: web2py 2.9.4 is OUT

2014-03-06 Thread Dan Feeney
I don't know whether this was happening in 2.9.3, but I'm having trouble with 2.9.4. I updated my development copy of web2py to 2.9.4 today, tested it, and everything looked fine. I updated my production copy of web2py (running on Apache2/WSGI), and I find that I get an error ticket when I try

[web2py] session not recognising membership

2014-03-06 Thread Johann Spies
What can cause session on my server to not recognise my membership of groups? auth: expiration: 2592000 hmac_key: c1f0ee87-9945-43b2-8653-88df476a88df last_visit: datetime.datetime(2014, 3, 3, 11, 58, 9, 804045) remember: True user: created_on: None email: jsp...@sun.ac.za first_name: Johann id: 2

[web2py] Re: need help with query

2014-03-06 Thread Bastiaan van der Veen
> > And again everything gets deleted.. I don't understand > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are s

[web2py] Add code to layout.html from {{include}}

2014-03-06 Thread Eric
Hi, I have a layout.html that contains {{block footer}}{{end}}. I've added this so I can add specific javascript files for a controller to the layout without the need of loading it on all pages. I add it like this (this works fine!): clients.html html ... {{block footer}} {{super}} {{end}