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
.
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
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
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
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
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
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)
-
(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
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
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
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.
--
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
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.
--
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
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
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!
--
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
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
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
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,
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
)!
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.
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
-
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
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
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
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?
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
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
29 matches
Mail list logo