Don't have this statement
return response.stream(open('tuto1.pdf'))
Instead redirect to wherever you want to go next, or just have a plain old
return and use your routine as a function.
Peter
On Monday, 19 November 2012 12:06:51 UTC, Paul Rykiel wrote:
>
> yes, I realize this ... I just don't
yes, I realize this ... I just don't want a screen to come up.
The screen PDF displays with the first record. Can we supress?
On Mon, Nov 19, 2012 at 5:16 AM, peter wrote:
> Paul I think you will find that you have created a file. The file
> tuto1.pdf will be in your web2py folder which is maybe
Paul I think you will find that you have created a file. The file tuto1.pdf
will be in your web2py folder which is maybe why you are not seeing it.
if you do
pdf.output(name=request.folder+'/static/tuto1.pdf')
It would put it in the static folder of your application.
Peter
On Monday,
Anthony ...
got it working, thanks for all of your help!!
Best Regards,
On Sunday, November 18, 2012 9:25:39 AM UTC-6, Anthony wrote:
> It's still not clear exactly what isn't working.
>
> @auth.requires_login()
>> record = db(db.bike.bike_identifier != "").select()[0]
>> assert(record
Thank you Peter... i actually got it working, but I have a specific
question ... I have been just trying out the PDF creation and the following
example works great ... it is simple and I think it will suffice, here is
my question ... how do I get it to save to a director and not just display
th
thanks for all of your help ... I still don't have it working, but I have
another idea and I will keep working on this.
I will try out all of the different combination listed here and if they do
not work, I have a workaround.
thanks so much for your effort, I will fill you in when I get it working
It's still not clear exactly what isn't working.
@auth.requires_login()
> record = db(db.bike.bike_identifier != "").select()[0]
> assert(record != None)
> form = SQLFORM(db.bike, record, showid=False)
> # Default a form value
> #form.vars.bike_identifier = record.bike_identifi
> 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))
>
Note, if you have just a single arg, you do not need to put it in a list
(this will be do
Thank you ... I did get something to work, but having some more info is
helpful. Thanks for taking the time.
On Sun, Nov 18, 2012 at 3:39 AM, peter wrote:
> Paul here is a reply to your pyfpdf question.
>
> I think the best way to use pyfpdf with web2py is not to install pyfpdf,
> but to include
Thank you, I will try ... yes I do understand the difference between a
field and an array and now that I think about it, it does make more sense
since request.vars(0) is an array. LOL
Thanks again!!
On Sun, Nov 18, 2012 at 12:56 AM, Vasile Ermicioi wrote:
> 2 errors
>
> 1) args should be an arra
Paul here is a reply to your pyfpdf question.
I think the best way to use pyfpdf with web2py is not to install pyfpdf,
but to include it in your application. So download the source file. Put all
the .py files in the modules folder of your application. Copy the font
folder into the modules folde
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
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
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
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
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?
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
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
>
> @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)
>
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
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,
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
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
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
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
I always just use.
*
Rows = db(db.bike.id==request.args(0)).select()
*
This assumes you are constructing the URLs correctly.
localhost:8000///tag/1
I never reassign request.args() unless I'm going to use it a
lot and want to save some typing. Same with request.vars.
On Tuesday, November 13
26 matches
Mail list logo