Re: [web2py] how to create a counter button...

2013-01-17 Thread sasogeek
what is an ajax callback and how do i use it? what is it for? On Thursday, 17 January 2013 03:16:38 UTC, rochacbruno wrote: models/foo.py # the thing table db.define_table(thing, Field(name)) # you may want to store likes on another table so you never allow a user to like the same thing

[web2py] Re: can't install v 2.3

2013-01-17 Thread Lewis
Which script? I used Bruno's from slices, which was pretty recent. His script installs from maintainer (ubuntu) packages. Thanks. I am going to rely on script based installs from now on. Even if a pain to diagnose, once right you have something repeatable. On Wednesday, January 16, 2013

[web2py] Re: Possible bug? session.auth is None in some requests

2013-01-17 Thread Daniel Gonzalez
I was having a problem with session.auth.user, and my investigation has narrowed down the problem to web2py code. Instrumenting the code has allowed me to see the problem directly in the logs, but the problem is there no matter whether I modify Auth code or not. Sure, for me Sessions and

[web2py] Re: Possible bug? session.auth is None in some requests

2013-01-17 Thread Daniel Gonzalez
Yes Anthony, pretty sure. The little hash that you see in the logs *is* the cookie. Otherwise I can not grep for the relevant log messages (lots of activity going on with 10 parallel requests). This is the code that I have at the very top of my db.py: try: cookie_value =

[web2py] Re: db().select(db.table.all) does not return all fields

2013-01-17 Thread raphael . benedet
Hello, I noticed that a legacy model (with a different table definition) was imported, overriding db in my module. Everything works now. Sorry for the noise... Raphael Le jeudi 17 janvier 2013 04:37:16 UTC+1, Massimo Di Pierro a écrit : What is you print print str(schedulings) instead? Any

[web2py] Re: Why does the login expire when doing periodic jsonrpc requests?

2013-01-17 Thread Daniel Gonzalez
Here: http://code.google.com/p/web2py/issues/detail?id=1287 On Thursday, January 17, 2013 4:50:08 AM UTC+1, Massimo Di Pierro wrote: Please open a ticket about this... :-) On Wednesday, 16 January 2013 17:28:59 UTC-6, Daniel Gonzalez wrote: This is the relevant section in Auth.__init__ for

[web2py] How experimental is postgis?

2013-01-17 Thread Jason Brower
I am hoping to use it in an upcoming application.  Does anyone here have issues with this that still need to be resolved? BR, Jason --

[web2py] crud to SQLFORM

2013-01-17 Thread Annet
I am replacing: form=crud.update(table=db.aboutText,hidden=dict(nodeID=id,aboutID=aboutID),record=row,next=session.crud_next,onaccept=onaccept_about_text,deletable=True) crud.messages.record_updated=session.record_updated crud.messages.record_deleted=session.record_deleted

Re: [web2py] Re: Project: pydev extension for web2py in Eclipse

2013-01-17 Thread Angelo Compagnucci
Any news on this? 2013/1/13 Álvaro José Iradier airad...@gmail.com Hi, I get back to this thread again as I recently got a notification from the feature request on Sourceforge.I had it nearly forgotten, but I think it is still interesting and it looks like the author of Pydev is thinking

[web2py] Book in epub format?

2013-01-17 Thread Johann Spies
Is there any chance to get the book in epub-format? I think it should be possible using markmin - xhtml epub (via calibre)? Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3) --

[web2py] Re: How experimental is postgis?

2013-01-17 Thread Paolo valleri
Hi, I've tried few examples in last weeks. Gis support is getting better, I don't think is far from being stable but right now I don't have the possibility to say it is stable, i.e., a few functions are available only for postgis (i.e., st_x, st_y). Moreover the errors I found have been fixed,

Re: [web2py] Re: Postgres : created new database, but tables not being create when I access the app

2013-01-17 Thread Johann Spies
On 16 January 2013 17:28, Massimo Di Pierro massimo.dipie...@gmail.comwrote: Can you suggest how to make the advice better? On Wednesday, 16 January 2013 01:05:14 UTC-6, Johann Spies wrote: On 6 January 2013 22:00, Anthony abas...@gmail.com wrote: See

[web2py] Unable to UNinstall application

2013-01-17 Thread JediLuke
Hi, I am new to web2py so probably I am doing something wrong. I used the wizard and (I think it was the wizard that did it) it created a bunch of applications - called cron, database, view, there was about 8 or 10 of them. I didn't make them and it was confusing me so I uninstalled most of

[web2py] Trying to do a new database as a field in web2py,

2013-01-17 Thread damien rompapas
Hi everyone, Been using web2py for university, and i'm trying to add a feature within my websites forum posting which will allow me to have each row with a field of a new database, basically when a user creates a post, it also creates a new database table that matches this specific post

[web2py] Re: Query not returning correct data

2013-01-17 Thread Alan Etkin
I've tried that however when I hit search flight button it returns an empty page with no data from the database... Please post your model also (the table definitions). And consider using SQLFORM http://www.web2py.com/books/default/chapter/29/07#SQLFORM, as Anthony suggested, or

Re: [web2py] Having some strange occurence with label printing and FPDF

2013-01-17 Thread Paul Rykiel
Thank you so much Jose... you are so helpful. I am going to try this. this is a requirement to launch this system I wrote with another programmer there is more work to do, but this needs to work. Thank you again!! Regards, On Thursday, January 17, 2013 1:13:21 AM UTC-6, José L. wrote: I've just

Re: [web2py] Unable to UNinstall application

2013-01-17 Thread Marco Mansilla
Apps are created in the /path/to/web2py/applications folder, and are folders too, so you can delete them from that path. Marco. Hi, I am new to web2py so probably I am doing something wrong. I used the wizard and (I think it was the wizard that did it) it created a bunch of applications -

[web2py] Re: Unable to UNinstall application

2013-01-17 Thread Anthony
When you create an application, there should be a single folder with the application name inside the /web2py/applications folder. Then, inside the application folder, you should see folders such as cron, databases, views, etc. Like this: /web2py /applications /myapp /cache

[web2py] Re: Query not returning correct data

2013-01-17 Thread Mihir Lade
Hi Alan, Sorry for the late reply.. Table Definition: ##Customer table. db.define_table('Customer', Field('CustID', type = 'string', length = 10, notnull = True, unique = True), Field('Surname', type = 'string', length = 15, notnull = True), Field('FirstName', type = 'string',

[web2py] Re: crud to SQLFORM

2013-01-17 Thread Anthony
if form.process(onsuccess=lambda form: onaccept_about_text(form), next=session.crud_next).accepted: session.flash='Form accepted' By specifying the next argument, you are telling it to do a redirect after processing -- so, it will redirect when the .process() method is called

[web2py] Re: Unable to UNinstall application

2013-01-17 Thread JediLuke
Yes, that sounds like what happened. I could see them from the admin interface. I only went to the folder after I had uninstalled most of the folders using the 'remove' button in the interface. The 'ABOUT' application is the only one that wouldn't install. When I checked the actual folder it

[web2py] View not displaying the pictures

2013-01-17 Thread Mihir Lade
Can't get my view to display the pictures in the database.. {{for xxx in records:}} tr td img width=150 src={{=URL(a='Assignment', c='default', r=request, f='download', args=xxx.Picture)}} alt=no picture provided / !--This line above is exactly what i

[web2py] sqlform onvalidation changes upload image file to txt file

2013-01-17 Thread António Ramos
hello i have a strange behaviour in my sqlform def attach_image_to_record(form): if form.vars.delete_this_record not in ['on']: response=requests.get(form.vars.fp_url) img=Image.open(StringIO(response.content)) img.save('foto1231.jpg','JPEG')

[web2py] Re: View not displaying the pictures

2013-01-17 Thread Mihir Lade
Actually got this to work however the issue now is its iterating thorugh the table and printing out the information twice.. so for example.. if i have one picture there is information next to that picture.. and the next picture should have another bit of info.. how do i get that to work? --

[web2py] Re: sqlform onvalidation changes upload image file to txt file

2013-01-17 Thread António Ramos
I´m helping myself. I need to add fiels=['f1','f2','f3'] excluding the field foto! in sqlform Thank you me! :) 2013/1/17 António Ramos ramstei...@gmail.com hello i have a strange behaviour in my sqlform def attach_image_to_record(form): if form.vars.delete_this_record not in ['on']:

[web2py] Re: sqlform onvalidation changes upload image file to txt file

2013-01-17 Thread Anthony
Didn't Massimo already solve this for you: https://groups.google.com/d/msg/web2py/YlGv7Ap1HVA/AkEyDkUr-FAJ First, your onvalidation function stores the file using the field's .store() method. Then it assigns the resulting filename to form.vars.photo, which presumably is an upload field.

Re: [web2py] Trying to do a new database as a field in web2py,

2013-01-17 Thread Bruno Rocha
On Thu, Jan 17, 2013 at 5:39 AM, damien rompapas hlvro...@gmail.com wrote: I am sorry if the question is not clear enough. Yes it is not clear :) are you trying to create a table inside a table? it is not permitted on relational dbms. (are you using NOSQL)? I think you want to create

Re: [web2py] Trying to do a new database as a field in web2py,

2013-01-17 Thread Bruno Rocha
Wow, Now I see my example completely wrong.. should be db.define_table('post', # more fields here Field('thoughts', reference Thoughts) ) db.define_table('Thoughts', Field('Editedby', db.auth_user, default=None, readable=True, writable=True),

Re: [web2py] how to create a counter button...

2013-01-17 Thread Bruno Rocha
Did you read the book? I recommend chapters 3, 4 and 6 Plus the Ajax one: http://web2py.com/books/default/chapter/29/11 --

[web2py] editing database entry

2013-01-17 Thread BlueShadow
Hi, I got a table for articles me and other people write(authors) I want all the authors to be able to edit those articles. I currently got no clue where I'm going to start this project. Any help is greatly appreciated. --

[web2py] Re: crud to SQLFORM

2013-01-17 Thread Annet
Hi Anthony, Thanks for your reply. Problem solved! Best regards, Annet --

Re: [web2py] editing database entry

2013-01-17 Thread Bruno Rocha
controllers/article.py #http://./article/add def add(): form = SQLFORM(db.article).process() return dict(form=form) #http:///article/edit/1 def edit(): article_id = request.args(0) or redirect(URL('index')) form = SQLFORM(db.article, article_id).process() return

Re: [web2py] how to create a counter button...

2013-01-17 Thread sasogeek
I did read the book, but only the chapters I needed information from to get my app started :) thanks anyway please look up my app here though if you'd be interested in using it http://newupp.tk what it's about is briefed here https://sasogeek.pythonanywhere.com/newup/default/about (temporary

[web2py] How to avoid Not authorized?

2013-01-17 Thread Sverre
I defined a custom auth.user table like db.define_table( auth.settings.table_user_name, Field('username', length=20, default=''), Field('first_name', length=128, default=''), Field('last_name', length=128, default=''), Field('email', length=128, default='', unique=True), #

[web2py] Re: How to avoid Not authorized?

2013-01-17 Thread Sverre
Never mind. I worked too much. This posting can be ignored. On Thursday, January 17, 2013 4:47:45 PM UTC+1, Sverre wrote: I defined a custom auth.user table like db.define_table( auth.settings.table_user_name, Field('username', length=20, default=''), Field('first_name',

Re: [web2py] Having some strange occurence with label printing and FPDF

2013-01-17 Thread Paul Rykiel
I just want to say a big Thank you! this works perfectly!! I am so happy! Best Regards, On Thu, Jan 17, 2013 at 1:49 AM, Mariano Reingart reing...@gmail.comwrote: Sorry, the correct url for PDFLabels is currently: https://code.google.com/p/pyfpdf/source/browse/tools/pdflabels.py We did some

[web2py] Insert on multiple tables with SQLFORM.grid

2013-01-17 Thread Angelo Compagnucci
Hi guys, I'm trying to insert something into related tables with SQLFORM.grid. I want the user can see only one form with mixed fields for the various tables. Tables are related, so I have to insert a record contemporary on multiple tables. However I want to stick to SQLFORM.grid for the maximum

Re: [web2py] Having some strange occurence with label printing and FPDF

2013-01-17 Thread António Ramos
I still cannot import it in web2py shell by just copying pdflabels.py to gluon/contrib/pypdf can someone post a stupid example app? Thank you António 2013/1/17 Paul Rykiel ptryk...@gmail.com I just want to say a big Thank you! this works perfectly!! I am so happy! Best Regards, On Thu,

Re: [web2py] Having some strange occurence with label printing and FPDF

2013-01-17 Thread Paul Rykiel
mine worked by copying to gluon/contrib/fpdf and then in code: from gluon.contrib.fpdf import PDFLabel On Thu, Jan 17, 2013 at 10:42 AM, António Ramos ramstei...@gmail.comwrote: I still cannot import it in web2py shell by just copying pdflabels.py to gluon/contrib/pypdf can someone post

[web2py] Re: Query not returning correct data

2013-01-17 Thread Alan Etkin
I'd suggest a couple of changes: - Change CamelCase (used in Python class definitions) with the_more_appropiate_convention for object attributes. - Those foreign keys you have declared as ThingId should be renamed as thing_id (for a more web2py like naming style) - Reference keys (links to

[web2py] Re: Get the Local time

2013-01-17 Thread Andrew Evans
I was able to solve my problem with this if anyone is interested import pytz {{current_time = datetime.datetime.now(pytz.timezone('America/Vancouver')).replace(tzinfo=None)}} *cheers On Thu, Jan 17, 2013 at 8:25 AM, Andrew Evans myweb2pyni...@gmail.comwrote: Hello web2py group! I am trying

[web2py] Get the Local time

2013-01-17 Thread Andrew Evans
Hello web2py group! I am trying to find a way to get the local time say PST or EST so I can display a video based on that time. Any suggestions? I was able to convert it to UTC but this doesn't really help the situation {{project_date = db(db.schedule).select(orderby=~db.schedule.date_in,

Re: [web2py] should re remove crud from the book?

2013-01-17 Thread Alan Etkin
... But if we want to keep it longer term we need a better reason. A recent post has reminded me about a really cool crud feature: crud.settings.many table-wide callbacks and other options What would be the replacements for SQLFORM?, I don't think that SQLFORM supports this kind of

[web2py] aµzing...

2013-01-17 Thread Bill Thayer
Been searching a while now for the magic decoder ring that solves the UTF-8 encoding issue. If I enter a mu (µ) by typing alt+0181 into my form field it looks fine. Then looking at the data in SQLDeveloper (Oracle) the data is 2 little boxes. NP I think the client encoding is wrong so I set my

[web2py] Re: Insert on multiple tables with SQLFORM.grid

2013-01-17 Thread Anthony
The create action of the grid results in a URL that ends with args /new/tablename, so you can do: if request.args and request.args[-2] == 'new': tablename = request.args[-1] [custom create code] Anthony On Thursday, January 17, 2013 11:32:08 AM UTC-5, AngeloC wrote: Hi guys, I'm

[web2py] Re: Edit an article

2013-01-17 Thread Alan Etkin
well I didn't try to give them excess but sounds logical. nevertheless I didn't want to give them access to that. But I don't want to access each article by myself just because someone did a spelling mistake or wants to add a little content. A very simple rights restriction example for

[web2py] Re: can't install v 2.3

2013-01-17 Thread Niphlod
don't know if Roberto will dig that, but the script I was referring to is https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh . On Thursday, January 17, 2013 9:11:02 AM UTC+1, Lewis wrote: Which script? I used Bruno's from slices, which was pretty

[web2py] Re: Triggering imports during web2py startup

2013-01-17 Thread Niphlod
I'm not very well versed in all the intricacies, but if the layer calls os.fork() (if you're on linux, that's probably what the underlying server does) your import will happen only on the first request. All the subsequent should not import anything because they will acquire the current status

[web2py] Re: Problems with auth.login_bare when using postgres

2013-01-17 Thread Niphlod
yep, probably exporting all to csv and reimporting would have you saved a bit of hassle. On Wednesday, January 16, 2013 5:43:09 PM UTC+1, Daniel Gonzalez wrote: I found the problem: CHAR fields in postgres (the default that the .dump command in sqlite is generating) will be extended with

[web2py] smartgrid - display linked_tables link as a dropdown button instead

2013-01-17 Thread Jim S
I have a number of smartgrids built where the number of linked tables is pushing the other edit/delete buttons off the right of the page. I'm wondering if there is a simple way that I've missed where you can put your linked_table links into a dropdown button of different 'actions' you could

[web2py] how to make a page auto scroll to previous viewing point after refresh...

2013-01-17 Thread sasogeek
if i scroll down a page, and click some link that redirects back to the page, how do i make the page auto scroll down to the same place it was before i clicked the link? --

[web2py] SQLFORM.grid with multiple LEFT OUTER JOINs

2013-01-17 Thread Jim S
Is there a way to specify 2 left outer joins for a SQLFORM.grid? I tried this: query = (db.feedLoad.deliverOn==datetime.datetime.today())( db.feedLoad.siteId==1) fields = [db.feedLoad.siteId, db.feedOrderLine.productSiteId, db.feedLoad.deliverOn, db.feedLoad.loadNumber,

[web2py] Re: Can anyone create anyone create some helpful stuff on Codeacademy..??

2013-01-17 Thread howesc
any specific tutorial requests? perhaps that will help get some potential educators going. On Wednesday, January 16, 2013 8:43:11 AM UTC-8, Dreamer wrote: Hi guys, I am a noob to programming after a lot of reading and trying my hands at my languages i decided python as a language of

[web2py] Re: Problems with auth.login_bare when using postgres

2013-01-17 Thread Daniel Gonzalez
M, not really: I still need to create the database. Maybe web2py can do that for me if I start with a blank postgres database, but I am not familiar with that, so this was an easier path for me. By the way, I found out another problem: we need serial PRIMARY KEY, so the sed script must be

[web2py] Re: Triggering imports during web2py startup

2013-01-17 Thread Daniel Gonzalez
That is true ... per-process. If my apache server has several processes, I must make sure that all processes are triggered. This is difficult to guarantee. On Thursday, January 17, 2013 8:50:53 PM UTC+1, Niphlod wrote: I'm not very well versed in all the intricacies, but if the layer calls

[web2py] Re: how to make a page auto scroll to previous viewing point after refresh...

2013-01-17 Thread Alan Etkin
if i scroll down a page, and click some link that redirects back to the page You could build the feature yourself, with this tools. http://api.jquery.com/focus/ http://api.jquery.com/ready/ http://api.jquery.com/click/ And you will need also to pass the element's id to the controller so

[web2py] 'DAL' object has no attribute 'auth_wiki' - trunk version

2013-01-17 Thread Bill Thayer
Working on trying out the json support but db won't get past this error. Traceback (most recent call last): File C:\web2py_src_2.2.1\web2py\gluon\restricted.py, line 212, in restricted exec ccode in environment File C:/web2py_src_2.2.1/web2py/applications/TAMOTO/models/db.py

[web2py] auth.wiki doesn't find pages without tags

2013-01-17 Thread Vinicius Assef
I've had a problem today, trying to search auth.wiki pages without tags, but they aren't found. As tags aren't required to save a page, I think this is a problem in Wiki.search() method. What do you think? --

[web2py] Re: MongoDB 'document' or 'dict' filetype

2013-01-17 Thread Alan Etkin
At the moment MongodbAdapter only has these filetypes The MongoDBAdapter now supports storing JSON documents, plus a json widget and IS_JSON validator. See this slice for more details: http://www.web2pyslices.com/slice/show/1580/save-the-earth-from-a-total-data-mess-with-mongodbadapter --

[web2py] Re: 'DAL' object has no attribute 'auth_wiki' - trunk version

2013-01-17 Thread Alan Etkin
Working on trying out the json support but db won't get past this error. This is a bug introduced when templates were restored conditionally. The remplates query should be executed after defining the wiki tables, I'll send a patch asap. --

[web2py] Re: change string format of date picker

2013-01-17 Thread Tim Richardson
HI Massimo, the anchor in the URL reference to the book doesn't work, by the way, not for me anyway . On Thursday, 17 January 2013 14:56:51 UTC+11, Massimo Di Pierro wrote: Does this help? http://web2py.com/books/default/chapter/29/03#On-date,-datetime-and-time-format On Wednesday, 16

[web2py] Re: change string format of date picker

2013-01-17 Thread Tim Richardson
On Thursday, 17 January 2013 14:56:51 UTC+11, Massimo Di Pierro wrote: Does this help? http://web2py.com/books/default/chapter/29/03#On-date,-datetime-and-time-format My little problem was that I'm using some legacy code, which wanted dates as strings in dd-mm-. The date picker

[web2py] Are there conditions under which labels are not shown in SQLForm ?

2013-01-17 Thread GeeksRule
I have an SQLForm, and have a dictionary of labels, but they aren't been overriden : {'fname':'First name: ', 'lname':'Last name : ', 'Published_Datetime':'Date when you published : '} here fname is the column name in th database. are there any conditions where the labels I provide won't work

[web2py] how to call sqlform from a view

2013-01-17 Thread Alex Glaros
The example at http://web2py.com/books/default/chapter/29/07#SQLFORM shows this function below. But what is the syntax for calling a function from a view? Would it be this? {{=display_form()}} thanks, Alex Glaros def display_form(): form = SQLFORM(db.person) if