Peter,
I was trying to get this to work last week and this is what finally worked
for me.
Here's a link to my earlier thread on the same topic.
https://groups.google.com/forum/?fromgroups#!topic/web2py/1h3Nd3_T9Js
In my case I'm storing small blobs in the table/model - although that's not
the b
Another suggestion for learning is Python Koans - based on Ruby Koans -
basically an interactive way to learn and test code by writing short lines
of code.
https://bitbucket.org/gregmalcolm/python_koans/wiki/Home
Check them out!
On Thursday, February 23, 2012 12:34:08 PM UTC-8, newbie wrote:
>
OK - Quick follow up here - I was able to display an blob image using the
call:
def list_image():
myid = 1# test
image=db(db.xim.id==myid).select(orderby=db.xim.title)
response.headers['Content-Type']='image/jpeg'
mystream = image.image_blob
return mystream
However
ulearn will be useful in the future - even if you decide to
learn another web framework. (MVC. CSS, SQL etc are common across many web
frameworks). Web2py however, is one of the more approachable ones with a
gently learning curve.
Hope this helps,
BrendanC
I thought the content type settings were handled automatically by the
framework.
Anyway - for some reason setting the response.headers to 'image/jpeg' does
not work - just get an empty/blank page.
I must be missing something else re handling gae blob properties - here's
my test code:
Any furt
would be helpful here.
TIA,
BrendanC
re ideas/issues/ and examples.
Sorry if this is a bit of a ramble, but I'd be curious to hear from other
App Engine developers here..
BrendanC
howesc,
My bad - you are correct. I retested bulk insert on GAE and it does work. I
made a mistake with my syntax:
Instead of:
imgids = db.imagetag.bulk_insert(ddlist)
I was using:
imgids = db.imagetag.bulk_insert(**ddlist)
Complete example:
#Test example - Build a list of dicts
e not got it
to work yet
- expect some surprises along the way to GAE enlightenment
For some decent sample Web2py/GAE code take a look here:
http://code.google.com/p/publicradioroadtrip/source/browse/
Hope this helps,
BrendanC
Just did some more testing -insert works OK, but bulk insert fails.
FWIW I think this was previously reported as a problem. Here;s a link:
https://groups.google.com/forum/#!searchin/web2py/bulk$20insert$20mapping/web2py/k9Pa2EdHNeA/1mcHn6bCWw4J
not covered in the docs (AFAIK).
BrendanC
2py/mg5ICyEjTCg/9WN8k7pO22MJ
TIA,
BrendanC
I've been experimenting with creating virtual fields and have come across
what may be a possible bug when
they are created via old style (class definitions).
I created a small table with 3 fields (ID, Name and dob). I've added some
virtual fields to compute the age in days using all the options
s it's easy to forget the important distinction here).
Thx again for your help.
BrendanC
y valid for Rails, Django etc - afaik
all these frameworks close and reopen connections for each request.
Again thanks for your thoughtful response to my initial question.
BrendanC
s difficult with the DAL:
1) In addition to the min/max values I also want the corrsponding record
info in the result set
2) At best the DAL may require 2 separate db requests
Any DAL guru's out there care to comment on this and provide an alternative
I'm testing standalone DAL usage - basically using the DAL to help
move/convert some tables from an external db.
Basically I'm trying to populate a dictionary with a subset of data from an
external database and then insert a series of data records into a new
table.
I expected to be able to po
Build a small demo app (nothing too complicated)- study some of the sample
apps and be sure to understand how the pieces fit together. Don't be afraid
to borrow liberally from other apps when you start your own app - no point
in reinventing the wheel.
BrendanC
x27; %item.name]]
chbx = (INPUT( _type='checkbox', _name= 'chk%s' %item.name,
_onclick="alert(this.checked)"))
arr.append ([[item.name],[ chbx]])
return XML(TABLE(*[TR(*r) for r in arr], _id = 'tagtable'))
BrendanC
ng to get it to work.
Hope this helps,
BrendanC
d' behaviour when extending layouts.
BrendanC
Bruno,
Exactly what I was looking for - many thanks! This is the sort of thing
that should be documented rather than hidden.
BTW - Where/how did you come up with that syntax?
Thx much,
BrendanC
able, but afaik it's pretty out of date.
TIA,
BrendanC
FWIW - I just create a new posting with some code that addresses the issues
mentioned here.
Here's the link: https://groups.google.com/forum/#!topic/web2py/CEHLCbMCPw0
Over and Out
BrendanC
OK - I posted earlier on this thread
https://groups.google.com/forum/#!topic/web2py/8yypDdtmG9g and vented some
frustration re the handling of computed columns. Rather than clutter up the
old threat I'm creating a new thread that contains the code that solves my
problem.
Feel free to offer alt
solution).
>From a practical standpoint maybe some beefing up of the json section of
the docs would be helpful. Right now I'm building a small demo app using
dojo, ajax and web2py - I'll be happy to share any useful code samples when
I'm a bit further on with my project.
BrendanC
his is not a gripe/complaint - just sharing this with you as I know you
are active on this forum and feedback on specific issues may be helpful to
others in the future.
BrendanC
lue. Also
understand that you cannot update the view - which you probably don't want
to do anyway.
BrendanC
; + itags[x]._extra['COUNT(tagref.tag)' ]+ '';
}
BrendanC
ave to jump through a few hoops to use a view and there are
some also potential maintenance issues. (FWIW views are very useful for
simplifying complex queries and it's a pity that they are not well
supported in most web environments).
Hope this helps,
BrendanC
ag)": 2}}
]}
OK - so far, so good. Now I need to extract the count info in my Ajax
response - However the count info is not easily (AFAIK) accessible - the
'_extra' structure is a web2py artifact that looks odd. I'm thinking there
must be a better way to pass the count info to my view (e.g. {"count":4}.
So how do I change this so I can reference the count info. Do I need to
change my controller code, or is there some (undocumented) way to reference
the '_extra' info in the json response.
I can't see anything in the docs on this - so hopefully someone here can
point me in the right direction here.
TIA,
BrendanC
Ignore my previous qn - they just showed up again - so it's probably some
sort of refresh issue with my broswer settings.
I've posted 2 messages over the past few days - one of which had several
replies - now I can't find any of these messages.
Any Ideas what's happening here?
TIA
BrendanC
th normal html the parameter position does not matter.
I'm not sure if Web2py has any 'troubleshooting' type documentation - but
this type of example could be a useful addition to the manual/docs/other.
Hope this helps someone.
BrendanC
OK - hope I can make this clear - it's more of a 'how to' design question
and not really web2py specific.
Imagine a view/template with a container/div that displays a (multipage)
image gallery - this is the landing page (prepopulated with random images.
The page has a Search sidebar to allow
g/error display issues
here - I know I need to build the custom templates by hand).
Interested to hear any comments/feedback as the only form examples I can
find are very basic (not real world).
TIA,
BrendanC
I know this has probably come up before, but I'd like to get my head around
the options to use Restful URLs with Web2py.
Are there any (recent) docs I can reference? I know there are some old
threads, but would like to get an idea where things stand currently.
(BTW - I'm not totally sold on r
ering - so I don't expect to push the envelop too much here.
Any thoughts,
TIA,
BrendanC
I have an existing test db that I was using with Rails, so it conforms
to the basic requirements re PK ID's etc. Can I use this in web2py
without re coding the table defs etc. What is the best way to do this?
I assume this comes up a lot, but I don't see this mentioned in the
docs.
TIA,
Brendan
ex(): return dict(people=db().select(db.person.ALL))
>
> #view
> {{extend 'layout.html'}}
>
> .red { backrgound-color: red; }
> .green {background-color: green; }
>
>
> {{for p in people:}}
>
> {{=p.name}}
> {{=p.balance}} td>
>
I'm interested in building a web2py demo that show color coded data in
a (jquery?) datagrid. Ideally cells would be color coded based on the
underlying data value (e.g. neg values, overdue dates etc. in red).
This type of display is pretty common in desktop apps, spreadsheets
etc. but I have not f
your computer and simlink it to the
> web2py/applications directory. Though keep in mind applications
> created through admin will always existin in
> web2py/applications/, but even then you do not need to use
> admin to create/or edit any of the files.
>
> -Thadeus
>
>
>
>
newbie qns -
I just d/loaded the latest version of web2py and on start up I see
that a small app I created some time ago is not listed in the app list
- the files are there in the web2py directory.
Is there something I need to do to include missing apps (this is on
Win XP - so it's not a symlink i
Just started looking at web2py and it looks quite impressive. I'm
always interested in finding existing code to review/modify when
learning a new technology. The video of the Electronic Health Record
app looks great and is something I might be interested in extending (I
have a lot of experience wit
44 matches
Mail list logo