[web2py] Setting up Web2Py Apache2 WSGI and Debian Etch Questions?

2010-05-10 Thread Andrew Evans
Hello I have been trying to set up web2py on debian etch using
mod_wsgi with no luck

Has anyone got this working if so can they write a tutorial. As I
understand I need to compile Python25 or Python26 and mod wsgi from
source

I am doing a fresh install and hope to get this going as my last
attempts caused some problems :-P



Re: [web2py] Re: Setting up Web2Py Apache2 WSGI and Debian Etch Questions?

2010-05-10 Thread Andrew Evans
Hello thank you for replying to my message

I have not seen that, but it looks like exactly what I need

thank you

*cheers

Andrew




On Mon, May 10, 2010 at 10:47 AM, mr.freeze  wrote:

> Have you seen this?:
> http://web2pyslices.com/main/slices/take_slice/29
>
>
> On May 10, 12:08 pm, Andrew Evans  wrote:
> > Hello I have been trying to set up web2py on debian etch using
> > mod_wsgi with no luck
> >
> > Has anyone got this working if so can they write a tutorial. As I
> > understand I need to compile Python25 or Python26 and mod wsgi from
> > source
> >
> > I am doing a fresh install and hope to get this going as my last
> > attempts caused some problems :-P
>


[web2py] Adding a new domain

2010-05-11 Thread Andrew Evans
Hello I am using web2py on my server and would like to set up a new
domain to add to it

right now it sits at http://serv.cyber-samurai.de

I am running apache + wsgi I have my additional domain pointed to the
server but I am unsure how to configure web2py how to use it.

Do I create a new application with that domain?

suggestions

Thank You


[web2py] Looping in the browser?

2010-05-11 Thread Andrew Evans
Hello I have a problem. I have code written for web2py that has two
functions, the problem is in the looping of the second function. it
only executes the loop once. Is there anyway I can continue looping

def check():
for target_keyword in session.keywords.split(','):
gs = GoogleSearch(target_keyword)
gs.results_per_page = int(session.results_per_page_num)
results = gs.get_results()
for idx, res in enumerate(results):
parsed = urlparse(res.url)
domain = mk_nice_domain(parsed.netloc)
if domain == session.target_domain:
return dict(search=build("Your google position is %d
for keyword '%s' on domain %s" % (idx+1,
target_keyword, session.target_domain)))

Thanks if you can help



Re: [web2py] Looping in the browser?

2010-05-12 Thread Andrew Evans
ty this is exactly what I need ty very much


[web2py] Form Checkbox how to Use efectively

2010-05-13 Thread Andrew Evans
hello I have a form I would like to use multiple check boxes to select
data to use. I am not using any sql

an example of how I am generating the check boxes

 TR(INPUT(_type="checkbox", name="browser"), "Browser"),
TR(INPUT(_type="checkbox", name="pageDepth"), "Page Depth"),

this is not the best way from what I can tell. How can I generate my
form values the best way?

also

my other problem is in verifying if the check box has been checked

first I do this in the form function

session.browser = form.vars.browser
session.pageDepth = form.vars.pageDepth

then I am trying to use has_key in my logic function but it always
returns true

if session.has_key("browser"):
myDimensions.append("browser")


Any ideas would be appreciated Cheers

:D


Andrew


[web2py] Re: Form Checkbox how to Use efectively

2010-05-14 Thread Andrew Evans
Hello I have been doing research and still trying to figure how to check if
a check box is checked

This is what I have but it doesn't work.. I think the values are not passed

myDimensions = []
if session.browser and session.browser == "on":
myDimensions.append("browser")
myMetrics = []
if session.pageviews and session.pageviews == "on":
myMetrics.append("pageviews")
if session.newVisits and session.newVisits == "on":
myMetrics.append("newVisits")


Any idea how to check for a value in a check box

Cheers

Andrew


Re: [web2py] Re: Do you use web2py in your company?

2010-05-14 Thread Andrew Evans
Hi I just started using web2py

But I am hoping to integrate it in to my company. I own a web dev company
currently we are using PHP but I hope to fully integrate web2py on our two
dedicated, two vservers and our web sites

I must say I love this Framework :-P

*cheers

Andrew


[web2py] Re: Form Checkbox how to Use efectively

2010-05-17 Thread Andrew Evans
Ok I figured it out for reference I will post here

to check if a checkbox has been checked do this

if session.the_checkbox_name == "on":
expression


Cheers

Andrew


On Fri, May 14, 2010 at 1:32 PM, Andrew Evans wrote:

> Hello I have been doing research and still trying to figure how to check if
> a check box is checked
>
> This is what I have but it doesn't work.. I think the values are not passed
>
> myDimensions = []
> if session.browser and session.browser == "on":
> myDimensions.append("browser")
> myMetrics = []
> if session.pageviews and session.pageviews == "on":
> myMetrics.append("pageviews")
> if session.newVisits and session.newVisits == "on":
> myMetrics.append("newVisits")
>
>
> Any idea how to check for a value in a check box
>
> Cheers
>
> Andrew
>
>


Re: [web2py] Re: AttributeError: 'Expression' object has no attribute 'strip'

2010-09-12 Thread Andrew Evans
I am trying to make another table that uses those values from the
add_product table

ty for the fast reply :-)

here is my sql layout

db.define_table('category',
SQLField('name'),
SQLField('headline',length=512))


db.define_table('add_product',
SQLField('name'),
SQLField('category',db.category, requires=IS_IN_DB(db.category.id,
db.category.name)),
SQLField('description', 'text'),
SQLField('image','upload',default=''),
SQLField('quantity','integer',default=0),
SQLField('price','double',default=1.00))

db.define_table('product',
SQLField('name',db.add_product.name),
SQLField('category',db.category, requires=IS_IN_DB(db.category.id,
db.category.name)),
SQLField('description',db.add_product.description),
SQLField('small_image','upload'),
SQLField('large_image','upload',db.add_product.image),
SQLField('quantity','integer',db.add_product.quantity),
SQLField('price','double',db.add_product.price))



On Sun, Sep 12, 2010 at 2:33 PM, mdipierro  wrote:

> what do you mean by?
>
>  SQLField('price','double',db.add_product.price)
>
> I think this should just be
>
>  Field('price','double')
>
> and same for the other fields:
>
> db.define_table('product',
>SQLField('name'),
>SQLField('category',db.category,
> requires=IS_IN_DB(db,db.category.id,'%(name)s')),
>SQLField('description'),
>SQLField('small_image','upload'),
>SQLField('large_image','upload'),
>SQLField('quantity','integer'),
>SQLField('price','double'))
>
>
>
> On Sep 12, 4:11 pm, ukolo  wrote:
> > Receiving the following error in my DB Setup and can't figure it out
> >
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 186, in restricted
> > exec ccode in environment
> >   File "/home/www-data/web2py/applications/Working/models/db.py", line
> > 60, in 
> > SQLField('price','double',db.add_product.price))
> >   File "gluon/sql.py", line 1359, in define_table
> > t._create(migrate=migrate, fake_migrate=fake_migrate)
> >   File "gluon/sql.py", line 1716, in _create
> > referenced = field.type[10:].strip()
> > AttributeError: 'Expression' object has no attribute 'strip'
> >
> > this is the table
> >
> > db.define_table('product',
> > SQLField('name',db.add_product.name),
> > SQLField('category',db.category, requires=IS_IN_DB(db.category.id,
> > db.category.name)),
> > SQLField('description',db.add_product.description),
> > SQLField('small_image','upload'),
> > SQLField('large_image','upload',db.add_product.image),
> > SQLField('quantity','integer',db.add_product.quantity),
> > SQLField('price','double',db.add_product.price))
> >
> > Any help would be appreciated
>


[web2py] Re: TypeError: sequence item 1: expected string, Field found

2010-09-13 Thread Andrew Evans
Sorry that title is the error I would see when trying to access the default
value of first_name

On Mon, Sep 13, 2010 at 9:26 PM, ukolo  wrote:

> Hello
>
> I am trying to access this and other fields
>
> db.define_table(
>auth.settings.table_user_name,
>Field('first_name', length=128, default=''),
>
> from this table
>
> db.define_table('product',
>Field('user', custom_auth_table,
> default=custom_auth_table.first_name, readable=False, writable=False),
>
> I am trying to figure out why I can't pull first_name or other values
> from my data
>
> {{for row in rows:}}
>
>  {{=row.user}}
>
> Ultimately I would like to be able to use other values also like
>
>  {{=row.user.custom_auth_table.last_name}}
>
> or
>
> {{=row.user.custom_auth_table.email}}
>
> How can I do this?
>
> Any ideas *cheers


[web2py] Trying to solve a problem

2010-09-14 Thread Andrew Evans
I have a custom auth table

I set a variable to something like this: custom_auth_table =
db[auth.settings.table_user_name] # get the custom_auth_table

I then define a product table

db.define_table('product',
Field('product_name',length=512),
Field('user',custom_auth_table, readable=False, writable=False),

custom_auth_table is set to the user field in there

I then set user fields default value to first_name from the auth table

db.product.user.default = custom_auth_table.first_name

But when I try to add a product to the product db from my SQLForm I get an
error message. Any idea what could be wrong?

*cheers


[web2py] Can web2py connect to a FileMaker db

2010-09-16 Thread Andrew Evans
is it possible to have web2py use a FileMaker database? Can I use the
PyFilemaker module if no, I don't see why not but any suggestions before
hand would be great

ty :-)

*cheers


[web2py] [Pagination] need a bit of help

2010-10-01 Thread Andrew Evans
Hello I am trying to create some pagination for my site I am building.
However this pagination is a bit messed up, (I forget exactly where I found
it) when I click next it doesn't display anything else in the database.

Also a few other things are rather odd about it.

Does anyone have some good solid working pagination they can share with me

*cheers

Here is the code

def index():
if len(request.args):
page=int(request.args[0])
else:
page=0
items_per_page=2
limitby=(page*items_per_page,(page+1)*items_per_page + 1)
rows=db().select(db.product.ALL, orderby=db.product.product_name,
groupby=db.product.category, limitby=limitby)
return dict(rows=rows,page=page,items_per_page=items_per_page)
--


{{i = i+1}}
{{pass}}




{{if page:}}


previous

{{pass}}


{{if len(rows)>=items_per_page:}}


next
{{pass}}






Re: [web2py] Re: need a bit of help

2010-10-01 Thread Andrew Evans
Ok that pagination works better.

But for some reason the last entry in the db is always cut any ideas?
probably something I am doing but would appreciate some help

*cheers

here is the code

thank you for the help thus far

def index():
if len(request.args):
   page=int(request.args[0])
else:
   page=0
query=db.product.id>0
rows=db(query).select(db.product.ALL, orderby=db.product.product_name,
groupby=db.product.category, limitby=(page,page+1))
backward=A('previous', _href=URL(r=request,args=[page-1])) if page else
''
forward=A('next', _href=URL(r=request,args=[page+1])) if len(rows) else
''
return dict(rows=rows,backward=backward,forward=forward)

Cheers

Andrew


On Fri, Oct 1, 2010 at 3:19 PM, mdipierro  wrote:

> Try this:
>
> http://www.web2py.com/AlterEgo/default/show/63
>
> On Oct 1, 4:41 pm, Andrew Evans  wrote:
> > Hello I am trying to create some pagination for my site I am building.
> > However this pagination is a bit messed up, (I forget exactly where I
> found
> > it) when I click next it doesn't display anything else in the database.
> >
> > Also a few other things are rather odd about it.
> >
> > Does anyone have some good solid working pagination they can share with
> me
> >
> > *cheers
> >
> > Here is the code
> >
> > def index():
> > if len(request.args):
> > page=int(request.args[0])
> > else:
> > page=0
> > items_per_page=2
> > limitby=(page*items_per_page,(page+1)*items_per_page + 1)
> > rows=db().select(db.product.ALL, orderby=db.product.product_name,
> > groupby=db.product.category, limitby=limitby)
> > return dict(rows=rows,page=page,items_per_page=items_per_page)
> >
> --
> >
> > {{i = i+1}}
> > {{pass}}
> >
> > 
> > 
> >
> > {{if page:}}
> > 
> >
> > previous
> >
> > {{pass}}
> > 
> >
> > {{if len(rows)>=items_per_page:}}
> > 
> >
> > next
> > {{pass}}
> >
> > 
> > 
> > 
>


Re: [web2py] Re: need a bit of help

2010-10-01 Thread Andrew Evans
also there was a syntax error in that code don't know if you want to fix
it..

These two lines needed to close the A function

backward=A('previous', _href=URL(r=request,args=[page-1])) if page else ''
forward=A('next', _href=URL(r=request,args=[page+1])) if len(rows) else
''

in the example they weren't anyway ty




On Fri, Oct 1, 2010 at 4:36 PM, Andrew Evans  wrote:

> Ok that pagination works better.
>
> But for some reason the last entry in the db is always cut any ideas?
> probably something I am doing but would appreciate some help
>
> *cheers
>
> here is the code
>
> thank you for the help thus far
>
>
> def index():
> if len(request.args):
>page=int(request.args[0])
> else:
>page=0
> query=db.product.id>0
> rows=db(query).select(db.product.ALL, orderby=db.product.product_name,
> groupby=db.product.category, limitby=(page,page+1))
> backward=A('previous', _href=URL(r=request,args=[page-1])) if page else
> ''
> forward=A('next', _href=URL(r=request,args=[page+1])) if len(rows) else
> ''
> return dict(rows=rows,backward=backward,forward=forward)
>
> Cheers
>
> Andrew
>
>
>
> On Fri, Oct 1, 2010 at 3:19 PM, mdipierro  wrote:
>
>> Try this:
>>
>> http://www.web2py.com/AlterEgo/default/show/63
>>
>> On Oct 1, 4:41 pm, Andrew Evans  wrote:
>> > Hello I am trying to create some pagination for my site I am building.
>> > However this pagination is a bit messed up, (I forget exactly where I
>> found
>> > it) when I click next it doesn't display anything else in the database.
>> >
>> > Also a few other things are rather odd about it.
>> >
>> > Does anyone have some good solid working pagination they can share with
>> me
>> >
>> > *cheers
>> >
>> > Here is the code
>> >
>> > def index():
>> > if len(request.args):
>> > page=int(request.args[0])
>> > else:
>> > page=0
>> > items_per_page=2
>> > limitby=(page*items_per_page,(page+1)*items_per_page + 1)
>> > rows=db().select(db.product.ALL, orderby=db.product.product_name,
>> > groupby=db.product.category, limitby=limitby)
>> > return dict(rows=rows,page=page,items_per_page=items_per_page)
>> >
>> --
>> >
>> > {{i = i+1}}
>> > {{pass}}
>> >
>> > 
>> > 
>> >
>> > {{if page:}}
>> > 
>> >
>> > previous
>> >
>> > {{pass}}
>> > 
>> >
>> > {{if len(rows)>=items_per_page:}}
>> > 
>> >
>> > next
>> > {{pass}}
>> >
>> > 
>> > 
>> > 
>>
>
>


[web2py] Building Rows and Columns

2010-10-03 Thread Andrew Evans
Hello all

I am facing a challenge in my code for some reason the logic to generate a
group of div tags in a 3 by 3 column is eluding me

here is my code I am missing something can anyone help

if you can help by showing me a way to avoid using tables that would be
great if not and end up using tables thats fine to

{{counter = 0}}
Displaying Current Products

{{i = 1}}

{{for row in rows:}}
{{if counter == 0:}}

{{pass}}




{{=i}} . {{=A(row.product_name,
_href=URL('indv_product', args=row.id))}} 










{{if counter == 3:}}

{{pass}}

{{counter += 1}}

{{if counter == 4:}}
{{counter = 0}}
{{pass}}


{{pass}}



*cheers


Re: [web2py] Re: Building Rows and Columns

2010-10-03 Thread Andrew Evans
hey ty that gives me a good start

*Cheers


[web2py] How to loop through two items

2010-10-03 Thread Andrew Evans
I am trying to use two database values returned in my function

If I use two loops (one inside another) it repeats itself for a single item
for how many items are in the database, I think its cause of the two loops

So I am trying to combine the loops into one

{{for (stuff, products) in (userstuff, product):}}

But I am unsure how to do this

Any ideas

Or is there anyway to use the values in the view with out using a for loop
and looping in general that may be best

*cheers


Re: [web2py] How to loop through two items

2010-10-04 Thread Andrew Evans
hey ty worked great

*cheers


[web2py] Pagination Issues [web2py_utils]

2010-10-04 Thread Andrew Evans
Hello I am having problems integrating my query in to my paginate code using
web2py_utils.

query = db(db.product.id > 0).select(db.product.ALL,
groupby=db.product.category)
orderby = db.product.product_name
pcache = (cache.ram, 15)
paginate = Pagination(db, query, orderby,
display_count=9, cache=pcache, r=request,
res=response)

# Now we get our subset.
rows=paginate.get_set(set_links=True)

this query does not work but if I use

query = db.product.id > 0

it works no problem

Something I am not doing right.. My first query does work with out the
pagination

Any ideas *cheers


Re: [web2py] CRITICAL IMPORTANCE

2010-10-04 Thread Andrew Evans
What can I do to help?

*cheers



On Mon, Oct 4, 2010 at 10:19 AM, mdipierro  wrote:

> Please help me update
>
> http://www.appliedstacks.com/NewestFirst/web2py
>
> Massimo


[web2py] make two queries into one [need help]

2010-10-13 Thread Andrew Evans
How can I make these two queries into one cause when I use them in my view
(htmll) it doesn't work as expected


product=db(db.product.id == this_page).select(db.product.ALL)

userstuff=db(db.user_extended.userinfo ==
db.product.userinfo).select(db.user_extended.ALL)


this is what I am doing

{{for stuff, products in zip(userstuff, product):}}

if anyone has suggestions on how I can get this to work. Currently the user
stuff value always returns the first entry in the db regardless of which
user I select

Any ideas

*cheers

Andrew


Re: [web2py] Re: make two queries into one [need help]

2010-10-13 Thread Andrew Evans
Hello ty for replying

this is the function

def indv_product():
this_page = request.args(0)
product=db(db.product.id == this_page).select(db.product.ALL)
product_e=db(db.product_extended.product ==
this_page).select(db.product_extended.ALL)
userstuff=db(db.user_extended.userinfo ==
db.product.userinfo).select(db.user_extended.ALL)
return dict(product=product,product_e=product_e,userstuff=userstuff)

I use a link

{=A(row.product_name,
_href=URL('display', 'indv_product', args=row.id))}}

then call the values of data

{{for stuff, products in zip(userstuff, product):}}

{{=stuff.country}}

{{=products.category}}


the value passed to products but the values being passed to stuff return the
first entry in the db not sure what I am doing wrong cause I had it working
before

Maybe not...

Cheers on the advice :D


On Wed, Oct 13, 2010 at 11:46 AM, mdipierro  wrote:

> I think you want this:
>
> product= db.product(this_page)
> userstuff=db(db.user_extended.userinfo==product.userinfo).select()
>
> But I am not sure. Can you explain us more?
>
>
> On Oct 13, 11:13 am, Andrew Evans  wrote:
> > How can I make these two queries into one cause when I use them in my
> view
> > (htmll) it doesn't work as expected
> >
> > product=db(db.product.id == this_page).select(db.product.ALL)
> >
> > userstuff=db(db.user_extended.userinfo ==
> > db.product.userinfo).select(db.user_extended.ALL)
> >
> > this is what I am doing
> >
> > {{for stuff, products in zip(userstuff, product):}}
> >
> > if anyone has suggestions on how I can get this to work. Currently the
> user
> > stuff value always returns the first entry in the db regardless of which
> > user I select
> >
> > Any ideas
> >
> > *cheers
> >
> > Andrew
>


Re: [web2py] Re: make two queries into one [need help]

2010-10-14 Thread Andrew Evans
Hi yes the zip was used as a way to loop through both sets of data as was
recommended to me

this is the db structure for product

db.define_table('product',
Field('product_name',length=32,comment='Name of your product'),
Field('userinfo', db.auth_user, default=auth.user_id, readable=False,
writable=False),
Field('category',db.category, requires=IS_IN_DB(db,db.category.id
,'%(name)s')),
Field('description','text',requires=IS_NOT_EMPTY(),comment='Description
of your product'),
Field('image','upload',requires=IS_NOT_EMPTY(),comment='Image of your
product'),
Field('contact',default='[email]',requires=IS_EMAIL(),comment='Contact
Information for this product (email or phone etc)'),
Field('quantity','integer',default=1,comment='How Many products are in
stock'),
Field('tax_rate','double',default=0.14,writable=False),
Field('price','double',default=1.00,comment='cost of this product'),
Field('currency', db.currency_paypal, requires=IS_IN_DB(db,
db.currency_paypal.id,'%(current)s')))


here is the user_extended db structure

db.define_table('user_extended',
Field('userinfo', db.auth_user, default=auth.user_id,unique=True,
readable=False, writable=False),
Field('profile_name',length=32,label="User Profile Name",comment='User
Profile Name'),
Field('logo',length=32,label="Logo",comment='Avatar'),
Field('country',requires=IS_IN_SET(COUNTRIES),comment='Country
Location'),
Field('city',comment='City'),
Field('state',comment='State'),
Field('age','integer',length=2,comment='Age'),
Field('email',label="Public Email",requires=IS_EMAIL(),comment='Public
Email'),
Field('address',requires=IS_NOT_EMPTY(),comment='Address(Store
Locator)'),
Field('phone',length=11,comment='Business Phone'),
Field('image','upload',comment='Image of yourself'),
Field('description','text',label="About
Me",requires=IS_NOT_EMPTY(),comment='About Me'))


basically I want to use both tables. So when you click the product link it
goes to a page showing data from both these tables

the zip() was used to loop through the data so that I didn't have to embed a
for loop inside each other because that caused problems

*cheers

and ty for the help


Re: [web2py] Re: make two queries into one [need help]

2010-10-15 Thread Andrew Evans
Hi ty for replying to my problem but I am a bit confused. I tried doing the
query you suggested and tried doing it another way

it seems my loop is never executed cause what appears there is a blank page.

Not sure what I am doing wrong

Those are the two I tried

def indv_product():
this_page = request.args(0)

user_products = db((db.product.id == this_page) &
(db.product_extended.product == this_page) & (db.user_extended.userinfo ==
db.product.userinfo)).select()
return dict(user_products=user_products)


def indv_product():
this_page = request.args(0)
user_products = db((db.product.id == this_page) & (db.product.id ==
db.product_extended.product) & (db.product.userinfo ==
db.user_extended.userinfo)).select()
return dict(user_products=user_products)

But it seems the loop doesn't work any idea

this is what I am using

{{for row in user_products:}}

and an example of how I am using row
{{=row.description}}

The html doesn't even appear in the view source of my browser so I am doing
something wrong

*cheers


Re: [web2py] Re: make two queries into one [need help]

2010-10-16 Thread Andrew Evans
Hello ty for the continued help. I did as you suggested and I saw the table
headers but none of the Data. I tried the function you suggested also.

Does that mean its a controller problem

Any ideas

*cheers



On Sat, Oct 16, 2010 at 12:14 AM, ron_m  wrote:

> A couple of things
>
> Put this in for the view html file temporarily
>
> {{extend 'layout.html'}}
> 
> {{=H2('Results')}}
> {{=SQLTABLE(user_products,
>   headers='fieldname:capitalize',
>   truncate=100)
> }}
>
> and you should see a nicely formatted table of the results of the
> query with the column names in the table header.
>
> This will prove whether or not you are getting data in user_products.
> If you see the expected results in the table then it is a view
> problem. If the table is blank it is a controller problem.
>
> Did you put a {{pass}} line at the point where the {{for row in
> user_products:}} iteration loop should end? Indentation follows HTML
> not Python rules in the {{}} code segments so pass is used to signal
> the end of a block in this case "for".
>
> http://web2py.com/book/default/chapter/05
>
> Ron
>
> On Oct 15, 11:29 pm, Andrew Evans  wrote:
> > Hi ty for replying to my problem but I am a bit confused. I tried doing
> the
> > query you suggested and tried doing it another way
> >
> > it seems my loop is never executed cause what appears there is a blank
> page.
> >
> > Not sure what I am doing wrong
> >
> > Those are the two I tried
> >
> > def indv_product():
> > this_page = request.args(0)
> >
> > user_products = db((db.product.id == this_page) &
> > (db.product_extended.product == this_page) & (db.user_extended.userinfo
> ==
> > db.product.userinfo)).select()
> > return dict(user_products=user_products)
> >
> > def indv_product():
> > this_page = request.args(0)
> > user_products = db((db.product.id == this_page) & (db.product.id ==
> > db.product_extended.product) & (db.product.userinfo ==
> > db.user_extended.userinfo)).select()
> > return dict(user_products=user_products)
> >
> > But it seems the loop doesn't work any idea
> >
> > this is what I am using
> >
> > {{for row in user_products:}}
> >
> > and an example of how I am using row
> >  > alt="{{=row.product_name}}" width="400" height="425"
> > />{{=row.description}}
> >
> > The html doesn't even appear in the view source of my browser so I am
> doing
> > something wrong
> >
> > *cheers
>


Re: [web2py] Re: make two queries into one [need help]

2010-10-17 Thread Andrew Evans
what more of the application do you need to see, which parts?

OS is Debian Lenny, Python 2.5 and the database is the default with web2py
SQLite I believe.

Will post my controller and views maybe that will help solve this

Controller

###Display.py###
###
# Display Indiviual Product
###

#def indv_product():
#this_page = request.args(0)

#user_products = db((db.product.id == this_page) &
(db.product_extended.product == this_page) & #(db.user_extended.userinfo ==
db.product.userinfo)).select()
#return dict(user_products=user_products)


def indv_product():
this_page = request.args(0)
user_products = db((db.product.id == this_page) & (db.product.id ==
db.product_extended.product) & (db.product.userinfo ==
db.user_extended.userinfo)).select()
#product_e=db(db.product_extended.product ==
this_page).select(db.product_extended.ALL)
return dict(user_products=user_products)


This is my view index.html where I pass args to where I am calling the
function... I never posted the whole html file

{{=A(row.product_name,
_href=URL('display', 'indv_product', args=row.id))}}

and here is the is the indv_ptrdouct.html

{{for row in user_products:}}

and example of data


 
{{=row.logo}}
 

{{pass}}

You can see the site @ www.em-ecommerce.com/Working/display/index to see
whats happening

*cheers


Andrew


On Sun, Oct 17, 2010 at 1:58 AM, ron_m  wrote:

> After rereading the posts I realize you might be running the db calls
> in the view so the controller comment would be incorrect. Bottom line,
> there is no data to display from what you are telling me about the
> result of the last test. Is it possible to check the database and look
> at the data in the tables for a particular product id you are using
> for testing to be sure all the foreign keys are in place in the
> related tables. What environment are you running on? OS, Python
> version, database used? It is difficult to figure out the problem
> without seeing more of the application.
>
> Ron
>
> On Oct 16, 11:02 am, Andrew Evans  wrote:
> > Hello ty for the continued help. I did as you suggested and I saw the
> table
> > headers but none of the Data. I tried the function you suggested also.
> >
> > Does that mean its a controller problem
> >
> > Any ideas
> >
> > *cheers
> >
> > On Sat, Oct 16, 2010 at 12:14 AM, ron_m  wrote:
> > > A couple of things
> >
> > > Put this in for the view html file temporarily
> >
> > > {{extend 'layout.html'}}
> > > 
> > > {{=H2('Results')}}
> > > {{=SQLTABLE(user_products,
> > >   headers='fieldname:capitalize',
> > >   truncate=100)
> > > }}
> >
> > > and you should see a nicely formatted table of the results of the
> > > query with the column names in the table header.
> >
> > > This will prove whether or not you are getting data in user_products.
> > > If you see the expected results in the table then it is a view
> > > problem. If the table is blank it is a controller problem.
> >
> > > Did you put a {{pass}} line at the point where the {{for row in
> > > user_products:}} iteration loop should end? Indentation follows HTML
> > > not Python rules in the {{}} code segments so pass is used to signal
> > > the end of a block in this case "for".
> >
> > >http://web2py.com/book/default/chapter/05
> >
> > > Ron
> >
> > > On Oct 15, 11:29 pm, Andrew Evans  wrote:
> > > > Hi ty for replying to my problem but I am a bit confused. I tried
> doing
> > > the
> > > > query you suggested and tried doing it another way
> >
> > > > it seems my loop is never executed cause what appears there is a
> blank
> > > page.
> >
> > > > Not sure what I am doing wrong
> >
> > > > Those are the two I tried
> >
> > > > def indv_product():
> > > > this_page = request.args(0)
> >
> > > > user_products = db((db.product.id == this_page) &
> > > > (db.product_extended.product == this_page) &
> (db.user_extended.userinfo
> > > ==
> > > > db.product.userinfo)).select()
> > > > return dict(user_products=user_products)
> >
> > > > def indv_product():
> > > > this_page = request.args(0)
> > > > user_products = db((db.product.id == this_page) & (db.product.id==
> > > > db.product_extended.product) & (db.product.userinfo ==
> > > > db.user_extended.userinfo)).select()
> > > > return dict(user_products=user_products)
> >
> > > > But it seems the loop doesn't work any idea
> >
> > > > this is what I am using
> >
> > > > {{for row in user_products:}}
> >
> > > > and an example of how I am using row
> > > >  > > > alt="{{=row.product_name}}" width="400" height="425"
> > > > />{{=row.description}}
> >
> > > > The html doesn't even appear in the view source of my browser so I am
> > > doing
> > > > something wrong
> >
> > > > *cheers
> >
> >
>


[web2py] cache.ram Name error

2010-10-17 Thread Andrew Evans
having problems using the cache feature in my code and can't figure out how
to import it

  File "applications/Working/modules/logging.py", line 20, in 
NameError: name 'cache' is not defined


this is in a Module file I created any ideas how to import it?


Re: [web2py] Re: make two queries into one [need help]

2010-10-17 Thread Andrew Evans
Hi ty for all your help ron and sorry I couldn't explain myself better
mdipierro

Ron if you could attach that file that would be great just so I can see what
your getting at.. maybe I am to tired to understand it right now haha anyway

if you get a chance attach the file

*cheers

and ty for your continued help

*cheers



On Sun, Oct 17, 2010 at 1:25 PM, mdipierro  wrote:

> Hi Andrew,
>
> it is difficult to help you without an explanation in english of what
> you want. Cannot figure out from your code:
>
>  def indv_product():
>  this_page = request.args(0)
>  user_products = db((db.product.id == this_page) & \
> (db.product.id == db.product_extended.product) & \
> (db.product.userinfo == db.user_extended.userinfo)).select()
>  product_e=db(db.product_extended.product ==
> this_page).select(db.product_extended.ALL)
>  return dict(user_products=user_products)
>
> Here is why:
> From
>   this_page = request.args(0)
> and
>   (db.product.id == this_page)
> I assume you want to display something about one specific product.
>
> Yet the query seems to indicate that you want to display more than one
> product (user_products)
>
> What is product.userinfo? Is this the buyer or the seller of the
> product?
>
> Are you trying to display all products bought by one user, along with
> detailed information about both the buyer and the product? Are you
> trying to display detailed information about one single product?
>
>
>
>
>


Re: [web2py] Re: cache.ram Name error

2010-10-17 Thread Andrew Evans
I was following some information trying to figure out this logging system

please explain how to do it with this code

import logging
from logging.handlers import SysLogHandler

def _init_log():
logger = logging.getLogger(request.application)
logger.setLevel(logging.DEBUG)
handler = SysLogHandler(address='/dev/log')
handler.setLevel(logging.DEBUG)
handler.setFormatter(logging.Formatter('%s' % request.application +
'[%(process)d]: %(levelname)s: %(filename)s at line %(lineno)d:
%(message)s'))
logger.addHandler(handler)
return logger

app_logging=cache.ram('once',lambda:_init_log(),time_expire=)


Re: [web2py] Re: cache.ram Name error

2010-10-17 Thread Andrew Evans
is there already a logging system in place I can use form the looks of it
there is...

Forgive my noobishness


[web2py] Paypal Digital Download

2010-10-31 Thread Andrew Evans
Hello! I am working on a project that requires a Digital Download where the
download is provided after the payment has been sent to paypal.

The documentation on Paypal in web2py is very confusing and I don't know if
its for the purpose of what I need. I am generating a paypal/button for
express checkout. and I am trying to think of ways I can then redirect the
user to a page where they can download the product

Normally this would be simpler but I have multiple people selling there
different products and with that multiple products

here is my paypal code


https://www.paypal.com/cgi-bin/webscr";
method="post">









http://www.paypal.com/en_US/i/btn/btn_buynow_SM.gif";
border="0" name="submit" alt="Make payments with PayPal - it's fast, free
and secure!">


So my question is: How can I use paypal for a digital download using the
express checkout button? Do I need to create an IPN class and add notify_url
to my paypal code if so can some one provide an example

*cheers

and ty

Andrew


[web2py] Custom Authentication Template

2010-11-03 Thread Andrew Evans
How can I implement my own html template for the authentication/login to use
throughout my site. I thought about redirecting it but that doesn't make
sense... any ideas


Re: [web2py] Re: Custom Authentication Template

2010-11-04 Thread Andrew Evans
hey ty very much :-)

On Wed, Nov 3, 2010 at 6:23 PM, mdipierro  wrote:

> errata
>
> views/default/user.html
>
> On Nov 3, 6:51 pm, Andrew Evans  wrote:
> > How can I implement my own html template for the authentication/login to
> use
> > throughout my site. I thought about redirecting it but that doesn't make
> > sense... any ideas
>


[web2py] Create an Image from webpage

2010-11-07 Thread Andrew Evans
Hello!

I was wondering if anyone could recommend a method for creating an image
from a web site using web2py.

For example say someone enters a url in a form the script executes and grabs
an image/screen shot of the web site entered in the form.

Any ideas

Cheers


[web2py] Pagination [Web2py Utils] returns None

2010-11-10 Thread Andrew Evans
Hello I am trying to create some pagination on my comments page everything
seems to be working, however when I click the next link it goes to a page
that all it says is None

Anyone know why this is happening and how to fix it

There are entries in the db.

Thanks in Advance

below is my code

*cheers


def product_wall():
this_page = request.args(0)
product=db(db.product.id == this_page).select(db.product.ALL)
for products in product:
#comments=db(db.comment.product == this_page).select(db.comment.ALL)
comments=db.comment.product == this_page
orderby = ~db.comment.id
pcache = (cache.ram, 15)
stars = StarRatingWidget(single_vote=True)
db.comment.rating.widget = stars.widget

db.comment.product.default = products.id
form = SQLFORM(db.comment)
db.comment.product.id = products.id
if form.accepts(request.vars,session):
response.flash = 'Your Comment has been submitted'
paginate =
Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response)
rows=paginate.get_set(set_links=True)
return dict(comments=rows,form=form,products=products)
elif form.errors:
response.flash = 'Please correct your error'
paginate =
Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response)
rows=paginate.get_set(set_links=True)
return dict(comments=rows,form=form,products=products)
else:
paginate =
Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response)
rows=paginate.get_set(set_links=True)
return dict(comments=rows,form=form,products=products)


[web2py] Re: Pagination [Web2py Utils] returns None

2010-11-10 Thread Andrew Evans
I just noticed the difference in URLs

https://127.0.0.1:8000/Working/display/product_wall/4056

above is the comments on the product notice the id.

below is the next link of the pagination

https://www.127.0.0.1:8000/Working/display/product_wall?p=5

it loses the 4056 which is the id of the product

I think it may have to do with response value. Any ideas?



On Wed, Nov 10, 2010 at 9:04 AM, Andrew Evans  wrote:

> Hello I am trying to create some pagination on my comments page everything
> seems to be working, however when I click the next link it goes to a page
> that all it says is None
>
> Anyone know why this is happening and how to fix it
>
> There are entries in the db.
>
> Thanks in Advance
>
> below is my code
>
> *cheers
>
>
> def product_wall():
> this_page = request.args(0)
> product=db(db.product.id == this_page).select(db.product.ALL)
> for products in product:
> #comments=db(db.comment.product ==
> this_page).select(db.comment.ALL)
> comments=db.comment.product == this_page
> orderby = ~db.comment.id
> pcache = (cache.ram, 15)
> stars = StarRatingWidget(single_vote=True)
> db.comment.rating.widget = stars.widget
>
> db.comment.product.default = products.id
> form = SQLFORM(db.comment)
> db.comment.product.id = products.id
> if form.accepts(request.vars,session):
> response.flash = 'Your Comment has been submitted'
> paginate =
> Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response)
> rows=paginate.get_set(set_links=True)
> return dict(comments=rows,form=form,products=products)
> elif form.errors:
> response.flash = 'Please correct your error'
> paginate =
> Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response)
> rows=paginate.get_set(set_links=True)
> return dict(comments=rows,form=form,products=products)
> else:
> paginate =
> Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response)
> rows=paginate.get_set(set_links=True)
> return dict(comments=rows,form=form,products=products)
>
>
>


Re: [web2py] Re: Pagination [Web2py Utils] returns None

2010-11-11 Thread Andrew Evans
Hello ty for the reply

You wouldn't by chance be able to help me with a patch. Your talking about
the paginate.py file to patch set_links in there or with in the set_links
value in my code?

Your the developer of Web2py Utils is that correct?

Nice work on it :D

*cheers

Andrew


On Wed, Nov 10, 2010 at 5:24 PM, Thadeus Burgess wrote:

> Its losing the args when it creates a new URL. It will require a patch on
> set_links so you can pass custom args and vars to URL.
>
> --
> Thadeus
>
>
>
>
>
> On Wed, Nov 10, 2010 at 4:36 PM, Andrew Evans  wrote:
>
>> I just noticed the difference in URLs
>>
>> https://127.0.0.1:8000/Working/display/product_wall/4056
>>
>> above is the comments on the product notice the id.
>>
>> below is the next link of the pagination
>>
>> https://www.127.0.0.1:8000/Working/display/product_wall?p=5
>>
>> it loses the 4056 which is the id of the product
>>
>> I think it may have to do with response value. Any ideas?
>>
>>
>>
>> On Wed, Nov 10, 2010 at 9:04 AM, Andrew Evans wrote:
>>
>>> Hello I am trying to create some pagination on my comments page
>>> everything seems to be working, however when I click the next link it goes
>>> to a page that all it says is None
>>>
>>> Anyone know why this is happening and how to fix it
>>>
>>> There are entries in the db.
>>>
>>> Thanks in Advance
>>>
>>> below is my code
>>>
>>> *cheers
>>>
>>>
>>> def product_wall():
>>> this_page = request.args(0)
>>> product=db(db.product.id == this_page).select(db.product.ALL)
>>> for products in product:
>>> #comments=db(db.comment.product ==
>>> this_page).select(db.comment.ALL)
>>> comments=db.comment.product == this_page
>>> orderby = ~db.comment.id
>>> pcache = (cache.ram, 15)
>>> stars = StarRatingWidget(single_vote=True)
>>> db.comment.rating.widget = stars.widget
>>>
>>> db.comment.product.default = products.id
>>> form = SQLFORM(db.comment)
>>> db.comment.product.id = products.id
>>> if form.accepts(request.vars,session):
>>> response.flash = 'Your Comment has been submitted'
>>> paginate =
>>> Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response)
>>> rows=paginate.get_set(set_links=True)
>>> return dict(comments=rows,form=form,products=products)
>>> elif form.errors:
>>> response.flash = 'Please correct your error'
>>> paginate =
>>> Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response)
>>> rows=paginate.get_set(set_links=True)
>>> return dict(comments=rows,form=form,products=products)
>>> else:
>>> paginate =
>>> Pagination(db,comments,orderby,display_count=2,cache=pcache,r=request,res=response)
>>> rows=paginate.get_set(set_links=True)
>>> return dict(comments=rows,form=form,products=products)
>>>
>>>
>>>
>>
>


Re: [web2py] Re: Pagination [Web2py Utils] returns None

2010-11-11 Thread Andrew Evans
hey thanks for the tips

I have it working now

*cheers

Andrew


Re: [web2py] Re: Pagination [Web2py Utils] returns None

2010-11-12 Thread Andrew Evans
Hey Thadeus!

where would you like me to submit it? I can upload it here to this news
group. The only thing I changed was what you suggested ;) adding self.r.args
to the generate links function ;)


def generate_links(self):
self.backward = A('<< previous()', _href=URL(r=self.r,
args=self.r.args, vars={'p': self.current - self.display_count})) if
self.current else '<< previous(False)'
self.forward = A('next() >>', _href=URL(r=self.r, args=self.r.args,
vars={'p': self.current + self.display_count})) if self.total_results >
self.current + self.display_count else 'next(False) >>'
self.location = 'Showing %d to %d out of %d records' % (self.current
+ 1, self.current + self.num_results, self.total_results)
return (self.backward, self.forward, self.location)


Anyway I attached the paginate.py *cheers





On Thu, Nov 11, 2010 at 9:45 PM, Thadeus Burgess wrote:

> Mind sending me a patch?
>
> --
> Thadeus
>
>
>
>
>
> On Thu, Nov 11, 2010 at 6:02 PM, Andrew Evans  wrote:
>
>> hey thanks for the tips
>>
>> I have it working now
>>
>> *cheers
>>
>> Andrew
>>
>
>


paginate.py
Description: Binary data


[web2py] Get User [auth_user] Janrain

2010-11-23 Thread Andrew Evans
Hello I just set up Janrain using the following

from gluon.contrib.login_methods.rpx_account import RPXAccount
auth.settings.actions_disabled=['register','change_password','request_reset_password']
auth.settings.login_form = RPXAccount(request,
api_key='',
domain='..',
url = "http://localhost/%s/default/user/login"; % request.application)


I am trying to switch to using Janrain for my app

However I do not know how to get the auth_user field so I can refernce it in
some of my database fields for example

db.define_table('product',
Field('userinfo', db.auth_user, default=auth.user_id, readable=False,
writable=False),

I get an a key error in web2py *confused

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
  File "/home/www-data/web2py/applications/Working/models/db.py"
, line
72, in 
Field('userinfo', db.auth_user, default=auth.user_id,
readable=False, writable=False),
  File "/home/www-data/web2py/gluon/sql.py", line 1391, in __getattr__
return dict.__getitem__(self,key)
KeyError: 'auth_user'

any ideas *cheers

and ty :D


[web2py] Re: Get User [auth_user] Janrain

2010-11-24 Thread Andrew Evans
Ok I have gotten a bit further. I think form what I can tell I still need to
define my auth table

now I am getting an error

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
  File "/home/www-data/web2py/applications/Working/views/default/index.html",
line 15, in 
  File "/home/www-data/web2py/gluon/html.py", line 188, in URL
raise SyntaxError, 'not enough information to build the url'
SyntaxError: not enough information to build the url


Do I need to change some values some where any ideas

*cheers

PS This is my set up so far

# User Registration Information
db.define_table(
auth.settings.table_user_name,
Field('first_name', length=128, default=''),
Field('last_name', length=128, default=''),
Field('email', length=128, default=''),
Field('username', length=128, default='', unique=True),
Field('address', length=512, default=''),
   #Field('birthday', 'date'),
Field('password', 'password', length=512,
  readable=False, label='Password'),
Field('registration_key', length=512,
  writable=False, readable=False, default=''),
Field('reset_password_key', length=512,
  writable=False, readable=False, default=''),
Field('registration_id', length=512,
  writable=False, readable=False, default=''))


from gluon.contrib.login_methods.rpx_account import *
auth.settings.actions_disabled=['register','change_password','request_reset_password']
auth.settings.login_form = RPXAccount(request,
api_key='',
domain='.',
url = "http://domain/%s/default/user/login"; % request.application)


[web2py] Re: Get User [auth_user] Janrain

2010-11-24 Thread Andrew Evans
Ok I have gone full circle now

How can I get values from janrain into my code? This does not work!

db.define_table('user_extended',
Field('userinfo', db.auth_user, default=auth.user_id, readable=False,
writable=False,unique=True),

I need to change the db.auth_user value but to what? I have removed any set
up of auth now and only have the janrain code as it describes in the
documentation.

Anyway idea what I am doing wrong

*cheers


Re: [web2py] Re: Get User [auth_user] Janrain

2010-11-24 Thread Andrew Evans
Hello ty for the reply I created the auth_user table

but now I get this error when I try to access my login area

any ideas

*cheers

Traceback (most recent call last):
  File "/home/www-data/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
  File "/home/www-data/web2py/applications/Working/controllers/default.py"
,
line 190, in 
  File "/home/www-data/web2py/gluon/globals.py", line 96, in 
self._caller = lambda f: f()
  File "/home/www-data/web2py/applications/Working/controllers/default.py"
,
line 169, in user
return dict(form = auth())
  File "/home/www-data/web2py/gluon/tools.py", line 1023, in __call__
return self.login()
  File "/home/www-data/web2py/gluon/tools.py", line 1348, in login
elif 'username' in table_user.fields:
AttributeError: 'NoneType' object has no attribute 'fields'


Re: [web2py] Re: Get User [auth_user] Janrain

2010-11-24 Thread Andrew Evans
Hello I solved my error by adding auth.define_tables() to the mix

Janrain loads as expected except when I try to login. Any idea how to solve
this issue, I get the following error

Invalid argument: token_url domain not in whitelist


[web2py] token_url domain not in whitelist

2010-11-24 Thread Andrew Evans
Figured I would start a different post for this :-)

Don't know if there is a problem in my Janrain account or if it exists in
web2py

but I get the following error

token_url domain not in whitelist

my domains are set in janrain to www.em-ecommerce.com and www.suck-o.de

and my code is like this

from gluon.contrib.login_methods.rpx_account import RPXAccount
auth.settings.actions_disabled=['register','change_password','request_reset_password']
auth.settings.login_form = RPXAccount(request,
api_key='...',
domain='em',
url = "http://www.em-ecommmerce.com/%s/default/user/login"; %
request.application)

any ideas as to the error

*cheers


Re: [web2py] Re: token_url domain not in whitelist

2010-11-24 Thread Andrew Evans
hello ty for your help

I had mistyped the url in my code. But now I am faced with a new problem
when I log in it seems to work but then returns an "invalid request"
message.

Any ideas whats up

would this have to with routes?

*cheers


[web2py] Anyone willing to help out with Paypal

2010-11-25 Thread Andrew Evans
Hello just wondering if there is anyone out there willing to help out with
Paypal integration in a new system I am building. Its a subscription based
service that allows (should allow) users to sell digital goods by paypal.

The subscription part will also be handled by paypal :D

If some one is willing to help out. I could pay them 140 GBP... I know its
not much but if some one wants to help that would be great

email me or reply to this post if interested

*cheers

Andrew


Re: [web2py] Anyone willing to help out with Paypal

2010-11-25 Thread Andrew Evans
Hey ty Bruno

my project isn't quite ready to use paypal yet anyway, getting closer
though.. let me know your success

*cheers

Branko do you mean is it usable on my site for setting up I see no
reason why not :D

Thanks for the replies


Re: [web2py] Re: Anyone willing to help out with Paypal

2010-11-25 Thread Andrew Evans
hey thats good thinking.. To be honest I thought initially to have a vote
for this project and make a donation to the developer to create it...
PayPal module for web2py I mean

Wonder if its to late to do something like that

basically my idea was people would commit to paying x amount if the
developer(s) built it "x being there donation no set amount"

what do you all think?



On Thu, Nov 25, 2010 at 3:45 PM, mdmcginn wrote:

> I will pay another $200 US if someone develops a PayPal plugin/module
> for web2py that doesn't have to be described by the words
> "Experimental" or "Needs work."
>
> On Nov 25, 1:03 pm, Bruno Rocha  wrote:
> > I am implementing PayPal for a animal charity project (
> natalanimal.com.br),
> > now this project is receiving donations by PagSeguro (the bigger pay
> gateway
> > of Brazil), but we started to receive international donations, so I am
> > working on PayPal integrations right now.
> >
> > If I got success on integration, I'll contact you latter.
> >
> > 2010/11/25 Andrew Evans 
> >
> > > Hello just wondering if there is anyone out there willing to help out
> with
> > > Paypal integration in a new system I am building. Its a subscription
> based
> > > service that allows (should allow) users to sell digital goods by
> paypal.
> >
> > > The subscription part will also be handled by paypal :D
> >
> > > If some one is willing to help out. I could pay them 140 GBP... I know
> its
> > > not much but if some one wants to help that would be great
> >
> > > email me or reply to this post if interested
> >
> > > *cheers
> >
> > > Andrew
> >
> > --
> >
> > Bruno Rochahttp://about.me/rochacbruno/bio
>


Re: [web2py] Re: Anyone willing to help out with Paypal

2010-11-25 Thread Andrew Evans
For me I need a payed subscription service and a simple payment button that
after payment lets the user download a file (the file they purchased)


The subscription would give users access to the site so people could sell
there digital goods (via) the simple payment button :D

Anyway *cheers



On Thu, Nov 25, 2010 at 8:04 PM, mdipierro  wrote:

> Which features do people need?
>
> simple payment button?
> submission of shopping chart?
> digital content?
> handling for tax computations and shipping costs?
> receive paypal notification (like the user has canceled a payment)?
>
> Some things are easier than others. Some things may require a tight
> integration with your app and depends on details.
>
> On Nov 25, 5:45 pm, mdmcginn  wrote:
> > I will pay another $200 US if someone develops a PayPal plugin/module
> > for web2py that doesn't have to be described by the words
> > "Experimental" or "Needs work."
> >
> > On Nov 25, 1:03 pm, Bruno Rocha  wrote:
> >
> > > I am implementing PayPal for a animal charity project (
> natalanimal.com.br),
> > > now this project is receiving donations by PagSeguro (the bigger pay
> gateway
> > > of Brazil), but we started to receive international donations, so I am
> > > working on PayPal integrations right now.
> >
> > > If I got success on integration, I'll contact you latter.
> >
> > > 2010/11/25 Andrew Evans 
> >
> > > > Hello just wondering if there is anyone out there willing to help out
> with
> > > > Paypal integration in a new system I am building. Its a subscription
> based
> > > > service that allows (should allow) users to sell digital goods by
> paypal.
> >
> > > > The subscription part will also be handled by paypal :D
> >
> > > > If some one is willing to help out. I could pay them 140 GBP... I
> know its
> > > > not much but if some one wants to help that would be great
> >
> > > > email me or reply to this post if interested
> >
> > > > *cheers
> >
> > > > Andrew
> >
> > > --
> >
> > > Bruno Rochahttp://about.me/rochacbruno/bio
> >
> >
>


Re: [web2py] Re: Anyone willing to help out with Paypal

2010-11-26 Thread Andrew Evans
hello

I am interested in your code :D

Let me know when you are able to pull it out :D


[web2py] Add Youtube Video

2010-11-26 Thread Andrew Evans
How can I add a youtube video in web2py... Say a user in my blog submits a
form containing youtube video code how can I embed that code in the post?

*cheers


Re: [web2py] Re: Add Youtube Video

2010-11-26 Thread Andrew Evans
hey great ty very much this should work really well :D


[web2py] Display XML as HTML web2py

2010-12-04 Thread Andrew Evans
I am trying to display some XML that has been screen scraped I want to
display it as HTML in my code but for some reason its not working. It
appears in the HTML source code but not being displayed any ideas

Controller
-

def guildRoster():
url = 'http://www.wowarmory.com/guild-info.xml?r=Moon+Guard&gn=Zen'
header = { 'User-Agent' : 'Mozilla/5.0 Gecko/20070219 Firefox/2.0.0.2'}
req = urllib2.Request(url, '', header)
return dict(results=XML(urllib2.urlopen(req).read()))

View
-
{{extend 'site_template.html'}}

Guild Roster
{{=results}}




Cheers ty


Re: [web2py] Re: Display XML as HTML web2py

2010-12-05 Thread Andrew Evans
it does contain something that's the thing it displays the XML in my HTML
when I check the page source code just not displaying on the page *shrugs


http://www.zenmg.com/default/guildRoster


thats the page

Any ideas *cheers :D


[web2py] Apply CSS class to form Generated from DAL?

2010-12-05 Thread Andrew Evans
hello I am trying to do a few things apply a css class and some javascript
code to a form generated by DAL ( I believe DAL is the right terminology)

Basically I want to apply a CSS class to a form generated by web2pys SQLFORM
or CRUD

Any ideas

*cheers


Re: [web2py] Re: Apply CSS class to form Generated from DAL?

2010-12-05 Thread Andrew Evans
hmm ty that applied the class to the form I guess thats what I wrote But
I mean applying it to an element of the form like an input text tag

On Sun, Dec 5, 2010 at 6:49 PM, mr.freeze  wrote:

> Like this?:
> form = SQLFORM(db.thing, _class='myclass')
>
>
> On Dec 5, 8:45 pm, Andrew Evans  wrote:
> > hello I am trying to do a few things apply a css class and some
> javascript
> > code to a form generated by DAL ( I believe DAL is the right terminology)
> >
> > Basically I want to apply a CSS class to a form generated by web2pys
> SQLFORM
> > or CRUD
> >
> > Any ideas
> >
> > *cheers
>


Re: [web2py] Re: Apply CSS class to form Generated from DAL?

2010-12-06 Thread Andrew Evans
hey ty very much for that worked great :D



On Sun, Dec 5, 2010 at 7:15 PM, mdipierro  wrote:

> db.define_table('thing',Field('color'))
> form = SQLFORM(db.thing)
> form.element('input[name=color]')['_class']='myclass'
> ^ you can use jQuery notation to select elements
> (serverside)
>
>
> On Dec 5, 9:02 pm, Andrew Evans  wrote:
> > hmm ty that applied the class to the form I guess thats what I wrote
> But
> > I mean applying it to an element of the form like an input text tag
> >
> > On Sun, Dec 5, 2010 at 6:49 PM, mr.freeze  wrote:
> > > Like this?:
> > > form = SQLFORM(db.thing, _class='myclass')
> >
> > > On Dec 5, 8:45 pm, Andrew Evans  wrote:
> > > > hello I am trying to do a few things apply a css class and some
> > > javascript
> > > > code to a form generated by DAL ( I believe DAL is the right
> terminology)
> >
> > > > Basically I want to apply a CSS class to a form generated by web2pys
> > > SQLFORM
> > > > or CRUD
> >
> > > > Any ideas
> >
> > > > *cheers
> >
> >
>


[web2py] Limit Upload size and File type

2010-12-06 Thread Andrew Evans
Hello I am wondering if there is a way to limit the File type and upload
size in web2py

I have my db field named images and I want to specify just gif, jpg, png for
example :D

As well as a File Size any ideas

*cheers

PS Sorry if this question has been asked before but I couldn't find any info
on this

Thank you


[web2py] Re: Limit Upload size and File type

2010-12-06 Thread Andrew Evans
Nvm I found what I needed :-)

On Mon, Dec 6, 2010 at 10:37 AM, Andrew Evans  wrote:

> Hello I am wondering if there is a way to limit the File type and upload
> size in web2py
>
> I have my db field named images and I want to specify just gif, jpg, png
> for example :D
>
> As well as a File Size any ideas
>
> *cheers
>
> PS Sorry if this question has been asked before but I couldn't find any
> info on this
>
> Thank you
>
>
>


[web2py] Limit Posts to shorter length add continue reading link

2010-12-09 Thread Andrew Evans
Hello I am wondering if there is a way to limit the posts on my blog main
page to say 500 Characters and have a continue reading link from there on
each post.

This is my query it uses pagination :D

*def index():
#Collect all posts in the db and use pagination
query = db.posts.id > 0
orderby = ~db.posts.id
pcache = (cache.ram, 15)
paginate = Pagination(db, query, orderby, display_count=5, cache=pcache,
r=request, res=response)
# Now we get our subset.
rows=paginate.get_set(set_links=True)
return dict(rows=rows)*

and my db tables :-)

db.define_table('posts',
Field('userinfo', db.auth_user, default=auth.user_id, readable=False,
writable=False,unique=True),
Field('category',db.category, requires=IS_IN_DB(db,db.category.id
,'%(name)s')),

Field('created_on','datetime',default=datetime.datetime.today(),writable=False,readable=False),
Field('post_title', length=100, comment='Title of your post',
requires=IS_NOT_EMPTY()),
Field('post_body', 'text', requires=IS_NOT_EMPTY()),
Field('image','upload', label='Image', comment='(Max Size) 600px by
600px', autodelete=True, requires=IS_IMAGE(extensions=('png', 'gif', 'jpg'),
maxsize=(600, 600

Thank you for any advice :-)


Re: [web2py] Limit Posts to shorter length add continue reading link

2010-12-09 Thread Andrew Evans
Hi Bruno ty for the reply.

I am just trying to figure out that code but for some reason it isn't
displaying the post_body when I view the page

Any ideas in how to fix this?

def index():
posts = db(db.posts.id > 0).select(orderby=~db.posts.id, limitby=(0,
10))
for post in posts:
if len(post.post_body) > 1000:# Preview
should be about 1000 chars
index = post.post_body.find("", 1000, -1) + 4 # find the
index of the next  and add 4 chars
post.post_body = post.post_body[0:index]   #
replace the body of the post post with short version
return dict(rows=posts)


Re: [web2py] Limit Posts to shorter length add continue reading link

2010-12-09 Thread Andrew Evans
Never mind found it I guess my nicedit wasn't adding  tags but 

On Thu, Dec 9, 2010 at 10:12 AM, Andrew Evans  wrote:

> Hi Bruno ty for the reply.
>
> I am just trying to figure out that code but for some reason it isn't
> displaying the post_body when I view the page
>
> Any ideas in how to fix this?
>
> def index():
> posts = db(db.posts.id > 0).select(orderby=~db.posts.id, limitby=(0,
> 10))
> for post in posts:
> if len(post.post_body) > 1000:# Preview
> should be about 1000 chars
> index = post.post_body.find("", 1000, -1) + 4 # find
> the index of the next  and add 4 chars
> post.post_body = post.post_body[0:index]   #
> replace the body of the post post with short version
> return dict(rows=posts)
>


[web2py] passing width and height args to download controller from image

2010-12-14 Thread Andrew Evans
How can I pass the width and height values as arguments from my image to my
download controller cause I want to resize images based on those values on
the fly and can't figure that part out



Re: [web2py] Re: passing width and height args to download controller from image

2010-12-14 Thread Andrew Evans
Hi I don't think that's what I need.. perhaps it is

I have my download controller for example it takes in arguments for width
and height.

def download():
if len(request.args) == 1:
return response.download(request, db)
else:
myImage = request.args[0]
myImage = os.path.join(request.folder, "uploads", myImage)
width = request.args[1]
height = request.args[2]
im = Image.open(myImage)

resized_image = im.thumbnail(width, height)
return resized_image

but doesn't work when I type this in my view maybe I don't understand it
right



But I will look at what you said

*cheers


Re: [web2py] Re: passing width and height args to download controller from image

2010-12-14 Thread Andrew Evans
I think I got it need to pass the args as a tuple

thanks for the help :-)


[web2py] Resize images using PIL

2010-12-15 Thread Andrew Evans
I have been looking into how to resize images on the fly. For some reason my
code isn't working

my controller consists of the following code

def myImage():
if len(request.args) == 1:
return response.download(request, db)
else:
im = request.args(0)
im = os.path.join(request.folder, "uploads", im)
width = request.args(1)
height = request.args(2)
size = width, height
myImage = Image.open(im)

resized_image = myImage.thumbnail((size), Image.ANTIALIAS)
resized_image.save(myImage.format)
return resized_image

The width and height I am passing as arguments from view what am I doing
wrong with my image resize code


Any ideas

*cheers


[web2py] Recaptcha in Email Form

2010-12-28 Thread Andrew Evans
How can I add Recaptcha to an email form?

I am defining my mail settings here

def email_user(sender,message,subject="Web Request from [NamiYama]"):
from gluon.tools import Mail
mail=Mail()

mail.settings.server='smtp.gmail.com:587'
mail.settings.login=None or 'user:pass'
mail.settings.register_captcha = Recaptcha(request, 'PUBLIC_KEY',
'PRIVATE_KEY')
mail.settings.sender=sender
toaddrs=[x.email for x in db().select(db.recipient.email)]
mail.send(to=toaddrs, subject=subject, message=message)

does this line work mail.settings.register_captcha = Recaptcha(request,
'PUBLIC_KEY',
'PRIVATE_KEY')

if so how can I ad it to my form?

Any ideas *cheers


[web2py] Recaptcha on email form

2010-12-30 Thread Andrew Evans
How can I add recaptcha to an email form using Mail()? I am using a modified
version of the Email form appliance

any ideas

*cheers


[web2py] Possible Bug in Recaptcha in web2py version 1.91.6

2011-01-14 Thread Andrew Evans
hello I have just updated my web2py to the latest version. I have not
changed any code in my website referencing my form

def contact():
use_recaptcha = True
recaptcha_public = "6LeER8ASAI_koQRPAr3YBuk9v76YOOrEANx-"
recaptcha_private = "6LeER8ASAGc0VonegXpSzo1R1-THzKqyerfb"
captcha = Recaptcha(request, recaptcha_public,recaptcha_private)
form=SQLFORM(db.message,
fields=['your_name','your_email','your_message'])
if use_recaptcha:
form[0].insert(-1, TR('', captcha, ''))
if form.accepts(request.vars,session):
   subject='message from [Nami Yama] Web site '+form.vars.your_name
   email_user(sender=form.vars.your_email,\
  message=form.vars.your_message,\
  subject=subject)
   response.flash='Success! Your email has been sent.'
elif form.errors:
   response.flash='Oops! Please check the form and try again'
return dict(top_message=TOP_MESSAGE,form=form)

there seems to be an error causing my contact page to not be displayed I
assume its a bug in web2py because no code has been changed ;)

Any idea whats causing this  error if its not a bug :-)

cheers

AttributeError: 'Recaptcha' object has no attribute 'options'


[web2py] Re: Possible Bug in Recaptcha in web2py version 1.91.6

2011-01-14 Thread Andrew Evans
nvm I just found the fix to my issue *cheers

append

self.options = options

to the init function right after line 614 in gluon/tools.py

anyway *cheers




On Fri, Jan 14, 2011 at 11:06 AM, Andrew Evans  wrote:

> hello I have just updated my web2py to the latest version. I have not
> changed any code in my website referencing my form
>
> def contact():
> use_recaptcha = True
> recaptcha_public = "6LeER8ASAI_koQRPAr3YBuk9v76YOOrEANx-"
> recaptcha_private = "6LeER8ASAGc0VonegXpSzo1R1-THzKqyerfb"
> captcha = Recaptcha(request, recaptcha_public,recaptcha_private)
> form=SQLFORM(db.message,
> fields=['your_name','your_email','your_message'])
> if use_recaptcha:
> form[0].insert(-1, TR('', captcha, ''))
> if form.accepts(request.vars,session):
>subject='message from [Nami Yama] Web site '+form.vars.your_name
>email_user(sender=form.vars.your_email,\
>   message=form.vars.your_message,\
>   subject=subject)
>response.flash='Success! Your email has been sent.'
> elif form.errors:
>response.flash='Oops! Please check the form and try again'
> return dict(top_message=TOP_MESSAGE,form=form)
>
> there seems to be an error causing my contact page to not be displayed I
> assume its a bug in web2py because no code has been changed ;)
>
> Any idea whats causing this  error if its not a bug :-)
>
> cheers
>
> AttributeError: 'Recaptcha' object has no attribute 'options'
>
>
>


[web2py] Create popular today query

2012-07-19 Thread Andrew Evans
Hello

How can I query the database so it pulls the most viewed pages for the
current day. I have a counter that calculates views on each page in total,
I am just not sure how to implement it based on a time frame :-)

*cheers and ty

-- 





[web2py] database query for most popular today

2012-07-19 Thread Andrew Evans
Maybe this is pretty simple, I was wondering how I can get the most popular 
pages for the current day I have a counter set that checks how many times a 
page gets viewed 

here is a query for the most viewed: *popular_original = 
db(db.episodes.id>0).select(orderby=~db.episodes.views, limitby=(0,5))

*my question is how can I modify that query to get the most popular for the 
current day

*cheers

Thank You 

-- 





[web2py] Unions and select from tables

2012-07-20 Thread Andrew Evans
I am trying to work in Web2py's union method and am wondering a few things

if I have a query

*db( (db.sample.id>0) and (db.example.id>0) and (db.random.id>0)).select()*

I would like to know how to orderby the latest ids

as well when I am displaying a page link *

[web2py] Query by latitude and longitude

2012-08-26 Thread Andrew Evans
Hello I am trying to figure out a problem I am having in a mobile site I am 
developing

Given that I can find my location on a Google Map using jquery I want to 
pass those (lat and long) values as well as how much range to search to my 
query I am confused how to pass the values and do the query

(I want to create a search function based on your current position to 
within a given range)

here is my form code as well as my query I attempted

Search By Distance




Accuracy: N/A
Access My 
Location



Distance



Cancel
Submit


var setLocation = function(position) {
$.post(
"{{=URL('views', 'location')}}",
{
data : {
latitude : position.coords.latitude,
longitude : position.coords.longitude,
accuracy : position.coords.accuracy
}
},
function() {
$("#getLocation").fadeTo('fast', 1);
$("#getLocation .ui-btn-text").html("Update My 
Location");
$("#distance_submit").removeClass('ui-disabled');

var accuracyText = position.coords.accuracy + 'm';
var accuracyZoom = 14;
if (position.coords.accuracy >= 1000) {
accuracyText = 
Math.round(position.coords.accuracy/1000) + 'km';
accuracyZoom = 12;
}
$("#locationImage").attr(
'src',

'http://maps.googleapis.com/maps/api/staticmap?sensor=true&size=240x200&scale=2&zoom='
 
+ accuracyZoom + '&markers=' + position.coords.latitude + ',' + 
position.coords.longitude
);
$('#locationAccuracy').html(accuracyText);
$('#MapContainer').fadeTo('fast', 1);
}
);
};
var locationError = function(error) {
$("#visitorLocationMapContainer").html("There was an error 
accessing your location");
$("#getLocation").fadeTo('fast', 1);
};

$('#getLocation').click(function() {
$(this).fadeTo('fast', 0.5);
$("#visitorLocationMapContainer").fadeTo('fast', 0.5);
navigator.geolocation.getCurrentPosition(setLocation, 
locationError, {timeout: 6});
});

   $("#distance_submit").click(function() {
var val = $("#distance").val();
if (!val) {
return;
}
$.mobile.changePage("{{=URL('views', 'location')}}" + val);
});



##PYTHON#

def location():
mystr = request.post_vars["distance"]
distance = db(db.listing.latitude == mystr).select(db.listing.ALL)
return dict(distance=distance)

Sorry for the beginner question :-P


*cheers and ty :D

-- 





Re: [web2py] Query by latitude and longitude

2012-08-26 Thread Andrew Evans
I was able to figure out the jquery side of things and found a query that
suggests a way to do this. How can I do this below query in  DAL using
SQLite ;-)

*cheers

SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) *
cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin(
radians( lat ) ) ) ) AS distance FROM markers HAVING distance < 25
ORDER BY distance LIMIT 0 , 20;

-- 





Re: [web2py] Query by latitude and longitude

2012-08-26 Thread Andrew Evans
nvm just found acos cos and such are not available in Dal or sqlite and I
will need to use mysql

*cheers

ty :D



On Sun, Aug 26, 2012 at 8:43 PM, Andrew Evans wrote:

> I was able to figure out the jquery side of things and found a query that
> suggests a way to do this. How can I do this below query in  DAL using
> SQLite ;-)
>
> *cheers
>
> SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( 
> radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) 
> ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 0 , 
> 20;
>
>
>

-- 





[web2py] how to escape data from request.post_vars to prevent SQLi

2012-08-27 Thread Andrew Evans
How can I escape the data submitted by my form to prevent SQL Injection. I
read using request.post_vars does not escape the data, I am using a form
built in HTML and submitting the data passing request.post_vars as
variables to my SQL Query.

Any ideas

*cheers

-- 





[web2py] Executesql Not returning results

2012-08-27 Thread Andrew Evans
I am trying to figure out why executesql is not returning any results in
this query.  I am using mysql, any suggestions would be greatly
appreciated. There are no errors just an empty view

*cheers

Code Below

*Controller*

def location():
current_lat = request.post_vars["lat"]
current_lon = request.post_vars["lon"]
val = request.post_vars["search-distance"]
distance = db.executesql("SELECT *, (3959 * acos(cos(radians(%f)) *
cos(radians(latitude)) * cos(radians(longitude) - radians(%f)) +
sin(radians(%f)) * sin(radians(latitude AS distance FROM listing HAVING
distance < %d ORDER BY distance LIMIT 0, 20;" % (float(current_lat),
float(current_lon), float(current_lat), int(val)))
return dict(distance=distance)


*Example View*

{{for query in distance:}}

{{=query[2]}}

{{=query[3]}}

-- 





[web2py] Re: Executesql Not returning results

2012-08-27 Thread Andrew Evans
Nvm I got it to work my latitude and longitude were in the wrong entries :D

On Mon, Aug 27, 2012 at 7:12 AM, Andrew Evans wrote:

> I am trying to figure out why executesql is not returning any results in
> this query.  I am using mysql, any suggestions would be greatly
> appreciated. There are no errors just an empty view
>
> *cheers
>
> Code Below
>
> *Controller*
>
> def location():
> current_lat = request.post_vars["lat"]
> current_lon = request.post_vars["lon"]
> val = request.post_vars["search-distance"]
> distance = db.executesql("SELECT *, (3959 * acos(cos(radians(%f)) *
> cos(radians(latitude)) * cos(radians(longitude) - radians(%f)) +
> sin(radians(%f)) * sin(radians(latitude AS distance FROM listing HAVING
> distance < %d ORDER BY distance LIMIT 0, 20;" % (float(current_lat),
> float(current_lon), float(current_lat), int(val)))
> return dict(distance=distance)
>
>
> *Example View*
>
> {{for query in distance:}}
> 
> {{=query[2]}}
> 
> {{=query[3]}}
>
>

-- 





Re: [web2py] Query by latitude and longitude

2012-08-27 Thread Andrew Evans
hey thanks I was able to get it to working using that MySQL query and
Web2py's executesql method

*cheers



On Mon, Aug 27, 2012 at 7:46 AM, howesc  wrote:

> if you are doing GEO stuff i would highly recommend postrgres with
> postgis!  then you can just ask for a point, point in polygon, polygon
> contains point etc.
>
> On Sunday, August 26, 2012 8:54:40 PM UTC-7, Andrew Evans wrote:
>>
>> nvm just found acos cos and such are not available in Dal or sqlite and I
>> will need to use mysql
>>
>> *cheers
>>
>> ty :D
>>
>>
>>
>> On Sun, Aug 26, 2012 at 8:43 PM, Andrew Evans wrote:
>>
>>> I was able to figure out the jquery side of things and found a query
>>> that suggests a way to do this. How can I do this below query in  DAL using
>>> SQLite ;-)
>>>
>>> *cheers
>>>
>>> SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( 
>>> radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) 
>>> ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 
>>> 0 , 20;
>>>
>>>
>>>
>>>
>>  --
>
>
>
>

-- 





Re: [web2py] Re: how to escape data from request.post_vars to prevent SQLi

2012-08-27 Thread Andrew Evans
yes I have a peculiar SQL query that is using ACOS(), COS() etc for
geolocation. I would love to use DAL but it is for a mobile device :D

*cheers




On Mon, Aug 27, 2012 at 2:11 PM, Anthony  wrote:

> Is there a reason you can't use the DAL to do the insert?
>
>
> On Monday, August 27, 2012 4:32:09 PM UTC-4, Andrew Evans wrote:
>>
>> How can I escape the data submitted by my form to prevent SQL Injection.
>> I read using request.post_vars does not escape the data, I am using a form
>> built in HTML and submitting the data passing request.post_vars as
>> variables to my SQL Query.
>>
>> Any ideas
>>
>> *cheers
>>
>>
>>  --
>
>
>
>

-- 





[web2py] Flash File and Routes

2012-09-03 Thread Andrew Evans
Hello

I have a flash file that requires that the files associated with it be in
the same directory as views/default/index.html


I did a bit of research and read that I can have the view look like it is
in static or the static files look like they are in the views by using
routes.py although I am not certain how to do this

the files I have are:

index.html (this is the view)
piecemaker.swf
piecemakerCSS.css
piecemakerXML.xml

piecemaker.png
piecemaker2.png

and the images and js directories

any help is greatly appreciated...

*cheers

-- 





Re: [web2py] Re: Flash File and Routes

2012-09-03 Thread Andrew Evans
I am really not sure why they have to be like that

But I did a test on my local system

I put the flash files and xml files etc in a separate directory and I put
index.html outside of that directory changed all the references to the swf
and css file and it would not work...

Any ideas


On Mon, Sep 3, 2012 at 9:52 AM, Anthony  wrote:

> On Monday, September 3, 2012 12:08:20 PM UTC-4, Andrew Evans wrote:
>>
>> Hello
>>
>> I have a flash file that requires that the files associated with it be in
>> the same directory as views/default/index.html
>>
>
> Why do they have to be in that particular folder? Why not just whatever
> folder contains the flash file (e.g., /static)?
>
> Anthony
>
> --
>
>
>
>

-- 





Re: [web2py] Re: Flash File and Routes

2012-09-03 Thread Andrew Evans
I think because there are some hard coded values in the flash file but
since I can't change the file (cause of my version of flash)

its causing a problem

But I don't know what the hard coded values could be. The only values in
the flash file were references to the xml and images folder

Would appreciate any ideas though


ty

-- 





Re: [web2py] Re: Flash File and Routes

2012-09-03 Thread Andrew Evans
Thank you for your help Anthony

the code in the head section





swfobject.embedSWF("{{=URL('static', 'piecemaker.swf')}}", "piecemaker",
"950", "350", "10.0.0.0", "{{=URL('static', 'js/expressInstall.swf')}}");


and in the body

 
var flashvars = {};
flashvars.myurl = "{{=URL('static',
'piecemaker.swf')}}";
flashvars.width = 950;
flashvars.height = 350;

var params = {};
params.play = "true";
params.loop = "true";
params.menu = "false";
params.quality = "best";
params.scale = "showall";
params.wmode = "window";
params.swliveconnect = "true";
params.allowfullscreen = "true";
params.allowscriptaccess = "always";
params.allownetworking = "all";
var attributes = {};
attributes.id = "container";
swfobject.embedSWF("{{=URL('static',
'piecemaker.swf')}}","myAlternativeContent",  950, 350, "10.0.0.0", false,
flashvars, params, attributes);



http://www.adobe.com/go/getflashplayer";>
http://www.adobe.com/images/shared/download_buttons/
get_flash_player.gif" alt="Get Adobe Flash player"
/>




here is a link to the online site
https://85.25.242.165/turtlebaychemists/default/index so you can see

I can attach the flash src file if you like *cheers

and ty once again for the help





On Mon, Sep 3, 2012 at 10:46 AM, Anthony  wrote:

> Can you show your code? How are you referencing those files in index.html?
>
>
> On Monday, September 3, 2012 1:30:27 PM UTC-4, Andrew Evans wrote:
>
>> I am really not sure why they have to be like that
>>
>> But I did a test on my local system
>>
>> I put the flash files and xml files etc in a separate directory and I put
>> index.html outside of that directory changed all the references to the swf
>> and css file and it would not work...
>>
>> Any ideas
>>
>>
>> On Mon, Sep 3, 2012 at 9:52 AM, Anthony  wrote:
>>
>>> On Monday, September 3, 2012 12:08:20 PM UTC-4, Andrew Evans wrote:
>>>>
>>>> Hello
>>>>
>>>> I have a flash file that requires that the files associated with it be
>>>> in the same directory as views/default/index.html
>>>>
>>>
>>> Why do they have to be in that particular folder? Why not just whatever
>>> folder contains the flash file (e.g., /static)?
>>>
>>> Anthony
>>>
>>> --
>>>
>>>
>>>
>>>
>>
>>  --
>
>
>
>

-- 





Re: [web2py] Re: Flash File and Routes

2012-09-03 Thread Andrew Evans
its linked in the flash file I believe from what I saw it is looking in the
same directory as the Flash Document

I will look again at that

thanks for the help so far

*cheers






On Mon, Sep 3, 2012 at 12:50 PM, Anthony  wrote:

> Well, for one thing, it's looking for
> https://85.25.242.165/turtlebaychemists/default/piecemakerXML.xml and not
> finding it. How is the URL to that file configured?
>
> Anthony
>
> On Monday, September 3, 2012 3:11:45 PM UTC-4, Andrew Evans wrote:
>
>> Thank you for your help Anthony
>>
>> the code in the head section
>>
>> > type="text/css" />
>>
>> </**script>
>> <script type="text/javascript">
>> swfobject.embedSWF("{{=URL('**static', 'piecemaker.swf')}}",
>> "piecemaker", "950", "350", "10.0.0.0", "{{=URL('static',
>> 'js/expressInstall.swf')}}");
>> 
>>
>> and in the body
>>
>>  
>> var flashvars = {};
>> flashvars.myurl = "{{=URL('static',
>> 'piecemaker.swf')}}";
>> flashvars.width = 950;
>> flashvars.height = 350;
>>
>> var params = {};
>> params.play = "true";
>> params.loop = "true";
>> params.menu = "false";
>> params.quality = "best";
>> params.scale = "showall";
>> params.wmode = "window";
>> params.swliveconnect = "true";
>> params.allowfullscreen = "true";
>> params.allowscriptaccess = "always";
>> params.allownetworking = "all";
>> var attributes = {};
>> attributes.id = "container";
>> swfobject.embedSWF("{{=URL('**static',
>> 'piecemaker.swf')}}","**myAlternativeContent",  950, 350, "10.0.0.0",
>> false, flashvars, params, attributes);
>> 
>>
>> 
>> > href="http://www.adobe.com/go/**getflashplayer<http://www.adobe.com/go/getflashplayer>
>> ">
>> http://www.adobe.com/**
>> images/shared/download_**buttons/<http://www.adobe.com/images/shared/download_buttons/>
>> get_flash_player.gif" alt="Get Adobe Flash
>> player" />
>> 
>> 
>>
>>
>> here is a link to the online site https://85.25.242.165/**
>> turtlebaychemists/default/**index<https://85.25.242.165/turtlebaychemists/default/index>so
>>  you can see
>>
>> I can attach the flash src file if you like *cheers
>>
>> and ty once again for the help
>>
>>
>>
>>
>>
>> On Mon, Sep 3, 2012 at 10:46 AM, Anthony  wrote:
>>
>>> Can you show your code? How are you referencing those files in
>>> index.html?
>>>
>>>
>>> On Monday, September 3, 2012 1:30:27 PM UTC-4, Andrew Evans wrote:
>>>
>>>> I am really not sure why they have to be like that
>>>>
>>>> But I did a test on my local system
>>>>
>>>> I put the flash files and xml files etc in a separate directory and I
>>>> put index.html outside of that directory changed all the references to the
>>>> swf and css file and it would not work...
>>>>
>>>> Any ideas
>>>>
>>>>
>>>> On Mon, Sep 3, 2012 at 9:52 AM, Anthony  wrote:
>>>>
>>>>> On Monday, September 3, 2012 12:08:20 PM UTC-4, Andrew Evans wrote:
>>>>>>
>>>>>> Hello
>>>>>>
>>>>>> I have a flash file that requires that the files associated with it
>>>>>> be in the same directory as views/default/index.html
>>>>>>
>>>>>
>>>>> Why do they have to be in that particular folder? Why not just
>>>>> whatever folder contains the flash file (e.g., /static)?
>>>>>
>>>>> Anthony
>>>>>
>>>>> --
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>  --
>>>
>>>
>>>
>>>
>>
>>  --
>
>
>
>

-- 





Re: [web2py] Re: Flash File and Routes

2012-09-03 Thread Andrew Evans
ya its linked as

piecemaker.xmlSource = "piecemakerXML.xml";
piecemaker.cssSource = "piecemakerCSS.css";
piecemaker.imageSource = "images";

in the flash file

but it's being called in default that is strange not sure what else is
linked in that file when I run it all that appears is a blank screen and a
bunch of errors in the output window :-P

Any ideas?






On Mon, Sep 3, 2012 at 1:21 PM, Andrew Evans  wrote:

> its linked in the flash file I believe from what I saw it is looking in
> the same directory as the Flash Document
>
> I will look again at that
>
> thanks for the help so far
>
> *cheers
>
>
>
>
>
>
>
> On Mon, Sep 3, 2012 at 12:50 PM, Anthony  wrote:
>
>> Well, for one thing, it's looking for
>> https://85.25.242.165/turtlebaychemists/default/piecemakerXML.xml and
>> not finding it. How is the URL to that file configured?
>>
>> Anthony
>>
>> On Monday, September 3, 2012 3:11:45 PM UTC-4, Andrew Evans wrote:
>>
>>> Thank you for your help Anthony
>>>
>>> the code in the head section
>>>
>>> >> type="text/css" />
>>>
>>> </**script>
>>> <script type="text/javascript">
>>> swfobject.embedSWF("{{=URL('**static', 'piecemaker.swf')}}",
>>> "piecemaker", "950", "350", "10.0.0.0", "{{=URL('static',
>>> 'js/expressInstall.swf')}}");
>>> 
>>>
>>> and in the body
>>>
>>>  
>>> var flashvars = {};
>>> flashvars.myurl = "{{=URL('static',
>>> 'piecemaker.swf')}}";
>>> flashvars.width = 950;
>>> flashvars.height = 350;
>>>
>>> var params = {};
>>> params.play = "true";
>>> params.loop = "true";
>>> params.menu = "false";
>>> params.quality = "best";
>>> params.scale = "showall";
>>> params.wmode = "window";
>>> params.swliveconnect = "true";
>>> params.allowfullscreen = "true";
>>> params.allowscriptaccess = "always";
>>> params.allownetworking = "all";
>>> var attributes = {};
>>> attributes.id = "container";
>>> swfobject.embedSWF("{{=URL('**static',
>>> 'piecemaker.swf')}}","**myAlternativeContent",  950, 350, "10.0.0.0",
>>> false, flashvars, params, attributes);
>>> 
>>>
>>> 
>>> http://www.adobe.com/go/**
>>> getflashplayer <http://www.adobe.com/go/getflashplayer>">
>>> http://www.adobe.com/**
>>> images/shared/download_**buttons/<http://www.adobe.com/images/shared/download_buttons/>
>>> get_flash_player.gif" alt="Get Adobe Flash
>>> player" />
>>> 
>>> 
>>>
>>>
>>> here is a link to the online site https://85.25.242.165/**
>>> turtlebaychemists/default/**index<https://85.25.242.165/turtlebaychemists/default/index>so
>>>  you can see
>>>
>>> I can attach the flash src file if you like *cheers
>>>
>>> and ty once again for the help
>>>
>>>
>>>
>>>
>>>
>>> On Mon, Sep 3, 2012 at 10:46 AM, Anthony  wrote:
>>>
>>>> Can you show your code? How are you referencing those files in
>>>> index.html?
>>>>
>>>>
>>>> On Monday, September 3, 2012 1:30:27 PM UTC-4, Andrew Evans wrote:
>>>>
>>>>> I am really not sure why they have to be like that
>>>>>
>>>>> But I did a test on my local system
>>>>>
>>>>> I put the flash files and xml files etc in a separate directory and I
>>>>> put index.html outside of that directory changed all the references to the
>>>>> swf and css file and it would not work...
>>>>>
>>>>> Any ideas
>>>>>
>>>>>
>>>>> On Mon, Sep 3, 2012 at 9:52 AM, Anthony  wrote:
>>>>>
>>>>>> On Monday, September 3, 2012 12:08:20 PM UTC-4, Andrew Evans wrote:
>>>>>>>
>>>>>>> Hello
>>>>>>>
>>>>>>> I have a flash file that requires that the files associated with it
>>>>>>> be in the same directory as views/default/index.html
>>>>>>>
>>>>>>
>>>>>> Why do they have to be in that particular folder? Why not just
>>>>>> whatever folder contains the flash file (e.g., /static)?
>>>>>>
>>>>>> Anthony
>>>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>  --
>>>>
>>>>
>>>>
>>>>
>>>
>>>  --
>>
>>
>>
>>
>
>

-- 





Re: [web2py] Re: Flash File and Routes

2012-09-03 Thread Andrew Evans
Thanks for your help I solved my problem by modifying the tutorial given
here

http://net.tutsplus.com/tutorials/wordpress/integrating-the-piecemaker-3d-gallery-into-your-wordpress-theme/

Thanks for the help

*cheers

Andrew



On Mon, Sep 3, 2012 at 1:33 PM, Andrew Evans  wrote:

> ya its linked as
>
> piecemaker.xmlSource = "piecemakerXML.xml";
> piecemaker.cssSource = "piecemakerCSS.css";
> piecemaker.imageSource = "images";
>
> in the flash file
>
> but it's being called in default that is strange not sure what else is
> linked in that file when I run it all that appears is a blank screen and a
> bunch of errors in the output window :-P
>
> Any ideas?
>
>
>
>
>
>
>
> On Mon, Sep 3, 2012 at 1:21 PM, Andrew Evans wrote:
>
>> its linked in the flash file I believe from what I saw it is looking in
>> the same directory as the Flash Document
>>
>> I will look again at that
>>
>> thanks for the help so far
>>
>> *cheers
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Sep 3, 2012 at 12:50 PM, Anthony  wrote:
>>
>>> Well, for one thing, it's looking for
>>> https://85.25.242.165/turtlebaychemists/default/piecemakerXML.xml and
>>> not finding it. How is the URL to that file configured?
>>>
>>> Anthony
>>>
>>> On Monday, September 3, 2012 3:11:45 PM UTC-4, Andrew Evans wrote:
>>>
>>>> Thank you for your help Anthony
>>>>
>>>> the code in the head section
>>>>
>>>> >>> type="text/css" />
>>>>
>>>> </**script>
>>>> <script type="text/javascript">
>>>> swfobject.embedSWF("{{=URL('**static', 'piecemaker.swf')}}",
>>>> "piecemaker", "950", "350", "10.0.0.0", "{{=URL('static',
>>>> 'js/expressInstall.swf')}}");
>>>> 
>>>>
>>>> and in the body
>>>>
>>>>  
>>>> var flashvars = {};
>>>> flashvars.myurl = "{{=URL('static',
>>>> 'piecemaker.swf')}}";
>>>> flashvars.width = 950;
>>>> flashvars.height = 350;
>>>>
>>>> var params = {};
>>>> params.play = "true";
>>>> params.loop = "true";
>>>> params.menu = "false";
>>>> params.quality = "best";
>>>> params.scale = "showall";
>>>> params.wmode = "window";
>>>> params.swliveconnect = "true";
>>>> params.allowfullscreen = "true";
>>>> params.allowscriptaccess = "always";
>>>> params.allownetworking = "all";
>>>> var attributes = {};
>>>> attributes.id = "container";
>>>> swfobject.embedSWF("{{=URL('**static',
>>>> 'piecemaker.swf')}}","**myAlternativeContent",  950, 350, "10.0.0.0",
>>>> false, flashvars, params, attributes);
>>>> 
>>>>
>>>> 
>>>> http://www.adobe.com/go/**
>>>> getflashplayer <http://www.adobe.com/go/getflashplayer>">
>>>> http://www.adobe.com/**
>>>> images/shared/download_**buttons/<http://www.adobe.com/images/shared/download_buttons/>
>>>> get_flash_player.gif" alt="Get Adobe Flash
>>>> player" />
>>>> 
>>>> 
>>>>
>>>>
>>>> here is a link to the online site https://85.25.242.165/**
>>>> turtlebaychemists/default/**index<https://85.25.242.165/turtlebaychemists/default/index>so
>>>>  you can see
>>>>
>>>> I can attach the flash src file if you like *cheers
>>>>
>>>> and ty once again for the help
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Mon, Sep 3, 2012 at 10:46 AM, Anthony  wrote:
>>>>
>>>>> Can you show your code? How are you referencing those files in
>>>>> index.html?
>>>>>
>>>>>
>>>>> On Monday, September 3, 2012 1:30:27 PM UTC-4, Andrew Evans wrote:
>>>>>
>>>>>> I am really not sure why they have to be like that
>>>>>>
>>>>>> But I did a test on my local system
>>>>>>
>>>>>> I put the flash files and xml files etc in a separate directory and I
>>>>>> put index.html outside of that directory changed all the references to 
>>>>>> the
>>>>>> swf and css file and it would not work...
>>>>>>
>>>>>> Any ideas
>>>>>>
>>>>>>
>>>>>> On Mon, Sep 3, 2012 at 9:52 AM, Anthony  wrote:
>>>>>>
>>>>>>> On Monday, September 3, 2012 12:08:20 PM UTC-4, Andrew Evans wrote:
>>>>>>>>
>>>>>>>> Hello
>>>>>>>>
>>>>>>>> I have a flash file that requires that the files associated with it
>>>>>>>> be in the same directory as views/default/index.html
>>>>>>>>
>>>>>>>
>>>>>>> Why do they have to be in that particular folder? Why not just
>>>>>>> whatever folder contains the flash file (e.g., /static)?
>>>>>>>
>>>>>>> Anthony
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>  --
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>  --
>>>
>>>
>>>
>>>
>>
>>
>

-- 





[web2py] int() argument must be a string or a number, not 'list'

2012-09-17 Thread Andrew Evans
Hello I am running into issues updating records in my MySQL database after 
adding multiple=True like so

Field('region', db.region, label='Region *', 
requires=IS_IN_DB(db,db.region.id,'%(title)s', multiple=True)),

Any ideas how to fix this I am using web2py 1.99.7

*cheers

and ty ;-)


-- 





Re: [web2py] int() argument must be a string or a number, not 'list'

2012-09-17 Thread Andrew Evans
Sorry forgot to post the full Error message

Traceback (most recent call last):
  File "/var/www/web2py/gluon/restricted.py", line 205, in restricted
exec ccode in environment
  File "/var/www/web2py/applications/sc_coast/controllers/appadmin.py"
<https://85.25.242.165/admin/default/edit/sc_coast/controllers/appadmin.py>,
line 433, in 
  File "/var/www/web2py/gluon/globals.py", line 173, in 
self._caller = lambda f: f()
  File "/var/www/web2py/applications/sc_coast/controllers/appadmin.py"
<https://85.25.242.165/admin/default/edit/sc_coast/controllers/appadmin.py>,
line 277, in update
if form.accepts(request.vars, session):
  File "/var/www/web2py/gluon/sqlhtml.py", line 1234, in accepts
fields[fieldname] = safe_int(value)
  File "/var/www/web2py/gluon/sqlhtml.py", line 52, in safe_int
return int(x)
TypeError: int() argument must be a string or a number, not 'list'

 Error snapshot [image: help]

(int() argument must be a string or a number,
not 'list')



On Mon, Sep 17, 2012 at 5:50 PM, Andrew Evans  wrote:

> Hello I am running into issues updating records in my MySQL database after
> adding multiple=True like so
>
> Field('region', db.region, label='Region *', requires=IS_IN_DB(db,
> db.region.id,'%(title)s', multiple=True)),
>
> Any ideas how to fix this I am using web2py 1.99.7
>
> *cheers
>
> and ty ;-)
>
>
>  --
>
>
>
>

-- 





Re: [web2py] Re: int() argument must be a string or a number, not 'list'

2012-09-17 Thread Andrew Evans
Will do I saw it was fixed in Trunk

Does Trunk mean the not released version?

*cheers

Andrew

-- 





Re: [web2py] Re: int() argument must be a string or a number, not 'list'

2012-09-19 Thread Andrew Evans
I upgraded to the nightly build and it still doesn't fix my issue :-(
Version 2.0.9 (2012-09-18 20:11:26) stable (Taken from Nightly)
MySQL 5.1.63-0+squeeze1

Any ideas

and ty for the help

Traceback (most recent call last):
  File "/var/www/web2py/gluon/restricted.py", line 209, in restricted
exec ccode in environment
  File "/var/www/web2py/applications/sc_coast/controllers/edit.py"
<https://85.25.242.165/admin/default/edit/sc_coast/controllers/edit.py>,
line 57, in 
  File "/var/www/web2py/gluon/globals.py", line 186, in 
self._caller = lambda f: f()
  File "/var/www/web2py/gluon/tools.py", line 2832, in f
return action(*a, **b)
  File "/var/www/web2py/applications/sc_coast/controllers/edit.py"
<https://85.25.242.165/admin/default/edit/sc_coast/controllers/edit.py>,
line 35, in listing
form = 
crud.update(db.listing,int(listing_id),next=URL('control_panel','listing'))
  File "/var/www/web2py/gluon/tools.py", line 3422, in update
detect_record_change = self.settings.detect_record_change):
  File "/var/www/web2py/gluon/sqlhtml.py", line 1368, in accepts
fields[fieldname] = safe_int(value)
  File "/var/www/web2py/gluon/sqlhtml.py", line 63, in safe_int
return int(x)
TypeError: int() argument must be a string or a number, not 'list'




On Tue, Sep 18, 2012 at 5:38 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> You should always consider the nightly built. It usually contains most of
> the fixes as trunk but is a snapshot that we think relatively stable.
>
>
> On Monday, 17 September 2012 22:13:48 UTC-5, Andrew Evans wrote:
>>
>> Will do I saw it was fixed in Trunk
>>
>> Does Trunk mean the not released version?
>>
>> *cheers
>>
>> Andrew
>>
>  --
>
>
>
>

-- 





Re: [web2py] Re: int() argument must be a string or a number, not 'list'

2012-09-19 Thread Andrew Evans
yea I just tried trunk and does not work for me either...

Maybe I am writing my code wrong?

Any ideas?



On Wed, Sep 19, 2012 at 10:47 AM, Andrew Evans  wrote:

> I upgraded to the nightly build and it still doesn't fix my issue :-(
> Version 2.0.9 (2012-09-18 20:11:26) stable (Taken from Nightly)
> MySQL 5.1.63-0+squeeze1
>
> Any ideas
>
> and ty for the help
>
> Traceback (most recent call last
> ):
>
>   File "/var/www/web2py/gluon/restricted.py", line 209, in restricted
>
> exec ccode in environment
>   File "/var/www/web2py/applications/sc_coast/controllers/edit.py" 
> <https://85.25.242.165/admin/default/edit/sc_coast/controllers/edit.py>, line 
> 57, in 
>
>   File "/var/www/web2py/gluon/globals.py", line 186, in 
>
> self._caller = lambda f: f
> ()
>
>   File "/var/www/web2py/gluon/tools.py", line 2832, in f
>
> return action(*a, **b)
>   File "/var/www/web2py/applications/sc_coast/controllers/edit.py" 
> <https://85.25.242.165/admin/default/edit/sc_coast/controllers/edit.py>, line 
> 35, in listing
>
> form = 
> crud.update(db.listing,int(listing_id),next=URL('control_panel','listing'))
>
>   File "/var/www/web2py/gluon/tools.py", line 3422, in update
>
> detect_record_change = self.settings.detect_record_change):
>
>   File "/var/www/web2py/gluon/sqlhtml.py", line 1368, in accepts
>
> fields[fieldname] = safe_int(value)
>   File "/var/www/web2py/gluon/sqlhtml.py", line 63, in safe_int
>
>
> return int(x)
> TypeError: int() argument must be a string or a number, not 'list'
>
>
>
>
> On Tue, Sep 18, 2012 at 5:38 AM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> You should always consider the nightly built. It usually contains most of
>> the fixes as trunk but is a snapshot that we think relatively stable.
>>
>>
>> On Monday, 17 September 2012 22:13:48 UTC-5, Andrew Evans wrote:
>>>
>>> Will do I saw it was fixed in Trunk
>>>
>>> Does Trunk mean the not released version?
>>>
>>> *cheers
>>>
>>> Andrew
>>>
>>  --
>>
>>
>>
>>
>
>

-- 





Re: [web2py] Re: int() argument must be a string or a number, not 'list'

2012-09-19 Thread Andrew Evans
Also the Python Version I am using is 2.6.6

On Wed, Sep 19, 2012 at 10:56 AM, Andrew Evans  wrote:

> yea I just tried trunk and does not work for me either...
>
> Maybe I am writing my code wrong?
>
> Any ideas?
>
>
>
>
> On Wed, Sep 19, 2012 at 10:47 AM, Andrew Evans wrote:
>
>> I upgraded to the nightly build and it still doesn't fix my issue :-(
>> Version 2.0.9 (2012-09-18 20:11:26) stable (Taken from Nightly)
>> MySQL 5.1.63-0+squeeze1
>>
>> Any ideas
>>
>> and ty for the help
>>
>> Traceback (most recent call last
>> ):
>>
>>   File "/var/www/web2py/gluon/restricted.py", line 209, in restricted
>>
>>
>> exec ccode in environment
>>   File "/var/www/web2py/applications/sc_coast/controllers/edit.py" 
>> <https://85.25.242.165/admin/default/edit/sc_coast/controllers/edit.py>, 
>> line 57, in 
>>
>>
>>   File "/var/www/web2py/gluon/globals.py", line 186, in 
>>
>>
>> self._caller = lambda f: f
>> ()
>>
>>   File "/var/www/web2py/gluon/tools.py", line 2832, in f
>>
>>
>> return action(*a, **b)
>>   File "/var/www/web2py/applications/sc_coast/controllers/edit.py" 
>> <https://85.25.242.165/admin/default/edit/sc_coast/controllers/edit.py>, 
>> line 35, in listing
>>
>>
>> form = 
>> crud.update(db.listing,int(listing_id),next=URL('control_panel','listing'))
>>
>>
>>   File "/var/www/web2py/gluon/tools.py", line 3422, in update
>>
>>
>> detect_record_change = self.settings.detect_record_change):
>>
>>
>>   File "/var/www/web2py/gluon/sqlhtml.py", line 1368, in accepts
>>
>>
>> fields[fieldname] = safe_int(value)
>>   File "/var/www/web2py/gluon/sqlhtml.py", line 63, in safe_int
>>
>>
>> return int(x)
>> TypeError: int() argument must be a string or a number, not 'list'
>>
>>
>>
>>
>> On Tue, Sep 18, 2012 at 5:38 AM, Massimo Di Pierro <
>> massimo.dipie...@gmail.com> wrote:
>>
>>> You should always consider the nightly built. It usually contains most
>>> of the fixes as trunk but is a snapshot that we think relatively stable.
>>>
>>>
>>> On Monday, 17 September 2012 22:13:48 UTC-5, Andrew Evans wrote:
>>>>
>>>> Will do I saw it was fixed in Trunk
>>>>
>>>> Does Trunk mean the not released version?
>>>>
>>>> *cheers
>>>>
>>>> Andrew
>>>>
>>>  --
>>>
>>>
>>>
>>>
>>
>>
>

-- 





Re: [web2py] Re: int() argument must be a string or a number, not 'list'

2012-09-19 Thread Andrew Evans
Also updating web2py to Nightly seems to have caused a serious load on SSL

caused 100% CPU load and raised up to 40% RAM usage until I reverted back
to 1.99.7

and 1.99.7 didn't cause any load.

Anyway

My Report






On Wed, Sep 19, 2012 at 11:38 AM, Andrew Evans  wrote:

> Also the Python Version I am using is 2.6.6
>
>
> On Wed, Sep 19, 2012 at 10:56 AM, Andrew Evans wrote:
>
>> yea I just tried trunk and does not work for me either...
>>
>> Maybe I am writing my code wrong?
>>
>> Any ideas?
>>
>>
>>
>>
>> On Wed, Sep 19, 2012 at 10:47 AM, Andrew Evans wrote:
>>
>>> I upgraded to the nightly build and it still doesn't fix my issue :-(
>>> Version 2.0.9 (2012-09-18 20:11:26) stable (Taken from Nightly)
>>> MySQL 5.1.63-0+squeeze1
>>>
>>> Any ideas
>>>
>>> and ty for the help
>>>
>>> Traceback (most recent call last
>>>
>>> ):
>>>
>>>   File "/var/www/web2py/gluon/restricted.py", line 209, in restricted
>>>
>>>
>>>
>>> exec ccode in environment
>>>   File "/var/www/web2py/applications/sc_coast/controllers/edit.py" 
>>> <https://85.25.242.165/admin/default/edit/sc_coast/controllers/edit.py>, 
>>> line 57, in 
>>>
>>>
>>>
>>>   File "/var/www/web2py/gluon/globals.py", line 186, in 
>>>
>>>
>>>
>>> self._caller = lambda f: f
>>>
>>> ()
>>>
>>>   File "/var/www/web2py/gluon/tools.py", line 2832, in f
>>>
>>>
>>>
>>> return action(*a, **b)
>>>   File "/var/www/web2py/applications/sc_coast/controllers/edit.py" 
>>> <https://85.25.242.165/admin/default/edit/sc_coast/controllers/edit.py>, 
>>> line 35, in listing
>>>
>>>
>>>
>>> form = 
>>> crud.update(db.listing,int(listing_id),next=URL('control_panel','listing'))
>>>
>>>
>>>
>>>   File "/var/www/web2py/gluon/tools.py", line 3422, in update
>>>
>>>
>>>
>>> detect_record_change = self.settings.detect_record_change):
>>>
>>>
>>>
>>>   File "/var/www/web2py/gluon/sqlhtml.py", line 1368, in accepts
>>>
>>>
>>>
>>> fields[fieldname] = safe_int(value)
>>>   File "/var/www/web2py/gluon/sqlhtml.py", line 63, in safe_int
>>>
>>>
>>>
>>> return int(x)
>>> TypeError: int() argument must be a string or a number, not 'list'
>>>
>>>
>>>
>>>
>>> On Tue, Sep 18, 2012 at 5:38 AM, Massimo Di Pierro <
>>> massimo.dipie...@gmail.com> wrote:
>>>
>>>> You should always consider the nightly built. It usually contains most
>>>> of the fixes as trunk but is a snapshot that we think relatively stable.
>>>>
>>>>
>>>> On Monday, 17 September 2012 22:13:48 UTC-5, Andrew Evans wrote:
>>>>>
>>>>> Will do I saw it was fixed in Trunk
>>>>>
>>>>> Does Trunk mean the not released version?
>>>>>
>>>>> *cheers
>>>>>
>>>>> Andrew
>>>>>
>>>>  --
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>

-- 





[web2py] list:reference database selection

2012-09-20 Thread Andrew Evans
Hello I have a field in my table defined like so

Field('region', 'list:reference region'),

The data entered is multiple regions in the form, Gibsons, Sechelt

I am wondering since it is not an id how I can pass the name of the town as
an argument, so it only selects entries from that town

this is the view from the search_methods/region page

   
{{for region in region_query:}}
{{=region.title}}
{{pass}}


I need to change the *a* tag I think here so I can pass the correct argument

here is the controller function for the views/region page (where the above
a tag points to) not sure what to change here any ideas are greatly
appreciated

def region():
region = request.args(0)
query = db.listing.region == region
orderby = db.listing.title
pcache = (cache.ram, 15)
paginate = Pagination(db, query, orderby, display_count=10,
cache=pcache, r=request, res=response)
region_query = paginate.get_set(set_links=True)
region_text = db(db.region.id == region).select()

return dict(region_query = region_query, region_text=region_text)

*cheers

and ty

Andrew

-- 





[web2py] Re: list:reference database selection

2012-09-20 Thread Andrew Evans
I have since added format='%(title)s %(id)s' to the region table but the
listing is not being selected

Is it because it is a list?

I have entered multiple region entries for a single listing any idea how to
select that listing in each of those regions when using the region search
method?

*cheers

and ty



On Thu, Sep 20, 2012 at 7:53 AM, Andrew Evans  wrote:

> Hello I have a field in my table defined like so
>
> Field('region', 'list:reference region'),
>
> The data entered is multiple regions in the form, Gibsons, Sechelt
>
> I am wondering since it is not an id how I can pass the name of the town
> as an argument, so it only selects entries from that town
>
> this is the view from the search_methods/region page
>
>
> {{for region in region_query:}}
>  target="_blank" data-transition="fade" title="{{=region.title}}"
> >{{=region.title}}
> {{pass}}
> 
>
> I need to change the *a* tag I think here so I can pass the correct
> argument
>
> here is the controller function for the views/region page (where the above
> a tag points to) not sure what to change here any ideas are greatly
> appreciated
>
> def region():
> region = request.args(0)
> query = db.listing.region == region
> orderby = db.listing.title
> pcache = (cache.ram, 15)
> paginate = Pagination(db, query, orderby, display_count=10,
> cache=pcache, r=request, res=response)
> region_query = paginate.get_set(set_links=True)
> region_text = db(db.region.id == region).select()
>
> return dict(region_query = region_query, region_text=region_text)
>
> *cheers
>
> and ty
>
> Andrew
>

-- 





  1   2   >