[web2py] Re: pypdf sample code not working in a view

2014-11-10 Thread Mark Kirkwood
Ok so the above plan works fine*. *In the interest of completeness, the original demo code can be made to work sensibly on modern web2py (2.9.11). So you can remove the code in the controller and (essentially) paste it into a view. But a few corrections are needed - the major ones being adding

Re: [web2py] Re: pypdf sample code not working in a view

2014-11-10 Thread Mark Kirkwood
. If you can comment the code and assure it is working, that would be great! Feel free to contact me, I'm one of the current maintainers of pyfpdf, Best regards, Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Mon, Nov 10, 2014 at 8:38 PM, Mark Kirkwood mark.k

[web2py] Re: pypdf sample code not working in a view

2014-11-07 Thread Mark Kirkwood
Excellent - thanks. I'll pursue that approach. I (now) see that the generic.pdf in the welcome app is completely different from those I've been looking at (in that pypdf demo). Are there any up to date sample code snippits around? (I did check the web2py manual, but didn't see anything in

[web2py] pypdf sample code not working in a view

2014-11-06 Thread Mark Kirkwood
I have a web2py app that produces some html tabular output that I would like to optionally display as a pdf. Looking around it seems that pypdf is just the thing for this. I downloaded the sample app from https://code.google.com/p/pyfpdf/ and it works just fine. However it needs code in the

[web2py] List:string display missing the + and - since about 2.7

2013-12-17 Thread Mark Kirkwood
I'm making use of list:string to store registration numbers (for cats): db.define_table( 'cat', ... Field('reg_numbers', 'list:string'), format = '%(name)s' ) and using sqlform.grid in the 'cat' controller. For web2py versions = 2.4.x this worked fine - displaying a text

[web2py] Re: List:string display missing the + and - since about 2.7

2013-12-17 Thread Mark Kirkwood
I think this is due to me forgetting to update static/js/web2py.js from the 2.7 or 2.8 welcome app, but will confirm. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report

[web2py] Re: List:string display missing the + and - since about 2.7

2013-12-17 Thread Mark Kirkwood
Confirmed, the excellent quality of the Changelog included with the src is much appreciated. I must remember to read it *before* posting questions... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: Create a custom layout based on existing web site css

2012-12-03 Thread Mark Kirkwood
(response.menu)}} and add a few things like div class=flash{{=response.flash or ''}}/div {{=auth.navbar()}} {{include 'web2py_ajax.html'}} On Monday, 9 July 2012 03:16:00 UTC-5, Mark Kirkwood wrote: I am currently developing a web application using web2py. It is at the point where I want

Re: [web2py] Re: we should support this in DAL

2012-11-25 Thread Mark Kirkwood
I am wondering if there are some deeper issues getting NoSQL support in Web2py - for instance the model part seems pretty tied into relational ideas (e.g db.define_table and ..references db.dog etc). This design works really well and insulates developers from much of the fiddlyness of dealing

[web2py] Re: SQLFORM.factory unexpectedly sets id datatype to str

2012-11-24 Thread Mark Kirkwood
In additon, adding a second IS_INT_IN_RANGE validation condition is sufficient to coerce the field back to int. form=SQLFORM.factory( Field('dogid', 'integer', requires=[IS_IN_DB(db(db.dog), 'dog.id'), IS_INT_IN_RANGE(0, 1000)]) ) So it looks like IS_IN_DB is somehow getting

[web2py] Re: SQLFORM.factory unexpectedly sets id datatype to str

2012-11-23 Thread Mark Kirkwood
I don't believe so, in sqlite the table id fields appear to be integer types. Just to be sure, I have retested against postgres. Same behavour. --

[web2py] Re: SQLFORM.factory unexpectedly sets id datatype to str

2012-11-23 Thread Mark Kirkwood
However you are correct that it is db related - if I remove the requires directive i.e: form=SQLFORM.factory( Field('dogid', 'integer') ) Then the form will post successfully (if I type in an integer). I did wonder if the lookup list was causing the types to be confused, so

[web2py] Re: SQLFORM.factory unexpectedly sets id datatype to str

2012-11-22 Thread Mark Kirkwood
Thanks, Niphlod - However amending the form definition as you suggested, i.e: form=SQLFORM.factory( Field('dogid', 'integer', requires=IS_IN_DB(db(db.dog), 'dog.id', '%(name)s')), ) gives the same behaviour - i.e field is still a str. --

[web2py] SQLFORM.factory unexpectedly sets id datatype to str

2012-11-21 Thread Mark Kirkwood
Suppose I have an model like: db.define_table( 'dog', Field('name'), Field('type'), Field('vaccinated', 'boolean', default=False), Field('picture', 'upload', default=''), format = '%(name)s') and a controller like: @auth.requires_login() def dogtest(): theId = None

[web2py] Re: Non existent record in sqlform.grid handled differently in view to edit mode

2012-11-06 Thread Mark Kirkwood
Done. Issue 1135. Thanks! On Saturday, November 3, 2012 2:23:03 AM UTC+13, Massimo Di Pierro wrote: Can you please open a ticket about this. We can fix it asap. On Friday, 2 November 2012 02:32:07 UTC-5, Mark Kirkwood wrote: Suppose I have a simple controller like: @auth.requires_login

[web2py] web2py 2.0.6 performance improvement

2012-09-04 Thread Mark Kirkwood
Just a quick thank you - updated my (still alpha) cat breeding application ( http://www.egyptianmau.co.nz/pedigree/ ) from 1.99.7 to 2.06 - a very noticeable improvement in performance even running in CGI mode - very nice work! --

[web2py] Create a custom layout based on existing web site css

2012-07-09 Thread Mark Kirkwood
I am currently developing a web application using web2py. It is at the point where I want to customize the appearance to blend in with an existing html/templated site that I run - so I need to understand how to customize the web2py layout etc to make this happen. While there seems to be many

[web2py] Conditional deletes (ondelete etc) in sqlform.grid

2012-02-13 Thread Mark Kirkwood
I am attempting to implement a check that allows deletes only under some circumstances. I figured I would do this via the ondelete arg in the grid. Unfortunately I have run into a few stumbling blocks with this: 1/ The 1.99.4 code is busted - references 'ret' before it is defined Fortunately

[web2py] Re: Conditional deletes (ondelete etc) in sqlform.grid

2012-02-13 Thread Mark Kirkwood
if the user only sees actions that are going to work. On 14/02/12 13:11, Mark Kirkwood wrote: I am attempting to implement a check that allows deletes only under some circumstances. I figured I would do this via the ondelete arg in the grid. Unfortunately I have run into a few stumbling blocks

[web2py] Re: Database error from constraint violation seemingly ignored

2012-02-08 Thread Mark Kirkwood
You are correct, I was clicking the delete button on the grid. Yes, I think checking the success or otherwise of the Ajax request sounds like the right thing to do - since calls to the db can fail for all sorts of reasons, not just constraints. Regards Mark Anthony wrote: In your case,

[web2py] Database error from constraint violation seemingly ignored

2012-02-07 Thread Mark Kirkwood
I'll illustrate with a variant of the dog example schema (see below): I have a 'sire_id' field that refers back to the 'dog' table. However I have the ondelete attribute set to 'RESTRICT' [1]. I'd like to prevent dogs that have sired other dogs being deleted. When I attempt this it looks liek

[web2py] Re: Database error from constraint violation seemingly ignored

2012-02-07 Thread Mark Kirkwood
)! Thanks Mark On 08/02/12 20:10, Mark Kirkwood wrote: I'd like to prevent dogs that have sired other dogs being deleted. When I attempt this it looks liek it has worked (i.e one less row in the grid), but on refresh I see the alleged deleted row back again.

[web2py] Re: Self Referential references in models not getting id decoded automatically

2012-02-05 Thread Mark Kirkwood
I even redid the example from scratch and...still seeing id's instead of names in edit mode. Blast need to try again tomorrow and see if I can sort that. Well at least figured out one of the problems! On 05/02/12 15:51, Mark Kirkwood wrote: However that brings back a header 'dog.name

[web2py] Re: Self Referential references in models not getting id decoded automatically

2012-02-05 Thread Mark Kirkwood
- oops). Anyway, thanks for the help! Mark On 05/02/12 22:23, Mark Kirkwood wrote: *But*... now the edit drop down list is showing id's instead of names... scratches head I'm sure that *was* working before

[web2py] Self Referential references in models not getting id decoded automatically

2012-02-04 Thread Mark Kirkwood
In order to generate a model with foreign references to itself you need to use'reference table' as opposed to db.table in the Field defines. While this works, I noticed that drop down lists and id-name mapping were missing from the generated grid. I initially thought this was due to using the

[web2py] Re: Self Referential references in models not getting id decoded automatically

2012-02-04 Thread Mark Kirkwood
I see that this has been noted as an issue here: http://code.google.com/p/web2py/issues/detail?id=382 I am using 1.99.4, anything I can try? Regards Mark On 05/02/12 13:17, Mark Kirkwood wrote: In order to generate a model with foreign references to itself you need to use 'reference table

[web2py] Re: Self Referential references in models not getting id decoded automatically

2012-02-04 Thread Mark Kirkwood
On 05/02/12 13:24, Mark Kirkwood wrote: I see that this has been noted as an issue here: http://code.google.com/p/web2py/issues/detail?id=382 I am using 1.99.4, anything I can try?

[web2py] Simple edit form example

2012-02-01 Thread Mark Kirkwood
I have just started looking at using web2py to build a web application, as it seems like the right balance between capability and simplicity for me. While I have found the example apps and docs good, there is one glaring omission - how to do updates/edits in forms. For example I worked

[web2py] Re: Simple edit form example

2012-02-01 Thread Mark Kirkwood
Anthony abastardi@... writes: The only built-in methods for searching (via the user interface) are crud.search and SQLFORM.grid (and .smartgrid). def search_dogs():     form, records = crud.search(db.dog)     return dict(form=form, records=records) or def search_dogs():     return