Re: [web2py] Using multiprocessing in web2py

2011-03-01 Thread Lorin Rivers
David, If you can do any of the analysis ahead of time and store that, it might help. That's what I had to do. In my case, I also discovered that the database I was using wanted more RAM than I could give it at the time and had to do my real-time analysis in smaller chunks. -- Lorin R

Re: [web2py] no json - cont.

2011-03-01 Thread Lorin Rivers
On Mar 1, 2011, at 5:18 AM, darkblue_b wrote: > as per the very simple instructions, I wrote a controller function to > return a few items.. > generic.html and generic.xml work, but generic.json and generic.rss > fail > > just learning still, I searched the newsgroup and found

[web2py] More general question: "matchmaking" based on survey/quiz results

2011-02-25 Thread Lorin Rivers
ken the survey. Can you think of a light-weight solution? Thanks! -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: Setting the title tag

2011-02-09 Thread Lorin Rivers
Thanks! In case someone stumbles upon this thread, here's what I did: controller: theTitle = ctab.title, str(timestart), "to", str(timeend) response.title = " ".join(theTitle) layout.html: {{=response.title or URL()}} -- Lorin Rivers Mosasaur: Killer Technica

Re: [web2py] Re: Setting the title tag

2011-02-09 Thread Lorin Rivers
OK, I'm getting there. How do I specify response.title in my view? On Feb 9, 2011, at 12:55 PM, DenesL wrote: > If you are using the default layout.html file then just set > response.title to whatever title you want. > > > On Feb 9, 1:50 pm, Lorin Rivers wrote:

[web2py] Setting the title tag

2011-02-09 Thread Lorin Rivers
One of the mental challenges I have with mvc/layout approach is how to assign values from the "inside-out". Almost all the work I have done so far is in the views. I'd like to dynamically change the title tag (e.g., in the element). How does that work? -- Lorin Rivers M

Re: [web2py] Re: rows.find doesn't find anything

2011-01-18 Thread Lorin Rivers
>print row > > should be > >for row in semaphore_rows.find(lambda row: > row.table_name=='data_table'): >print row > > else you compare only the first char with 'date_table' > > On Jan 18, 1:05 pm, Lorin Rivers wrote: &

[web2py] rows.find doesn't find anything

2011-01-18 Thread Lorin Rivers
print db4(db4.rollup_semaphore.table_name=='data_table').select() Returns: rollup_semaphore.id,rollup_semaphore.table_name,rollup_semaphore.rollup_status 1,data_table,False Which is what I expect the first to return. What am I doing wrong? -- Lorin Rivers Mosasaur: Killer Technical Marketing &

Re: [web2py] social network idea

2011-01-17 Thread Lorin Rivers
, gender, > age, bookmark category (could compete with match.com too) > - You can then choose to be notified when a given person bookmarks > something new (like twitter) > - You can check who is following your bookmarks. > > Massimo -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Basic Python ignorance? simplejson throwing "TypeError("key " + repr(key) + " is not a string")"

2011-01-17 Thread Lorin Rivers
on(optimizers), escape=False)}}; Where optimizers is a list that looks like this: It throws the error, saying this: TypeError: key ('S0001',) is not a string -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Trying to pivot some date, need to add nulls for missing rows

2011-01-16 Thread Lorin Rivers
12/13/2010 22:00:00,76,,195 If the 'S0001' data was missing for that time. It's probably really easy, but I'm struggling. -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Output of sum(), simplifying the JSON

2011-01-14 Thread Lorin Rivers
S0001", "Po_avg_sum": 519.912549612443 }, { "FreezeTime": "2010-12-12 19:00:00", "StringID": "S0002", "Po_avg_sum": 532.390706326218 }] What's the easiest way to get that? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] JSON questions and a workaround

2011-01-13 Thread Lorin Rivers
;t seem like it should be necessary. def function(): dbset = db() records = dbset.select(db.table.field1, db.table.field2, orderby=db.table.field1) otherrecords = records.as_list() Then in my generic.csv, I use records and in generic.json I use otherrecords. -- Lorin Rivers Mosasaur: K

Re: [web2py] Re: generic.csv works perfectly, generic.json reports no json?

2011-01-13 Thread Lorin Rivers
What do I put in generic.json to expose the details of the exception? On Jan 13, 2011, at 13:46 , Wikus van de Merwe wrote: > Do you have the "generic.json" view? Change it to print out the details of > the exception thrown there. My guess is that you need escaping=True.

Re: [web2py] Best practice for including python libraries with my app

2011-01-13 Thread Lorin Rivers
ratuitos e Inteligentes > > > > 2011/1/13 Lorin Rivers > >> I am using tabular <http://www.parsemydata.com/tabular> (which requires >> numpy), as well as psycopg2 and a number of other libraries. >> >> The default location for such things is one of the loc

[web2py] Best practice for including python libraries with my app

2011-01-13 Thread Lorin Rivers
What's the best practice for this sort of thing? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] generic.csv works perfectly, generic.json reports no json?

2011-01-13 Thread Lorin Rivers
uot;. What gives? How can I make this more generic? I'd like to be able to use the same url conventions to return json for use in charts. Thanks! -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: Not open source yet... but

2011-01-06 Thread Lorin Rivers
Thanks, Massimo! Looking forward to checking out the processing stuff! On Dec 30, 2010, at 18:32 , mdipierro wrote: > Source: http://code.google.com/p/emte-trading/ > -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Cron: what happens if a process isn't finished and the next time to start it comes again?

2010-12-28 Thread Lorin Rivers
I am working on moving some of the computation-intensive processes to a cron-launched scheme. I have some that run every minute, every 2 minutes, every 5 minutes and every 15 minutes. In production, it's possible that the volume of incoming data would result in the task not finishing before its ne

Re: [web2py] Re: List of fields to "orderby" expression

2010-12-20 Thread Lorin Rivers
Yep, thanks! On Dec 20, 2010, at 11:28 , mdipierro wrote: > I think this is what you are asking: > > myorderlist = [db.table.field1, db.table.field2] > orderby = reduce(lambda a,b:a|b, myorderlist) > rows = db(db.table).select(orderby = orderby) > > > On Dec 20, 11:07

[web2py] List of fields to "orderby" expression

2010-12-20 Thread Lorin Rivers
How do I turn a list of fields to an orderby expression? In other words, If I have this: [db.table.field1, db.table.field2] I want this: db(db.table).select(orderby = db.table.field1 | db.table.field2) Thanks! -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.

[web2py] Rounding time

2010-12-16 Thread Lorin Rivers
I use it like this: finishtime = lasttime.replace(minute=round_off(lasttime.minute, lasttime.second, to_nearest=5), second=0) I'm too tired & ignorant to figure it out. -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] logging.conf for debugging

2010-12-16 Thread Lorin Rivers
SLOG_UDP_PORT), handlers.SysLogHandler.LOG_DAEMON) [formatter_simpleFormatter] format=%(asctime)s - %(name)s - %(levelname)s - %(message)s datefmt= On Dec 16, 2010, at 16:47 , Jonathan Lundell wrote: > On Dec 16, 2010, at 11:00 AM, Lorin Rivers wrote: >> >> I have logging writing to the console, but not to

[web2py] logging.conf for debugging

2010-12-16 Thread Lorin Rivers
I have logging writing to the console, but not to the log file. Starting with the example, I changed WARNING to DEBUG (everywhere--as soon as I get it working, I'll be more selective), I set [keys] to keys=consoleHandler,rotatingFileHandler. logs/web2py.log gets created on startup, but never gets

Re: [web2py] Simple debugger

2010-12-14 Thread Lorin Rivers
arbitrary python statements and expressions, as well as a > debugging environment that supports pdb-style commands, like ``s`` for > step, ``r`` for return (I think), etc. I don't remember the exact > commands, but I think you can get help by typing ``h`` or ``help``. > > O

Re: [web2py] Simple debugger

2010-12-14 Thread Lorin Rivers
hang out on identi.ca: http://identi.ca/foxbunny > > Gimp Brushmakers Guild > http://bit.ly/gbg-group -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] basic views question

2010-12-14 Thread Lorin Rivers
Thanks, I got it now. On Dec 14, 2010, at 14:10 , Bruno Rocha wrote: > so, you need views inside /views/reports/.html > > 2010/12/14 Lorin Rivers > >> No, it's in reports.py, a controller. >> >> On Dec 14, 2010, at 13:37 , Bruno Rocha wrote: >

Re: [web2py] basic views question

2010-12-14 Thread Lorin Rivers
No, it's in reports.py, a controller. On Dec 14, 2010, at 13:37 , Bruno Rocha wrote: > if def test() is defined inside default.py, the test.html should be in > /views/default/test.html > > 2010/12/14 Lorin Rivers > >> I have an app "Debug", a contro

[web2py] basic views question

2010-12-14 Thread Lorin Rivers
est.html: {{response.files.append(URL(r=request,c='static/stylesheets',f='styles.css'))}} {{extend 'layout.html'}} What's up? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: Simple debugger

2010-12-14 Thread Lorin Rivers
stu...@brankovukelic.com >> >> Check out my blog:http://www.brankovukelic.com/ >> Check out my portfolio:http://www.flickr.com/photos/foxbunny/ >> Registered Linux user #438078 (http://counter.li.org/) >> I hang out on identi.ca:http://identi.ca/foxbunny >>

Re: [web2py] web2py entry on wikipedia needs to be updated

2010-12-12 Thread Lorin Rivers
ng.com/search?q=web2py&go=&form=QBRE&filt=lf > > [3] > http://search.yahoo.com/search;_ylt=AgEtnq9o2r4IzMOQfEIWyNubvZx4?p=web2py&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701 > > > > -- > > Bruno Rocha > http://about.me/rochacbruno/bio -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: Test for null not in a form

2010-12-12 Thread Lorin Rivers
As far as I can tell, the only place null is mentioned in the DAL page is in the definition of tables. On Dec 12, 2010, at 17:35 , mdipierro wrote: > The book never says that None is "NULL"? > I will check. That would be a big omission. > > Massimo > > On Dec 12,

Re: [web2py] Re: Test for null not in a form

2010-12-12 Thread Lorin Rivers
No kidding. That should be called out in The Book. On Dec 12, 2010, at 17:14 , mdipierro wrote: > db(db.mytable.myfield!=None).select() > > On Dec 12, 5:02 pm, Lorin Rivers wrote: >> Sometimes in the app I'm working on the default values aren't set in a >> co

[web2py] Test for null not in a form

2010-12-12 Thread Lorin Rivers
eld is not NULL;" -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: anybody use the web2py IRC chat?

2010-12-12 Thread Lorin Rivers
ukelić >> >> bg.bra...@gmail.com >> stu...@brankovukelic.com >> >> Check out my blog:http://www.brankovukelic.com/ >> Check out my portfolio:http://www.flickr.com/photos/foxbunny/ >> Registered Linux user #438078 (http://counter.li.org/) >> I hang o

[web2py] Translate this SQL to DAL?

2010-12-12 Thread Lorin Rivers
THere are a few aspects of the DAL that I can't quite get my head around. For example, how would I do this? select max(reqtime) from arraydata_table where rollupid = 0 -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] routes conundrum

2010-12-06 Thread Lorin Rivers
* > On Mon, Dec 6, 2010 at 12:35 PM, Lorin Rivers wrote: > >> We've encountered a bug where our app behaves differently if you access it >> via /AppName/ than it does if you access it via /AppName/default/index >> >> What would likely explain that and how should I g

[web2py] routes conundrum

2010-12-06 Thread Lorin Rivers
We've encountered a bug where our app behaves differently if you access it via /AppName/ than it does if you access it via /AppName/default/index What would likely explain that and how should I go about ensuring identical behavior in either case? -- Lorin Rivers Mosasaur: Killer Tech

[web2py] Basic models question

2010-12-06 Thread Lorin Rivers
If a model is defined in db.py, everything in that application has access to it, correct? The only reason to define a model in a different file is if you only need to access that particular model in a similarly named controller, correct? Thanks! -- Lorin Rivers Mosasaur: Killer Technical

Re: [web2py] Re: List of fields, want to use in .select(myList)

2010-12-03 Thread Lorin Rivers
SRSLY?!?! facepalm. On Dec 3, 2010, at 17:29 , mr.freeze wrote: > records = dbset.select(*whichAttributes,orderby=t.f4|t.f5) > * unpacks a list > ** unpacks a dict > > On Dec 3, 5:16 pm, Lorin Rivers wrote: >> I have a list of Field variables >> whichAtt

[web2py] List of fields, want to use in .select(myList)

2010-12-03 Thread Lorin Rivers
I have a list of Field variables whichAttributes = [t.f1, t.f2, t.f3] and I want to use them in my .select, like so: records = dbset.select(whichAttributes,orderby=t.f4|t.f5) How do I unroll that list into the select? -- Lorin Rivers Mosasaur: Killer Technical Marketing <h

[web2py] convert a string to a table or field?

2010-12-01 Thread Lorin Rivers
rn db4.arraydata_table elif period = 1: return db4.array_mins elif period = 5: return db4.array_5mins -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: Scalability of web2py?

2010-11-29 Thread Lorin Rivers
nt turns on you. > > On Mon, Nov 29, 2010 at 7:49 PM, Lorin Rivers wrote: >> Unfortunately, the killing argument is "we know .NET will scale to thousands >> of nodes, blah, blah, blah". >> >> This from (a guy who's smart and I respect, honestly) w

Re: [web2py] Re: Scalability of web2py?

2010-11-29 Thread Lorin Rivers
eb2py will use mssql. > > If mssql does not scale well with web2py you have other options and do > not need to rewrite code. > > You can always reuse most of the design (html, js, css, images). > > Management costs. I am sure you can make the case it costs less to run

Re: [web2py] Re: Scalability of web2py?

2010-11-29 Thread Lorin Rivers
he Google datastore (these limitations will go away as soon as Google >> releases MySQL in the cloud, which they announced some time ago). >> >> Please ask the consultant: which .NET feature makes it scale any >> better than web2py or Rails? If he explains we can address it mo

Re: [web2py] Re: Scalability of web2py?

2010-11-29 Thread Lorin Rivers
than web2py or Rails? If he explains we can address it more > specifically. > > Massimo > > On Nov 29, 11:56 am, Lorin Rivers wrote: >> The project I'm working on has hired a consultant who is now recommending >> .Net in place of web2py or even rails. >> >&g

[web2py] Scalability of web2py?

2010-11-29 Thread Lorin Rivers
The project I'm working on has hired a consultant who is now recommending .Net in place of web2py or even rails. What's the 'largest' scale web2py is known to perform well on? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mai

[web2py] JSON into a html view

2010-11-29 Thread Lorin Rivers
How do I insert the results of a function into an html view as JSON? Specifically I need a javascript variable in the view to include my JSON. -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Tweaking JSON

2010-11-29 Thread Lorin Rivers
27;,605.00], ['2010-11-08 21:01',600.66]] At the moment I'm using the simplejson.dumps method as explained in The Book <http://web2py.com/book/default/chapter/09?search=json#simplejson>. What should I do? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Development Questions

2010-11-26 Thread Lorin Rivers
is to copy all the files from your project into your workspace, which caused me problems. That option is unclearly worded, so avoid all the copying option in the Eclipse UI. Hope that helps! If you are on the Mac I could probably provide some more tips. -- Lorin Rivers Mosasaur: Killer Techni

Re: [web2py] Re: Debugging my app

2010-11-26 Thread Lorin Rivers
er to the left of the code and it should > show a green dot. > > On Nov 26, 11:09 am, Lorin Rivers wrote: >> I have python run, my web2py app is running, I can load it in the web >> browser in eclipse, the breakpoints are showing in the list of breakpoints >> and in

Re: [web2py] Re: Debugging my app

2010-11-26 Thread Lorin Rivers
verify your interpreter > setup. > > On Nov 26, 10:37 am, Lorin Rivers wrote: >> So you just click (or whatever the gesture is) to the side of the line you >> want to break at and it just works? >> >> To start a session, you right-click on web2py and start a debu

Re: [web2py] Re: Debugging my app

2010-11-26 Thread Lorin Rivers
rks like a champ. I can set breakpoints, > inspect variables, create expressions at runtime. Very handy, not to > mention that the mercurial eclipse plugin makes it very easy to > update. > > On Nov 26, 10:25 am, Lorin Rivers wrote: >> Getting pretty sick of using 'print

[web2py] Debugging my app

2010-11-26 Thread Lorin Rivers
Getting pretty sick of using 'print' to debug. I tried pydbgr, but that didn't seem to work (crashed python). What other tools should I look at that will let me step through my web2py code? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur

Re: [web2py] Recipe about mixing web2py, pydev, GoogleCode and others

2010-11-26 Thread Lorin Rivers
http://pierreth.blogspot.com/2010/10/web2py-eclipse-pydev-recipe.html > > I hope you like. Comments are appreciated. -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] 'this or that' request with a url

2010-11-23 Thread Lorin Rivers
hing_else" request.var['bar']: ["this", "that"] On Nov 23, 2010, at 9:34 , Jonathan Lundell wrote: > On Nov 23, 2010, at 6:28 AM, Lorin Rivers wrote: >> >> How can I perform an 'OR' request with a url? Or pass a list using a url? >&

[web2py] 'this or that' request with a url

2010-11-23 Thread Lorin Rivers
How can I perform an 'OR' request with a url? Or pass a list using a url? I have 'AND' figured out… -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Creating vars in a URL

2010-11-22 Thread Lorin Rivers
Phyko, Can you provide a simple example? On Nov 22, 2010, at 17:47 , Phyo Arkar wrote: > You better use JSON via Post , dont pass from URL. > > On Tue, Nov 23, 2010 at 3:48 AM, Lorin Rivers wrote: > >> I've got the starttime and endtime portions figured out, how do I r

Re: [web2py] Re: How do I capture the IDs from an 'insert' [solved]

2010-11-22 Thread Lorin Rivers
t model? > > On Nov 22, 10:45 am, Lorin Rivers wrote: >> Do I need to set up my model so that the source set will accept the id? >> >> I'm getting a KeyError on RollupID: >> myset.update(RollupID=db4.array_mins.insert(..) >> >> On Nov 22

[web2py] Creating vars in a URL

2010-11-22 Thread Lorin Rivers
0-11-08%2022:00:00%22> How should I construct a URL that includes the String bits? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: How do I capture the IDs from an 'insert'

2010-11-22 Thread Lorin Rivers
On Nov 22, 2010, at 10:51 , mdipierro wrote: > I do not underatnd the question. What is you current model? > > On Nov 22, 10:45 am, Lorin Rivers wrote: >> Do I need to set up my model so that the source set will accept the id? >> >> I'm getting a KeyError on

Re: [web2py] Re: How do I capture the IDs from an 'insert'

2010-11-22 Thread Lorin Rivers
form.accepts() >id=form.vars.id > > On Nov 22, 10:12 am, Lorin Rivers wrote: >> I have a set that represents the records within a minute time span, upon >> insert of the calculated summary into another table, I'd like to update the >> source set w

[web2py] How do I capture the IDs from an 'insert'

2010-11-22 Thread Lorin Rivers
I have a set that represents the records within a minute time span, upon insert of the calculated summary into another table, I'd like to update the source set with the ID of the inserted record. How do I do that? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosa

Re: [web2py] Re: Questions about sets

2010-11-20 Thread Lorin Rivers
I figured out what i was doing wrong. I should have been updating the datetime field with a string. -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: Questions about sets

2010-11-20 Thread Lorin Rivers
at 0x101cc9b90>, 'FreezeTime': None}> >>> type(row.ReqTime) On Nov 20, 2010, at 13:36 , CesarBustios wrote: > Did you try converting the Field to string? > > str(db4.data_table.ReqTime).split(".")[0] > > Lorin Rivers ha escrito: >> What ab

Re: [web2py] Re: Questions about sets

2010-11-20 Thread Lorin Rivers
n Nov 20, 2010, at 11:40 , mdipierro wrote: > something like this? > > db(query).update(field1=db.table.field2+db.table.field3) > > Massimo > -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Questions about sets

2010-11-20 Thread Lorin Rivers
t to update a field with the datetime calculated from that string. Set operations are so fast and rows, not nearly as. It would be awesome if I could do some of this stuff in the set. Thanks! -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosa

Re: [web2py] edit the book, get a free book

2010-11-20 Thread Lorin Rivers
let us know in this thread to avoid > duplication of work. > > The first responder gets the job. > > Massimo -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: DAL to Qurey Multiple defined IDs?

2010-11-20 Thread Lorin Rivers
: >>>>> >>>>> >>>>> >>>>> >>>>> to_get=[1,2,4,5] >>>>> >>>>> q= db.casedb.id in to_get # Guess this wont work? >>>>> >>>>> db(q).select(db.casedb.ALL) &g

[web2py] Model scope

2010-11-20 Thread Lorin Rivers
aults SHOULD be available globally, correct? Also, what is the procedure for debugging a problem where a model won't load and the migrations don't take effect? Thanks! -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: Migrations questions (help!)

2010-11-18 Thread Lorin Rivers
> Massimo > > On Nov 18, 2:47 pm, Lorin Rivers wrote: >> They are not set to false. >> >> I'm coming from a slight rails perspective (some experience with it). In >> rails, migrations are sequential. If you want to add a field to a table, you >> create a

Re: [web2py] Re: Migrations questions (help!)

2010-11-18 Thread Lorin Rivers
(i.e., add a field, change a field's type, and so on)? On Nov 18, 2010, at 14:29 , VP wrote: > Unless you have migration set to False, these things should be > automatic. > > > > On Nov 18, 1:53 pm, Lorin Rivers wrote: >> My database is PostgreSQL >> >&g

[web2py] Migrations questions (help!)

2010-11-18 Thread Lorin Rivers
ntal changes to databases? I'm stuck and need some help. -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Lorin Rivers
I think this would make a good thing to have in the examples. On Nov 17, 2010, at 13:45 , Massimo Di Pierro wrote: > my mistake > > m=db4.data_table.ReqTime.min() > firsttime = db4(db4.data_table).select(m).first()[m] > > On Nov 17, 2010, at 1:44 PM, Lorin Rivers

Re: [web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Lorin Rivers
b4.data_table.ReqTime.min() firsttime = db4(db4.data_table).select().first()[m] On Nov 17, 2010, at 13:30 , mdipierro wrote: > m=db.data_table.reqtime.min() > value = db(db.date_table).select().first()[m] > > On Nov 17, 11:43 am, Lorin Rivers wrote: >> executesql('selec

[web2py] Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Lorin Rivers
executesql('select min(reqtime) from data_table;') -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Documentation/Examples & Max

2010-11-16 Thread Lorin Rivers
I was going crazy when I was trying to figure out my max() question because of the frequent use of the person's name "Max" in the documentation and examples. -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] How can get max & min of a field in a rows object

2010-11-16 Thread Lorin Rivers
o craft queries for each time span to get the max, min, and count? I tried using find on rows but couldn't get max to work with that. -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Passing values to another action/view

2010-11-16 Thread Lorin Rivers
response.write(stream.getvalue(), escape=False) return dict(form=form,records=records,results=SQLTABLE(records, truncate=100,_class='results'),vars=form.vars,vars2=request.vars) else: results=[] return dict(form=form,records=records,results=results,vars=form.vars,vars2=request.vars) -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: Validate dynamically generated select SQLFORM.factory

2010-11-16 Thread Lorin Rivers
t; string 'Choose one' to the list 'options'. What would the best way to >> validate this be? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] ajax push

2010-11-16 Thread Lorin Rivers
Thanks for mentioning this, looks interesting. On Nov 15, 2010, at 15:24 , Michele Comitini wrote: > Does anyone use this with web2py? > > http://www.ape-project.org/ajax-push.html > > seems interesting! > > mic -- Lorin Rivers Mosasaur: Killer Technical Marketing <

[web2py] Validate dynamically generated select SQLFORM.factory

2010-11-15 Thread Lorin Rivers
list in the form. I have tried adding 'zero=T('Choose one')', both with and without adding the string 'Choose one' to the list 'options'. What would the best way to validate this be? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

Re: [web2py] Re: How do I construct my query to handle a multiple select?

2010-11-12 Thread Lorin Rivers
ime<='2010-11-08T22:00')) > if form.accepts(request) and form.vars.macs: > query = reduce(lambda a,b:a|b,[db4.data_table.MacAddr==x for x in > form.vars.macs]) > dbset=dbset(query) > records = > dbset.select(db4.data_table.MacAddr,db4.data_table.ReqTime,db4.data_tabl

Re: [web2py] Re: How do I construct my query to handle a multiple select?

2010-11-12 Thread Lorin Rivers
010, at 21:01, mdipierro wrote: > sorry I do not understand the question. > > On Nov 11, 6:12 pm, Lorin Rivers wrote: >> I have a form using this: >> options=[str(my_macaddr[i].MacAddr) for i in range(len(my_macaddr))] >> form=FORM(SELECT(*options,_name='MacAddrSele

[web2py] How do I construct my query to handle a multiple select?

2010-11-11 Thread Lorin Rivers
p; (db4.data_table.ReqTime>='2010-11-08T21:00') & (db4.data_table.ReqTime<='2010-11-08T22:00')).select(db4.data_table.MacAddr,db4.data_table.ReqTime,db4.data_table.Po) How do I create a loop that will return records using more than one selection in my f

Re: [web2py] Re: Not getting a result from query

2010-11-10 Thread Lorin Rivers
Alex, You put me on the right track! Thanks. -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Not getting a result from query

2010-11-09 Thread Lorin Rivers
epted variables {{=BEAUTIFY(form.vars)}} Errors in form {{=BEAUTIFY(form.errors)}} My form is displaying the request.vars and the three elements in the select(), but no results. What am I missing/doing wrong? -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Using the results of a select/option in a query

2010-11-09 Thread Lorin Rivers
r=='00AF') & (db4.data_table.ReqTime>='2010-11-08T21:00') & (db4.data_table.ReqTime>='2010-11-08T22:00')) Thanks! -- Lorin Rivers Mosasaur: Killer Technical Marketing <http://www.mosasaur.com> <mailto:lriv...@mosasaur.com> 512/203.3198 (m)

[web2py] Select/Option using a query & distinct=True

2010-11-08 Thread Lorin Rivers
set I have contains over 2.5M records). I did some googling and found this: <http://wiki.web2py.com/Form_Select_Options_from_DB>, but my version was giving me line continuation errors. I could use some hand-holding, can someone walk me through the parts (i.e., controller and view code to