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(record != None)
form = SQLFORM(db.bike, record, showid=False)
# Default a form value
#form.vars.bike_identifier = record.bike_identifier
form.add_button("Cancel", URL("index"))
*form.add_button("Print_Tag", URL("tagprint", args=form.vars.
bike_identifier))
* form.process() #onvalidation=onValidate)
# Print completed tags
@auth.requires_login()
def tagprint():
Title = "For Sale"
* req = request.args(0) #this is just for test to see if req gets the
value "bike_indentifier", but I am getting a value of NONE (thats the
question) What am I doing wrong? *
*
* *Rows = db(db.bike.bike_identifier==request.args(0)).select()
* for row in Rows:
bike_identifier = row.bike_identifier
serial = row.serial
make = row.make
model = row.model
size = row.size
color = row.color
style = row.style
date_of_receipt = row.date_of_receipt
repairs = row.repairs_done
price = row.price
return dict(Title=Title)
On Sat, Nov 17, 2012 at 12:54 PM, Massimo Di Pierro <
[email protected]> wrote:
> 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.addbutton(_name="print_**tag") URL('tagprint', *
>> args=form.vars.bike_identifier***)
>>
>> In def tagprint():
>> tag = db(db.bike.bike_indentifier==*request.args(0*))
>>
>> * request.args(0) shows a NONE
>>
>> am I coding this incorrectly.
>>
>>
>>
>> On Saturday, November 17, 2012 6:34:08 AM UTC-6, Massimo Di Pierro wrote:
>>
>>> 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
>>>> record id 1, it works, also the variable "tag_no" has a 1 as a value when i
>>>> type in an argument 1 on the end of the URL *
>>>>
>>>> def tag():
>>>> tag_no = request.args(0)
>>>> Title = "For Sale"
>>>> * Rows = db(db.bike.id==tag_no).select() *
>>>> for row in Rows:
>>>> serial = row.serial
>>>> make = row.make
>>>> model = row.model
>>>> size = row.size
>>>> color = row.color
>>>> style = row.style
>>>> date_of_receipt = row.date_of_receipt
>>>> repairs = row.repairs_done
>>>> price = row.price
>>>> return locals()
>>>>
>>> --
>
>
>
>
--