[web2py] Re: Reddit development using web2py

2013-08-30 Thread Martin Barnard
Reddit does not run on web2py. It runs on python and (I think pylons?). However, if you do wish to peruse the reddit's source code, you could try their github repo: https://github.com/reddit On Thursday, August 29, 2013 6:18:30 PM UTC+3, nama...@gmail.com wrote: > > I want to develop replica

[web2py] Re: SQLFORM.factory and list:integer error

2013-06-20 Thread Martin Barnard
_type)) File "/home/www-data/web2py/gluon/dal.py", line 1805, in represent obj = map(int,obj) ValueError: invalid literal for int() with base 10: '' On Thursday, June 20, 2013 2:31:51 PM UTC+3, Martin Barnard wrote: > > That code listing is from dal.py. I did

[web2py] Re: SQLFORM.factory and list:integer error

2013-06-20 Thread Martin Barnard
That code listing is from dal.py. I didn't really want to poke too much at that as I haven't had time to examine it too deeply. I should probably upgrade to latest web2py before trying anything else :) */scurries off to upgrade the server...* On Thursday, June 20, 2013 12:45:28 AM UTC+3, Niphl

[web2py] SQLFORM.factory and list:integer error

2013-06-19 Thread Martin Barnard
I'm trying to figure out why I get an error with the following code: def index(): ids=[] form=SQLFORM.factory( Field('employees', 'list:integer'), ) if form.process().accepts: if form.vars.employees: for v in form.vars.employees: ids.appe

Re: [web2py] Re: web2canvas looks nice

2013-06-17 Thread Martin Barnard
That would explain my confusion when changing the language didn't change the menu :) On Monday, June 10, 2013 5:06:25 AM UTC+3, Gustavo Souza wrote: > > Hello guys, I'm the one responsible for this project, I intend to make it > multi language, is currently only in Portuguese. > > > 2013/6/8 sa

Re: [web2py] Re: legacy database with reserved word field name

2013-04-08 Thread Martin Barnard
You can simply set DAL(..., check_reserved=None) >> >> the problem is, will Oracle accept the SQL generated by DAL? You need to >> try. I do not know. >> >> >> On Sunday, 7 April 2013 21:32:03 UTC-5, Martin Barnard wrote: >>> >>> Continuing on my

Re: [web2py] Re: legacy database with reserved word field name

2013-04-08 Thread Martin Barnard
d to keep doing it every time I update web2py. Martin On 8 April 2013 22:48, Massimo Di Pierro wrote: > You can simply set DAL(..., check_reserved=None) > > the problem is, will Oracle accept the SQL generated by DAL? You need to > try. I do not know. > > > On Sunday, 7 April

Re: [web2py] Re: legacy database with reserved word field name

2013-04-08 Thread Martin Barnard
Tried. Didn't work. On 8 April 2013 19:57, Derek wrote: > try putting it in [brackets] or "quotes". > > > On Sunday, April 7, 2013 7:32:03 PM UTC-7, Martin Barnard wrote: >> >> Continuing on my Oracle adventures, I have found a table which I need to >&

[web2py] legacy database with reserved word field name

2013-04-07 Thread Martin Barnard
#x27;t actually drop the table). I think that the reserved_sql_keywords is a good thing, but it would be nice if we could occasionally 'force' a table or field name for legacy database access. *Can anybody think of ways of bypassing reserved words checking for legacy dbs table

Re: [web2py] Re: another oracle question :(

2013-04-06 Thread Martin Barnard
ria" is not a function, but a fixed value > > On Saturday, April 6, 2013 4:27:10 AM UTC+2, Martin Barnard wrote: > >> Thanks again for the help - it's invaluable to the oracle noob! :D >> >> I'm actually building an analysis system so that my boss ca

Re: [web2py] Re: another oracle question :(

2013-04-05 Thread Martin Barnard
the list that I'm passing, as I read that it cannot exceed 1000 items, but this shouldn't be an issue in normal use, and I'll wrap it in a test first. More efficient methods welcome!!! Martin On 6 April 2013 01:11, Niphlod wrote: > > > On Friday, April 5, 2013 11:58:37 PM

Re: [web2py] Re: another oracle question :(

2013-04-05 Thread Martin Barnard
Thanks for the info, Niphlod. I will look into the efficiency of the IN clause for my needs, as it appears to offer a solution which may mollify the IT DBA, and his demands for bind vars (they are concerned that a looped select will bring the db to it's knees). Martin Barnard. On 6

[web2py] Re: another oracle question :(

2013-04-05 Thread Martin Barnard
e')) > When binding, you can first prepare the statement and then execute None > with changed parameters. Oracle will handle it as in the above case, > governed by the rule that one prepare is enough when variables are bound. > Any number of executions can be involved for prepared statements. >

[web2py] another oracle question :(

2013-04-02 Thread Martin Barnard
I have a list of ids [1,2,3,...,n] and I want to run a query on an oracle table (using cx_oracle), but I have to use bind variables. Anybody know the correct format before I start experimentation? Will I be forced to use db.executesql? Thanks, Martin Barnard -- --- You received this

[web2py] Re: retrieving blobs from legacy (oracle) database

2013-04-02 Thread Martin Barnard
uery"* to "*from gluon.dal import DAL, MySQLAdapter, OracleAdapter, PostgreSQLAdapter, Expression, Table, Field, SQLCustomType*" Thanks for the help, guys! Martin On Monday, April 1, 2013 2:26:23 AM UTC+3, Massimo Di Pierro wrote: > > This should do it: > > Field('

[web2py] retrieving blobs from legacy (oracle) database

2013-03-29 Thread Martin Barnard
Hi, I have read-only access to a legacy oracle database which is storing image files as blobs. I cannot modify the model to include a 'filename' field, or alter the table in any way. How can I display returned images as a stream? I.e. model looks like this: odb.define_table('player_photo',

[web2py] Re: SQLFORM list with indirect labels

2012-06-03 Thread Martin Barnard
You know, this should be in the book. Hereon the section regarding record representation would be a good point. Martin On Saturday, 2 June 2012 21:14:56 UTC+3, Anthony wrote: > > db.define_table('customers_job', >> Field(

Re: [web2py] Re: SQLFORM list with indirect labels

2012-06-02 Thread Martin Barnard
Much thanks. I've been struggling with various sub-par implementations of this for a while. I wondered how you could get a recursive represent. M. On 2 June 2012 21:14, Anthony wrote: > db.define_table('customers_**job', >> Field('city', db.cities), >> Field('description', 'text'), >>

[web2py] SQLFORM list with indirect labels

2012-06-02 Thread Martin Barnard
I have some linked tables like so: db.define_table('cities', Field('city', 'string'), format="%(city)s" ) db.define_table('customers', Field('customer', 'string'), Field('contact_name', 'string'), format="%(customer)s" ) db.define_table('customers_job', Field('city', db.cit

[web2py] threaded comments system

2012-04-13 Thread Martin Barnard
I'm trying to create a threaded comments system for part of a work log. I would like it to have dynamically generated forms, which, once posted, update the contents of the containing DIV() with the comment and removes the form. This way I don't have 100's of form objects cluttering up a system,

Re: [web2py] Madeira Cloud

2012-04-08 Thread Martin Barnard
And a very nice island it is too. Nice levadas, if a little steep :) On Sunday, 8 April 2012 11:58:52 UTC+3, Ramos wrote: > > Madeira is the name of an Island in Portugal > :) > > 2012/4/8 Massimo Di Pierro > >> http://www.madeiracloud.com/ >> > >

[web2py] multiselect widget not working in component.

2011-07-17 Thread Martin Barnard
I'm having problems displaying the multiselect widget inside components. I have two actions which do the same thing, basically give us a list of tags, with which to select our multiple tags: ### Model staff_tags=['this', 'is', 'a', 'tag'] db.define_table('test_tagging', Field('tags', 'li

Re: [web2py] Re: Query construction question

2011-07-06 Thread Martin Barnard
No. There is a good chance that the person who uploaded the memo (db.memo_store.created_by) is not the same as the person viewing the memo (db.viewed_memos.created_by). My solution, for people who are interested in something similar: def unread_memos(): """ Will return a list of all unread

[web2py] Query construction question

2011-07-05 Thread Martin Barnard
I have the following models. I am storing memos in table *memo_store*, and user_views in *viewed_memos*. Each user can have multiple views for each memo. Every time they look at a memo, I store a new entry in* viewed_memos*. My question is: *How can I construct a query which will display all unr

Re: [web2py] Re: Need help in standardizing my coding and naming schemes before I start my main project

2011-02-01 Thread Martin Barnard
I'd be cautious about some of those field names. I'm not about to look them up, but they look suspiciously like they may collide with reserved words. I'm looking particularly hard at 'type' and 'text'. You may want to check that. Martin. I don't mind typing the extra characters now that work boug

Re: [web2py] Re: Need help in standardizing my coding and naming schemes before I start my main project

2011-02-01 Thread Martin Barnard
General request for comments & corrections from the more experienced (than me) programmers in this group please. I really don't want to be giving bad advice. Anyway, on to the advice... Rupesh, In the end, it doesn't matter what scheme you use, as long as you find it easy & your practices are con

[web2py] Fix for kpaxcms

2011-01-27 Thread Martin Barnard
Hi. I've been lurking here whilst trying out web2py (thanks for the software, Massimo!). I'm looking at building something similar to kpax, with a few modified tweaks. However, when I tried to change group permissions, I'd get this error. It's in access.py controller, change function: Error Tr