[web2py] my web2py domain sometimes redirects to 'welcome' or 'myapp'. Any fix for this?

2012-11-17 Thread Kenny
I changed the routes_in to redirect one of my domains to some application, it sometimes redirects to welcome. Anyone knows why it does this? --

Re: [web2py] Re: request args

2012-11-17 Thread Vasile Ermicioi
2 errors 1) args should be an array form.add_button("Print_Tag", URL("tagprint", args=[record.bike_identifier])) instead of form.add_button("Print_Tag", URL("tagprint", args=record.bike_identifier)) 2) if you pass it to args then retrieve it from args, not from vars req = request.args(0) inste

Re: [web2py] Sending and Recieving JSON data...

2012-11-17 Thread Marin Pranjić
JSONRPC should be used if you want to implement RPC service but if you only need to send json data, you can do it that way or another. How would you send the data? Something that works in the background or manually, from web browser? Anyway, the issue can be how to do it on your mobile device (de

[web2py] Sending and Recieving JSON data...

2012-11-17 Thread Jason Brower
I have a mobile device that sends various data using json to a server. I would like this server to be web2py. How would I do this? Am I on the right track here? http://web2py.com/books/default/chapter/29/10#JSONRPC Or am I looking in the wrong place. There will be a large amount of data sent. BR,

[web2py] Re: wxpython app using web2py username and password

2012-11-17 Thread Dave
Jim, If your windows users are logging in via active directory you could just make your web2py app authenticate through ldap to AD. That would ensure AD is your source of truth fo user authentication and management. Just a thought. On Thursday, November 15, 2012 12:32:03 PM UTC-5, Jim S wrote

Re: [web2py] Re: Uploadify what am I doing wrong

2012-11-17 Thread Kenny
Thank you for sharing. I am getting IOerror from this. It seems to me that it's working on your server and not on mine. very weird. On Wednesday, July 4, 2012 3:29:11 PM UTC-5, Relsi Hur wrote: > > here a very fast example. > > Em quarta-feira, 4 de julho de 2012 16h40min45s UTC-3, cheer10s escr

[web2py] Re: Very simple issue: redirect on login - auth.settings.login_next

2012-11-17 Thread Rob_McC
Anthony: Thanks... I appreciate everyone's help on this thread. I did what you suggested. and I now have it working (perfectly- I think) . I added 2 lines to db.py and inserted into layout.html referrer_actions=None as shown in detail below. I also learned how to redirect a user, after t

Re: [web2py] Re: request args

2012-11-17 Thread Paul Rykiel
This is the code segment that I am having issues with: I have highlighted the areas that are not working. if something sticks out and you can help I apreciate it. @auth.requires_login() record = db(db.bike.bike_identifier != "").select()[0] assert(record != None) form = SQLFORM(db.bike

Re: [web2py] Re: request args

2012-11-17 Thread Anthony
Do you mean request.args(0)? There is no request.vars(0). Maybe it would help if you could show all the relevant code and describe the workflow (if possible, you can simplify the code to the minimal code that reproduces your problem). Anthony On Saturday, November 17, 2012 9:03:53 PM UTC-5, Pa

Re: [web2py] Re: request args

2012-11-17 Thread Paul Rykiel
I have a variable that I am moving the request.vars(0) into and when i look at in the HTML view it has a NONE value. it is strange to me, because it has to have this value in order to fill out the original SQL form. I am pulling from the form, and I even tried to pull it from the record variable wh

[web2py] Re: we should support this in DAL

2012-11-17 Thread Adi
Definitely would be nice to support NoSQL. I tried the existing DAL with MongoDB and grid worked fine to the point of view/edit record. Due to different concepts (sql/nosql) if it's hard to keep them in a same DAL, maybe there could be a separate layer for NoSQL. I would be glad to test lots

[web2py] Re: import gluon.contrib.pyfpdf

2012-11-17 Thread Paul Rykiel
this works great... Thank you Massimo! :) On Friday, November 16, 2012 5:26:51 PM UTC-6, Paul Rykiel wrote: > > Greetings, > Having difficulty trying to just do a basic PDF test, but getting error's > on the import, well actually not an error, just no results. > > Here is my code, you may recogn

[web2py] Re: auth.wiki( extra=dict() )

2012-11-17 Thread Andrew W
I'm assuming it works differently to the markmin document.I can see is adds a class called "custom", but I don't see the lambda function working as in: >>> markmin2html("‘‘aaa‘‘:custom", extra=dict(custom=lambda text: ’x’+text+’x’ generates ’xaaax’ (the ‘‘...‘‘:custom block i

[web2py] Re: problem with .ALL and distinct

2012-11-17 Thread Vincenzo Ampolo
Fixed it. My bad. The db.movies.year in which i was ordering was a textfield and it was too big (just the year) to produce a predicible result in a dataset. I've updated the order rule by putting: list_movies = db(query).select(db.movies.ALL, orderby=~(db.movies.year)|~(db.movies.updated),

Re: [web2py] Re: request args

2012-11-17 Thread Anthony
Can you be more specific -- what does "not working" mean? Does your query actually pull a record, and does the record include a value in the bike_identifier field? If so, the button url should include the bike_identifier value as an arg -- is that the case? Is it breaking down somewhere else?

[web2py] Re: problem with .ALL and distinct

2012-11-17 Thread Vincenzo Ampolo
After playing a bit further i found that the weirdness is about orderby and limit In [76]: a = db().select(db.movies.ALL, orderby=~(db.movies.year), limitby=(0,10)) In [77]: for m in a: print m.id : 26 16 8 43905 17 1474 13 14 1 27 In [78]: a = db().select(db.movies.ALL, orderby=~(

[web2py] problem with .ALL and distinct

2012-11-17 Thread Vincenzo Ampolo
Hi, I'm trying to do a simple distinct query in a database but something weird i couldn't figure out happens. The distinct=True doesn't seem to produce distinct results with In [23]: useful_movies=movies_with_titles&with_poster In [24]: page=0 In [25]: a = db(use).select(db.movies.ALL, orde

[web2py] Re: args

2012-11-17 Thread Paul Rykiel
thank you... that did not work but I will keep trying On Friday, November 16, 2012 7:10:35 PM UTC-6, Paul Rykiel wrote: > Greetings: > > The following line of code doesn't seem to be working, any ideas > > record = db(db.bike.bike_identifier != "").select()[0] > assert(record != None) >

Re: [web2py] Re: request args

2012-11-17 Thread Paul Rykiel
well...that is not working, but I will keep working at it. mostly I just wanted to make certain that I wasn't doing something incorrectly. On Sat, Nov 17, 2012 at 5:09 PM, Paul Rykiel wrote: > as you can see I am still learning, but getting more comfortable, I didn't > know that was a possibilit

Re: [web2py] Re: request args

2012-11-17 Thread Paul Rykiel
as you can see I am still learning, but getting more comfortable, I didn't know that was a possibility. I will try thank you for your response!! Safe travels!! On Sat, Nov 17, 2012 at 5:02 PM, Anthony wrote: > @auth.requires_login() >> def repair(): >> ## TODO Need to add a way to find the

Re: [web2py] Re: request args

2012-11-17 Thread Anthony
> > @auth.requires_login() > def repair(): > ## TODO Need to add a way to find the bike_identifier. > ## For now, just get the first bike listed. > record = db(db.bike.bike_identifier != "").select()[0] > assert(record != None) > form = SQLFORM(db.bike, record, showid=False) >

Re: [web2py] Re: request args

2012-11-17 Thread Paul Rykiel
so this is the actual code I will highlight the areas that I have questions about. @auth.requires_login() def repair(): ## TODO Need to add a way to find the bike_identifier. ## For now, just get the first bike listed. record = db(db.bike.bike_identifier != "").select()[0] assert(r

Re: [web2py] Re: request args

2012-11-17 Thread Paul's Gmail
Thank you so much. I will do it when I get home. I also put several posts about using pyfpdf and those utilities and I am getting no response . I just want a simple PDF print import pyfpdf f = pyfpdf.FPDF(format='letter') p d df.add_page() p df.set_font("Arial", size=12) p df.cell(200, 10,

Re: [web2py] args

2012-11-17 Thread Vasile Ermicioi
request.vars(0) is incorrect, request.vars is a dict not a list, you should use request.vars.var_name or request.vars['var_name'] --

[web2py] Re: How do I handle more than 32768 characters in the database?

2012-11-17 Thread Niphlod
text has a default imposed limit of 2**15 characters. use length=whatever to increase that limit if you need to (and the corresponding validator will not fire). --

[web2py] Re: How do I handle more than 32768 characters in the database?

2012-11-17 Thread encompass
text On Saturday, November 17, 2012 5:36:32 PM UTC+2, LightDot wrote: > > This is saved in a database field? > > So... which database and which field type? ;) > > Regards, > Ales > > > On Saturday, November 17, 2012 7:30:55 AM UTC+1, encompass wrote: >> >> I was including the css I use in my emai

[web2py] Re: Newbie: Cascading deletes with SQLFORM.grid and GAE

2012-11-17 Thread Massimo Di Pierro
You can try something like def delete_linked(query, table=table): ids = [t.id in db(query).select(db.table.id)] for field in table._referenced_by: db(field._table._id.belongs(ids)).delete() db.table._before_delete.append(delete_linked) but you will run into consistency problems.

[web2py] Re: How do I handle more than 32768 characters in the database?

2012-11-17 Thread encompass
They are queued and then sent later. On Saturday, November 17, 2012 3:10:23 PM UTC+2, Niphlod wrote: > > how are you sending the email message ? > > On Saturday, November 17, 2012 7:30:55 AM UTC+1, encompass wrote: >> >> I was including the css I use in my emails and it's telling me it is >> mo

[web2py] Re: Bootstrap departures from standard framework

2012-11-17 Thread Massimo Di Pierro
We have extra JS to make the menu names clickable (bootstrap does not support that). we have extra classes to hangle web2py specific classes, for example the ones for the grid. Nothing else I can think of. On Friday, 16 November 2012 23:59:50 UTC-6, Rod Watkins wrote: > > Hello everyone, > > I a

[web2py] Re: import gluon.contrib.pyfpdf

2012-11-17 Thread Massimo Di Pierro
You are doing output to a file pdf.output('tuto1.pdf','F') Try: from gluon.contrib.fpdf import FPDF def pdfexp(): pdf=FPDF() pdf.add_page() pdf.set_font('Arial','B',16) pdf.cell(40,10,'Hello World!') pdf.output('tuto1.pdf','F') return response.stream(open('tuto1.pdf')) an

[web2py] Re: Time of registration

2012-11-17 Thread Massimo Di Pierro
Field('registration_time', 'datetime') is you want the user to fill it in: Field('registration_time', 'datetime', default=request.now, writable=False, readable=False) to make it automatic. On Friday, 16 November 2012 15:44:17 UTC-6, Daniele wrote: > > Guys I'm wondering when I get someone to re

[web2py] Re: having problems importing pyfpdf

2012-11-17 Thread Massimo Di Pierro
You are using the wrong import syntax and a wrong folder name. I assume you want: import gluon.contrib.fdpf as pdf On Saturday, 17 November 2012 12:09:41 UTC-6, Paul Rykiel wrote: > > Where do I load this > , in gluon.contrib? > > I keep getting wierd erros "module not found," or "cannot loa

[web2py] Re: request args

2012-11-17 Thread Massimo Di Pierro
Feel free to show me exact controller code. You can email me to my google address. On Saturday, 17 November 2012 12:06:36 UTC-6, Paul Rykiel wrote: > > Hi Massimo, > > This post is fixed, but I am having a similar issue when I try to > add a button ... and the button does a > > page.addbut

[web2py] Re: request args

2012-11-17 Thread Paul Rykiel
Hi Massimo, This post is fixed, but I am having a similar issue when I try to add a button ... and the button does a page.addbutton(_name="print_tag") URL('tagprint', * args=form.vars.bike_identifier*) In def tagprint(): tag = db(db.bike.bike_indentifier==*request.args(0*)) * reque

[web2py] having problems importing pyfpdf

2012-11-17 Thread Paul Rykiel
Where do I load this, in gluon.contrib? I keep getting wierd erros "module not found," or "cannot load fpdf" import from gluon.contrib.pyfdpf as pdf does not seem to work any assistance, I just want to use whatever took ships with Web2py, no special configs --

[web2py] Simple PDF process

2012-11-17 Thread Paul Rykiel
Greetings, can anyone direct me to a simple PDF process... here is what I would like to do: query a db and print 1 field out of the database onto a PDF Very simple My research has lead me to pyfpdf ... which supposedly is supposed to be included in the gluon.config already when i try to i

[web2py] import gluon.contrib.pyfpdf

2012-11-17 Thread Paul Rykiel
Greetings, Having difficulty trying to just do a basic PDF test, but getting error's on the import, well actually not an error, just no results. Here is my code, you may recognize it from tutorial from gluon.contrib.fpdf import FPDF def pdfexp(): pdf=FPDF() pdf.add_page() pdf.set_f

[web2py] args

2012-11-17 Thread Paul Rykiel
Greetings: The following line of code doesn't seem to be working, any ideas record = db(db.bike.bike_identifier != "").select()[0] assert(record != None) form = SQLFORM(db.bike, record, showid=False) form.add_button("Print_Tag", URL("tagprint", args=form.vars.bike_identifier)) Whe

[web2py] Bootstrap departures from standard framework

2012-11-17 Thread Rod Watkins
Hello everyone, I am in the process of preparing my web app to switch over to bootstrap. I wanted to get a better understanding of how the web2py implementation departs in any way from the standard vanilla bootstrap library. I already understand that the welcome scaffold app makes use of some u

[web2py] Time of registration

2012-11-17 Thread Daniele
Guys I'm wondering when I get someone to register, I'd like to have a field in my database for the datetime. In my db.py file, I have a Field('registration_time', 'datetime') However, how do I pass in that the time (now) is supposed to be taken when the user submits the form?? I'm a bit confused

[web2py] response.flash not displaying

2012-11-17 Thread Daniele
I cannot get response.flash to display for the life of me...I'm using a vanilla version of the latest twitter bootstrap and have the following in my style.css (which I took verbatim from web2py's css file) div.flash { font-weight:bold; display:none; position:fixed; padding:10px;

[web2py] Re: Very simple issue: redirect on login - auth.settings.login_next

2012-11-17 Thread peter
Thanks Anthony. I think Rob was tempting fate by putting 'Very Simple' in the heading of this thread. Peter On Saturday, 17 November 2012 15:46:47 UTC, Anthony wrote: > > Note, I just marked the issue as invalid, as it appears you were calling > auth.navbar in a model file rather than editing t

[web2py] Re: Bootstrap snippets

2012-11-17 Thread Don_X
Thank you Bruno .. pretty cool .. I will need some of these ! --

[web2py] Re: how do I change the appearance of a form from the basic look ?

2012-11-17 Thread Don_X
You can modified the look and feel of a form by using a combination of CSS and by breaking the form into different components as explained here : http://web2py.com/books/default/chapter/29/07#Custom-forms On Thursday, November 15, 2012 3:16:01 PM UTC-5, Hector Magnanao wrote: > > how do i change

[web2py] Re: Very simple issue: redirect on login - auth.settings.login_next

2012-11-17 Thread Anthony
Note, I just marked the issue as invalid, as it appears you were calling auth.navbar in a model file rather than editing the version that actually generates the navbar in layout.hml. Anthony On Friday, November 16, 2012 5:39:36 PM UTC-5, peter wrote: > > I have already issued a bug report. for

[web2py] Re: Very simple issue: redirect on login - auth.settings.login_next

2012-11-17 Thread Anthony
Sorry, I didn't look closely at your code. You said you added auth.navbar(referrer_actions=None) to your db.py file, but that's not where it goes. auth.navbar() is a helper that generates HTML, so it goes in a view. By default, it is included in layout.html, and if you actually have the navbar

Re: [web2py] Multilanguage website

2012-11-17 Thread David Sorrentino
Dear Niphlod, This is right what I was looking for! :D It's unbelievable how much I still have to learn about web2py. :) Thanks a lot for this solution Niphlod! Wish you a nice evening. David On 16 November 2012 21:36, Niphlod wrote: > ok, I played with it and understood an "underlying desig

[web2py] Re: How do I handle more than 32768 characters in the database?

2012-11-17 Thread LightDot
This is saved in a database field? So... which database and which field type? ;) Regards, Ales On Saturday, November 17, 2012 7:30:55 AM UTC+1, encompass wrote: > > I was including the css I use in my emails and it's telling me it is more > than 32768 Chars. > > 'message': 'enter from 0 to 32

[web2py] Re: How do I include text from a file in static in my email templates?

2012-11-17 Thread Anthony
> > LOAD does not work because it is designed to LOAD a action client-side, > not serverside. > Technically, LOAD can be used server side with ajax=False (as was attempted here), but there are two problems with that approach in this case. First, the ajax argument to LOAD is ignored if the url

[web2py] Re: web2py 2.2.1 routes not redirecting

2012-11-17 Thread Massimo Di Pierro
Fixed in trunk! On Friday, 16 November 2012 09:07:54 UTC-6, Vasile Ermicioi wrote: > > hi, > > instead of showing 'app' application it shows it show init app > but if I go > http://mysite.com/app > it works > > routes.py > > #!/usr/bin/python > # -*- coding: utf-8 -*- > > routes_in = ( > ('(.*):ht

Re: [web2py] Unsigned int in DAL

2012-11-17 Thread Niphlod
ps: checked a little and probably found out because web2py doesn't have a default type for unsigned ints. SQLite --> unsigned integer doesn't exist. Only integer Postgresql --> same as above MSSQL --> same as above Oracle --> can be used in t-sql only, so, for table columns no support Mysql --> s

[web2py] how do I change the appearance of a form from the basic look ?

2012-11-17 Thread Hector Magnanao
how do i change the background color, fonts, etc. ? --

[web2py] No module named xxx Ubuntu

2012-11-17 Thread António Ramos
Hello i have web2py running in Ubuntu 12.04 i installed a module Pycall as root On the ubuntu console i can import pycall but if i import in a controller function i get the error def phone(a): print "calling ",a from pycall import CallFile, Call, Application call = Call('SIP/robert')

[web2py] Unique constraint/index on multiple fields?

2012-11-17 Thread Dragan Matic
It has been asked before but I haven't seen any definitive answer. Is there a way to enforce unique constraint or index on multiple fields or if not are there any plans to implement it? It can come handy in checking data integrity and lots of databases support it. Without this feature a user c

[web2py] Re: Please help me, add button not work

2012-11-17 Thread Cliff Kachinske
Did you register and log in while testing your app? On Monday, November 12, 2012 11:58:11 PM UTC-5, Ton Dong wrote: > > Hi all, > > I am a newbie in web design. I followed the instructions in the video > "Build an online store with web2py" at http://vimeo.com/20768689 > I don't know why I can not

[web2py] Re: request args

2012-11-17 Thread Paul Rykiel
it works, and I thought I tried this before... thank you so much!! On Wednesday, November 14, 2012 3:31:31 PM UTC-6, Cliff Kachinske wrote: > I always just use. > > * > Rows = db(db.bike.id==request.args(0)).select() > * > > This assumes you are constructing the URLs correctly. > > localhost:8000

[web2py] Form question

2012-11-17 Thread Paul Rykiel
Greetings, I am new to Web2py and I have to do something very basic, but I am not certain how to do it, can someone explain. I want to create an empty form to be used to enter parameters that will perform a function, print an "n" number of tags. . I used the following to create the input fie

[web2py] Extracting row id from url using request.args

2012-11-17 Thread Mike H
I am using smartgrid for the membership database I am building. I have 3 tables, contact (the members contact details and name), courses (any courses the member is doing with us) and membership (the users membership details). I am using conditionals to present customised view of the generated f

[web2py] Entry forms

2012-11-17 Thread Paul Rykiel
Greetings ... can someone tell me the best way to create a form which has entry fields on in? for Example: Enter the Number of Apples : ___ Enter thel Number of Pears: _ I set up my code to look something like this: apples = FORM(Input(_type="integer", _name="appl

[web2py] Re: areyouahuman.com CAPTCHA

2012-11-17 Thread Reid
This is Reid from Are You a Human. We don't have a specific plugin for web2py but I think our python libraryshould work with some modification. We're happy to help, check out our forum or email support at a

[web2py] Cascading deletes in GAE with SQLFORM.grid

2012-11-17 Thread Julian Sanchez
I'm deploying a web2py app in GAE (web2py version 2.2.1) that has a number of tables with fields that reference other tables in the same model. I have a few pages that use the SQLFORM.grid to display the data from those tables. When running the app locally using sqlite as the backend everythi

[web2py] Re: How to get a filter subset?

2012-11-17 Thread John Ho
Thanks. On Tuesday, November 13, 2012 9:04:44 AM UTC-8, John Ho wrote: > > For a school admin database, different roles for logged in users: admin, > teachers and staff. I can use using auth_group and auth_membership to > define these roles. > > I have the following table: > > db.define_tabl

[web2py] Newbie: Cascading deletes with SQLFORM.grid and GAE

2012-11-17 Thread Julian Sanchez
Hi Everyone!! Long time lurker & first time posting... I am working on a simple application that I intend to deploy in GAE. I have a few tables with fields that reference other tables which by default enables the ondelete=CASCADE behavior. This works fine when I run the app locally using sql

[web2py] changing the look of a form

2012-11-17 Thread Hector Magnanao
how do you change the look of a form (i.e. background color, fonts, etc...) ? --

Re: [web2py] request args

2012-11-17 Thread Paul Rykiel
tried casting the request.args(0) as an int, it does not work I am afraid. I capture the request.arg(0) in the variable and if I print the variable tag_no I see a value in there so I don't know. On Wednesday, November 14, 2012 4:58:05 AM UTC-6, David Sorrentino wrote: > Hello Paul, > > reque

Re: [web2py] Unsigned int in DAL

2012-11-17 Thread Niphlod
> BigInt -> twice the same space required, I'am not sure that's why they > exists.. > they exist to support signed integer larger than int. That's what you can do now to continue developing your app with web2py. > sql.log -> indeed, could do it this way, but, why is everything else > possib

Re: [web2py] Unsigned int in DAL

2012-11-17 Thread Joseph Piron
BigInt -> twice the same space required, I'am not sure that's why they exists.. sql.log -> indeed, could do it this way, but, why is everything else possible with the DAL (up to now)? On 17 Nov 2012, at 14:09, Niphlod wrote: > > I know 2**31, I meant the value: 2147483648 :) > And while the I

[web2py] Re: How do I handle more than 32768 characters in the database?

2012-11-17 Thread Niphlod
how are you sending the email message ? On Saturday, November 17, 2012 7:30:55 AM UTC+1, encompass wrote: > > I was including the css I use in my emails and it's telling me it is more > than 32768 Chars. > > 'message': 'enter from 0 to 32768 characters' > > Any way I can get around this issue?

[web2py] Re: Unsigned int in DAL

2012-11-17 Thread Niphlod
> I know 2**31, I meant the value: 2147483648 :) > And while the IS_INT_IN_RANGE is fine for negative value (I am already > using it) that does not change the fact that is the column is not set as > unsigned, 2147483648 can't be saved. > that's why there's bigint. For the deployment, no th

[web2py] Re: we should support this in DAL

2012-11-17 Thread Niphlod
without making indexes on every field automatically it's not going to resemble anything more than a key-value store On Saturday, November 17, 2012 1:19:15 PM UTC+1, Massimo Di Pierro wrote: > > http://labs.codernity.com/codernitydb/index.html > --

[web2py] Re: request args

2012-11-17 Thread Massimo Di Pierro
What error do you get? Are you trying to access the url with an extension? On Tuesday, 13 November 2012 17:28:59 UTC-6, Paul Rykiel wrote: > > Hi just learning WEB2py and I have a question: > > why do i get an error on this code > This code errors out, but when I replace "tag_no" with 1 for

[web2py] Re: How do I include text from a file in static in my email templates?

2012-11-17 Thread Massimo Di Pierro
You can also do {{include '../static/css/web2py.css'}} {{include '../static/css/style.css'}} LOAD does not work because it is designed to LOAD a action client-side, not serverside. On Saturday, 17 November 2012 00:18:35 UTC-6, encompass wrote: > > Never thought about doing it that way. > Bett

[web2py] we should support this in DAL

2012-11-17 Thread Massimo Di Pierro
http://labs.codernity.com/codernitydb/index.html --

[web2py] Re: Unsigned int in DAL

2012-11-17 Thread Joseph.Piron
I know 2**31, I meant the value: 2147483648 :) And while the IS_INT_IN_RANGE is fine for negative value (I am already using it) that does not change the fact that is the column is not set as unsigned, 2147483648 can't be saved. For the deployment, no that's not a solution. We require à fully sc