h = 'form accepted'
>> elif form.errors:
>> response.flash = 'form has errors'
>> else:
>> response.flash = 'please fill out the form'
>> return dict(form=form)
>>
>> Strange thing is though that th
is though that the property_type field still appears on the
form. Any ideas why?
Thank you,
Chris
On Wed, Apr 18, 2012 at 3:43 PM, Chris Rowson
wrote:
> Thanks for confirming this for me, this did seem to be the most sensible
> way to approach the problem :-)
>
> Chris
>
>
&
Thanks for confirming this for me, this did seem to be the most sensible
way to approach the problem :-)
Chris
On Wed, Apr 18, 2012 at 1:04 AM, simon wrote:
> You can do this with a single form. At the top of the controller set
> readable=false, writable=false for the fields you do not want on
I'm a new adopter of web2py and I'm trying to learn the framework by
building a simple property site.
I have two types of properties, new or old.
New properties have a few core attributes, let's say name, price, location,
bedrooms
Old properties have the same core attributes with a few more adde
Heh, no worries. :-)
I wonder, just out of interest, is there any great performance difference
between searching for records containing region.id 'x' (as below) rather
than returning all rows with region.id 'x' from a junction table?
Chris
On Sat, Apr 14, 2012 at 11:34 PM, villas wrote:
> Oops
Thank you again David,
I shall give it a go.
Chris
On Sat, Apr 14, 2012 at 10:29 PM, villas wrote:
> Yes, it would store the ids of the regions between vertical bars,
> something like this: |4|7|23|. So say you are looking for the house-types
> in China (which is id = 7). It would be someth
Hi David,
Thanks for your reply.
I did come across the list:reference option while trying to figure this
out. I couldn't figure this out though:
Say I add the following to my house-type table:
Field('regions', 'list:reference region')
If I generate a form using SQLFORM, it presents me with
Hi all,
I'm pretty new to web2py and web app development and I've spend some time
trying to figure out the best way to do this.
I have two tables, house-types and regions. A house-type can exist in many
regions, and a region can have many house types:
db.define_table(
'region',
Field('na
ss # do nothing
>
> On Oct 10, 8:22 am, Chris Rowson wrote:
>> Hi list,
>>
>> I have a database table which looks like this:
>>
>> postcode_cache
>>
>> postcode (UNIQUE)
>> lat
>> lon
>> nearest
>>
>&g
Hi list,
I have a database table which looks like this:
postcode_cache
postcode (UNIQUE)
lat
lon
nearest
I want to test first whether or not a record exists for 'postcode' and
if a record does exist, I want to check whether the 'nearest' field
contains any data.
I've tr
Chris
On Sat, Oct 8, 2011 at 4:19 PM, Massimo Di Pierro
wrote:
> You don't mind to write engine specific queries but who is going to
> use your app will mind because the app is not going to be portable.
> Almost any query an be build using the dal.
>
> Massimo
>
> On Oct 8,
=~db.data.download)
return dict(table=rows, message=postcodelist)
On Sat, Oct 8, 2011 at 3:53 PM, Chris Rowson
wrote:
> I finally used...
>
> postcodelist=[]
> closepostcodes=ukpostcodes.closest_postcodes(session.postcode,
> str(session.distance))
> for p
x27;m still learning
all this stuff :-D
Chris
On Sun, Oct 2, 2011 at 7:38 AM, Chris Rowson
wrote:
> Thanks Peter, I'll give that a try.
>
> Chris
>
> On Sep 30, 2011 8:01 PM, "Peter Etchells"
> wrote:
>> results=db(db.data.belongs([p[1] for p in postcodes).select()
>
Call me wierd, but I'm finding it a little hard to get my head around
putting together select statements using the DAL. I think I must just
be having a stupid couple of weeks!
I understand that using the DAL & SQLFORM etc for inserts will help
protect me against SQL Injection so I'm happy to keep
Thanks Peter, I'll give that a try.
Chris
On Sep 30, 2011 8:01 PM, "Peter Etchells"
wrote:
> results=db(db.data.belongs([p[1] for p in postcodes).select()
I'm trying to learn to use the DAL.
I've been reading through chapted 6 of the web2py book and I'm sorry
if I missed the answer there, but here I go!
A user enters his/her postcode and this is checked against an API
which issues us back the 10 closest postcodes. We store the 10 closest
postcodes
I gave it a try and found that when using the 'amy' editor I can't
scroll all the way to the bottom of the text.
Never mind, thanks for the advice.
Chris
On Thu, Sep 22, 2011 at 9:55 PM, wrote:
> I'll give it a go and see if it works. Thanks.
>
> Chris
>
>
>
> -- Sent from my HP TouchPad
> ___
Hi all,
I've just noticed that the web2py web-based text editor can't cope
with this regex
requires=IS_MATCH("^([Gg][Ii][Rr]
0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]
{0,1}[0-9][A-Za-z]{2})$"
gt;
>
> On Thu, Sep 22, 2011 at 7:33 AM, Chris Rowson
> wrote:
>>
>> Quick question,
>>
>> If I put my validators in the model like this:
>>
>> db.data.speedtesturl.requires=IS_NOT_IN_DB(db,
>> 'data.speedtesturl',error_message=
Quick question,
If I put my validators in the model like this:
db.data.speedtesturl.requires=IS_NOT_IN_DB(db,
'data.speedtesturl',error_message='This speedtest URL is already in
the database. Please provide another')
They only seem to work if I use SQLFORM.
If I create a SQLFORM and then a
I ended up with something like this:
http://pastebin.com/Y9keC9tB
Chris
On Mon, Sep 19, 2011 at 8:42 PM, Chris Rowson
wrote:
> Thanks all!
>
> Chris
>
> On Mon, Sep 19, 2011 at 6:49 PM, Phyo Arkar wrote:
>> I like lxml more , and check pyquery! jQuery of python at serve
Thanks all!
Chris
On Mon, Sep 19, 2011 at 6:49 PM, Phyo Arkar wrote:
> I like lxml more , and check pyquery! jQuery of python at server side.
>
> On 9/20/11, Bruno Rocha wrote:
>> I dont know your needs but, you can pass any XML to web2py TAG[''] helper so
>> then you can use Server side DOM to
I did look at that Bruno, but some of the articles I read suggested that it
is not very memory efficient?
Chris
On Sep 19, 2011 3:44 PM, "Bruno Rocha" wrote:
> I use xml minidom and it is easier.
>
> http://zerp.ly/rochacbruno
> Em 19/09/2011 11:40, "Chris Rowson"
o have a python parser.
>
> But if you can use the JSON API... much simpler.
>
> mic
>
>
> 2011/9/19 Chris Rowson :
>> Anybody using xml.etree?
>>
>> I asked this question over at the Python tutors group but it seems
>> that few people there had experience o
Anybody using xml.etree?
I asked this question over at the Python tutors group but it seems
that few people there had experience of it.
I'm trying to access a UK postcode API at www.uk-postcodes.com to take
a UK postcode and return the lat/lng of the postcode. This is what the
XML looks like: htt
; single request. Each request is handled by a new thread (from a thread
> pool).
> Anthony
>
> On Saturday, September 17, 2011 11:06:14 AM UTC-4, Massimo Di Pierro wrote:
>>
>> On Sep 17, 6:31 am, Chris Rowson wrote:
>> > Hi folks,
>> >
>> > I
I had read a little about that already, but found myself a little confused
as to when an object does or does not continue to refer to another object as
described in reference counts. At least you've confirmed I'm on the right
track. I'll go back to the books.
Thank-you
Chris
On Sep 17, 2011 2:08
Hi folks,
I'm trying to get my head around what happens to data stored in memory when
it isn't needed anymore.
Let me give you an example. Let's say I create a function which returns a
dict called 'results' populated with data from an external source each time
a user registers (for instance let's
I had the same problem the other day. Then it reverted itself again.
Chris
On Thu, Sep 15, 2011 at 12:50 PM, kenji4569 wrote:
> I met exactly the same problem. My browser is set with Japanese and
> has nothing to do with French settings.
>
> Regards,
> Kenji
>
> On 9月15日, 午後7:10, guruyaya wrote
Started to rework this. Changed to an inner join (I believe!) as suggested.
rows=db(db.data.provider==db.providers.id).select(db.data.lon,
db.data.lat, db.providers.name)
Chris
On Mon, Sep 12, 2011 at 9:54 PM, Chris Rowson
wrote:
> Thank you both. I shall revisit, replace with a join
Thank you both. I shall revisit, replace with a join and put the logic
into the controller rather than the view :-)
Chris
I have two tables:
-
db.define_table('providers',
Field('name'),
Field('email'),
Field('tel')
db.define_table('data',
Field('dataowner', db.auth_user, default=auth.user_id,
writable=False, readable=
Thank you everyone for the advice.
Chris
On Sep 11, 2011 4:47 AM, "pbreit" wrote:
> Good point.
Cool, Thanks Anthony!
Does the onvalidation option have benefits over and above the way I've done it?
Chris
> Another option might be using an onvalidation function:
> http://web2py.com/book/default/chapter/07#onvalidation
> Anthony
>
> On Saturday, September 10, 2011 4:37:08 PM UTC-4, leftcase
> Hi there,
>
> I bought the web2py .pdf, and have been reading it, but I'm struggling
> a little bit with:
>
> http://www.web2py.com/book/default/chapter/07#SQLFORM
>
> Specifically the section "SQLFORM without database IO"
>
> I have 2 fields, lon & lat I'd like to calculated from a postcode and
Hi there,
I bought the web2py .pdf, and have been reading it, but I'm struggling
a little bit with:
http://www.web2py.com/book/default/chapter/07#SQLFORM
Specifically the section "SQLFORM without database IO"
I have 2 fields, lon & lat I'd like to calculated from a postcode and
enter into the d
I'm a Python Web Dev noob, but I had a similar requirement. I created
this function to convert a postcode into lon & lat data suitable for
use in Google Maps. It's a work in progress, not very elegant, and it
doesn't have any error management but it's a start. Hopefully someone
on the list will be
Ah cool.
Thanks,
Chris
On Wed, Aug 31, 2011 at 10:30 PM, Anthony wrote:
> CLEANUP does not actually take a list of ascii codes as an argument.
> Instead, it takes a regular expression, which defaults
> to '[^\x09\x0a\x0d\x20-\x7e]'.
> Anthony
>
> On Wednesday, August 31, 2011 5:18:43 PM UTC-4,
Hi folks,
I'm having a bit of mental blank.
I'm trying to create a validator in the model for a postcode entry in
SQLFORM to strip all spaces and non-alphanumeric characters like this:
db.data.postcode.requires=[IS_NOT_EMPTY(), CLEANUP([48-57,65-90,97-122])]
I'm getting the following error:
(u
> Good to hear.
> It's possible using auth.user_id might also fix it like that.
> This is what it says in the book:
> auth.user contains a copy of the db.auth_user records for the current logged
> in user or None otherwise. There is also also a auth.user_id which is the
> same as auth.user.id (i.e.
> You could perhaps try default=auth.user_id instead. I'm not totally sure if
> that behaves differently.
> I don't usually use is_in_db() so can't say for sure how that might be
> affecting it.
> Can you provide more of the error details?
I think I *might* have fixed it about the same time as you
> Looks OK at a high level. Is it working for you?
I thought it was until I logged in and out a couple of times and then
started getting an error:
"AttributeError:'NoneType' object has no attribute 'id"
Noticed a discussion here:
http://comments.gmane.org/gmane.comp.python.web2py/44801
Seems to
Hi all,
This is my first foray into web app design and so I wondered if it
would be possible to get a bit of a sanity check on what I'm doing to
ensure I'm understanding web2py correctly.
My database has a table which should store data collected by SQLFORM
along with the ID of the logged on user
Thanks for the rapid reply Massimo, It is much appreciated.
Chris
On Aug 30, 2011 12:23 AM, "Massimo Di Pierro"
wrote:
> Validation is always performed server side.
>
> if you use FORM(INPUT()) that each input gets its own
> requires=[..]
>
> if you use SQLFORM(table) than the require
44 matches
Mail list logo