[web2py] Any way to prompt for password for sensitive pages?

2011-04-15 Thread Brian M
Is there any easy way to re-prompt the user for their password before displaying certain sensitive pages? Here's what I'm thinking - the user logs in with auth and has access to most features of the site. But, when they go to a more important page they're first asked to re-enter their password -

[web2py] Re: How to build windows binary yourself?

2011-03-27 Thread Brian M
http://code.google.com/p/web2py/issues/detail?id=224 Issue created so this doesn't get lost. (script is attached if anyone wants it)

[web2py] Re: How to build windows binary yourself?

2011-03-27 Thread Brian M
Massimo, I'll be emailing you a revised script based off of Praneeth's standalone_exe.py shortly. I decided to make it a bit more interactive Features: 1) Creates web2py.exe with py2exe 2) Offers to remove the Windows DLLs that py2exe includes but are likely to have licensing issues. 3) Offers

Re: [web2py] Re: How to build windows binary yourself?

2011-03-20 Thread Brian M
Thanks Praneeth, looks like what your script builds & what I've got going produce pretty much the same output (once I comment out the few extra modules you've got that I don't). 1) I notice you're using shutil to just copy the applications directory rather than passing the correct tuples to dat

[web2py] Re: How to build windows binary yourself?

2011-03-20 Thread Brian M
OK, I've got a version that appears to build successfully - had to re-write the code to gather the list of data_files - reglob() didn't return files in expected format. It's working but currently is including a bunch of windows API files in the dist directory, so it would NOT be appropriate for

[web2py] How to build windows binary yourself?

2011-03-19 Thread Brian M
I was going to take a shot at building my own windows exe version of web2py and see if I could get pyodbc included, but ran into a problem. I started out with the source distribution of web2py 1.94.5. and then ran > python setup_exe.py web2py Everything seems to start building OK until it begi

[web2py] Re: What's the best way to backup/restore a web2py app

2011-03-14 Thread Brian M
Ack, Massimo's been spying on me and knows my workflow! :-) Dropbox is very nice for while you're developing & using different computers. As others have said, only works well if you're using sqlite or are just worried about the code & not the db. If you want to backup your database too you'll p

[web2py] Re: Cron not running/starting on windows

2011-03-09 Thread Brian M
I don't think cron works when running as a Windows service - at least it didn't in the past https://groups.google.com/forum/#!searchin/web2py/windows$20cron/web2py/OX7pXEGlSGM/hkspXZWKV1gJ I ended up just using a scheduled task that used wget to fetch certain controllers I wanted to run regular

[web2py] Re: some functionality to mix html and {{python expression}} is broken since 1.92.3, even back to 1.91.6

2011-03-07 Thread Brian M
Well you're missing a closing ) in this line - the A() is closed but the LI( is not: {{ myli = LI(A(myrow['strRegionNameRendered'], _href="#") }} Why not simplify your template down a bit - Having your LI's inside a DIV seems a bit odd. {{myUL = UL(_id="dhtmlgoodies_tree", _class="dhtmlgoodie

[web2py] Re: How to accept credit card payments (video)

2011-03-06 Thread Brian M
Yeah, I'm no PCI expert, but I'm pretty sure that storing the credit card number in the DB (un-encrypted/un-masked) is a no-no and in the very least is a bad idea. But Massimo's just illustrating how to use Authorize.Net For those who are interested in PCI-DSS https://www.pcisecuritystandards.o

Re: [web2py] Re: How to manipulate default tables and use them with powertable

2011-02-23 Thread Brian M
If you want to show the book's category in the heading, then you need to look up the corresponding category's record from the DB and pass it into your view. As far as the default, maybe just put it in the else clause of the form.accepts. Something like this (not tested): form = SQLFORM.facto

[web2py] Re: Date intervals split

2011-02-22 Thread Brian M
I don't think that web2py will recognize the HTML5 _type="date" yet though you could certainly leave it there for your users with an HTML5 compliant browser. Web2py knows which from.vars should be a python date object because of the requires=IS_DATE() in the form field declaration

[web2py] Re: save file

2011-02-21 Thread Brian M
Check the code shown here >> https://groups.google.com/d/msg/web2py/Kr-CBSeal_E/UVpKuaTbbqwJ for a sample of how to do an upload separate from a DB table.

[web2py] Re: How to manipulate default tables and use them with powertable

2011-02-21 Thread Brian M
Correction should be requires=IS_IN_DB(db(db.category.id>0),...) not requires=IS_IN_DB(db.category,...) form = SQLFORM.factory(Field("category",label="Book Category", requires=IS_IN_DB(db(db.category.id>0), 'category.id', 'category.name', error_message="Please pick a category from the list"))

[web2py] Re: How to manipulate default tables and use them with powertable

2011-02-21 Thread Brian M
Try something like this. (Untested but should be close) form = SQLFORM.factory(Field("category",label="Book Category", requires=IS_IN_DB(db.category, 'category.id', 'category.name', error_message="Please pick a category from the list"))) if form.accepts(request.vars, session, keepvalues=True):

[web2py] Re: Date intervals split

2011-02-21 Thread Brian M
You may want to look at the python-dateutil module from http://niemeyer.net/python-dateutil it makes it easy to do date manipulation like adding/subtracting days, weeks, months, etc. The _class part just makes a handy datepicker widget appear in the UI. The important part is to use form.vars i

[web2py] Re: Date intervals split

2011-02-21 Thread Brian M
Let web2py do its magic. Give each of those date input fields an _id and _class="date" The _class="date" will make web2py automatically assign the date selector widget to the field (and that widget needs the _id to work). Then when processing the form, use form.vars.Fin instead of request.va

[web2py] Re: New Widget and Slice - SELECT_OR_ADD_OPTION

2011-02-20 Thread Brian M
You could absolutely pull in the jqueryUI stuff from a local copy in your static folder. Then in your controller use something like: response.files.append(r=request, c="static", f="jqueryui/1.8.9/jquery-ui.js")response.files.append(r=request, c="static", f="jqueryui/1.8.9/themes/smoothness/jqu

[web2py] Re: Sqlite3 error

2011-02-20 Thread Brian M
What version of python are you using? That looks like you don't have the sqlite3 module though it is built-in to python 2.5 and later.

[web2py] New Widget and Slice - SELECT_OR_ADD_OPTION

2011-02-20 Thread Brian M
I've created a widget to augment the IS_IN_DB select widget with the ability to add a new option record within a dialog on the same page. Check it out; feedback is welcome. http://web2pyslices.com/main/slices/take_slice/121 ~Brian

[web2py] Re: GSoC

2011-02-20 Thread Brian M
Eh, why wait for someone else to make a widget - wrote a slice for my version http://web2pyslices.com/main/slices/take_slice/121

[web2py] Re: GSoC

2011-02-17 Thread Brian M
Include a built-in widget like the options_with_add_link slice (http://web2pyslices.com/main/slices/take_slice/11) to allow one to quickly add a new record into to a referenced table without having to go to a separate screen. Perhaps it's not glamorous but its presence might make adoption easi

Re: [web2py] Re: function in query

2011-02-15 Thread Brian M
If you're going to be searching based on the difference between date1 and date2 why not just include the difference in the DB itself with a computed field? (http://www.web2py.com/book/default/chapter/06#Computed-Fields)

[web2py] Re: onvalidation missing id field

2011-02-13 Thread Brian M
Ah, form.record.id that works - Thanks!

[web2py] onvalidation missing id field

2011-02-13 Thread Brian M
OK, so I'm wanting to calculate values for a few fields when a SQLFORM record update is accepted. My understanding is that I should use onvalidation = calculation_function but I'm finding that within my onvalidation function form.vars does not include the id field which I need to know in order

[web2py] Re: web2py as service - error

2011-02-08 Thread Brian M
Do you have the python win32 extensions installed? I know that messed me up the first time I tried to install as a service.

[web2py] Re: upload an excel sheet to be added to the system

2011-02-02 Thread Brian M
Neveen, I've got a mini app that I upload excel files to for later parsing, here's now I do it. Getting the file would probably be even easier if you used an upload field in the DB & CRUD forms. def excel_uploader(): response.subtitle = "Upload excel file " from gluon.sqlhtml import for

[web2py] Re: jquery.tooltip & jquery.cluetip do not work

2011-01-05 Thread Brian M
What does the FireBug extension for FireFox tell you?

[web2py] Re: new dal

2010-12-10 Thread Brian M
Thanks Massimo, executesql() seems to be working well now for SQLite & MS SQL

[web2py] Re: new dal

2010-12-08 Thread Brian M
s # easier to work with. row['field_name'] rather than row[0] return [dict(zip(fields,row)) for row in data] # see if any results returned from database try: return self._adapter.cursor.fetchall() except: return None ~Brian M

[web2py] Re: select issue

2010-12-08 Thread Brian M
I suspect that you need some extra () in there to correctly group your AND and OR. Maybe try the below version db(((db['table1'].verified == None) & (db['table1'].data_grade == 'grade1') & (db['table1'].valid != False)) | ((db['table1'].verified == False) & (db['table1'].data_grade == 'grade1') &

[web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread Brian M
Check out these pages on web2py slices: http://web2pyslices.com/main/default/search?query=FastCGI&criteria=tags On Dec 4, 6:21 pm, pbreit wrote: > Unfortunately, Python in general is a bit harder to deploy than HTML > and PHP. Site5 has a few different hosting options so to help out it > would be

[web2py] Re: new in trunk signed URLS

2010-12-04 Thread Brian M
Ok I'll work on making the change then. On Dec 4, 4:15 pm, Jonathan Lundell wrote: > On Dec 4, 2010, at 1:52 PM, Brian M wrote: > > > > > OK, so make it so that if desired some subset of the URL vars could be > > signed while still allowing other vars to be changed.

[web2py] Re: new in trunk signed URLS

2010-12-04 Thread Brian M
me anyway since a form or ajax call shouldn't need to manipulate them right? If this sounds like a better implementation to you Jonathan (and anyone else) then I can look at getting a patch to Massimo. ~Brian On Dec 4, 1:07 pm, Jonathan Lundell wrote: > On Dec 4, 2010, at 10:29 AM,

[web2py] Re: Deploying a site powered by web2py.

2010-12-04 Thread Brian M
Check the site5 forums for hints, it looks like wsgi isn't available on the shared hosting plans but fastcgi is. There are some Django how to threads you may be able to work off of and combine with what's in chapter 11 of the web2py book. ~Brian On Dec 3, 11:21 pm, RyaneD wrote: > Now I do under

[web2py] Re: new in trunk signed URLS

2010-12-04 Thread Brian M
Jonathan, How would you like to see this behave? Perhaps URL('index',args=[], vars={}, hash_key='xxx', hash=['args','vars']) and then URL.verify(hmac_key='xxx', hash=['args', 'vars]) so that you could choose which portions of the URL to sign and/or verify with hash=None triggering the original beh

[web2py] Re: Syntax for placeholders in executesql

2010-12-01 Thread Brian M
Yes, web2py's executesql when used with placeholders will simply pass the provided query & placeholders on to execute() method of whichever database driver is being used, thus you must use a syntax supported by your driver. In the case of SQLite & MS SQL that syntax is question marks (?) for Postgr

[web2py] Re: MSSQL Select statements

2010-11-13 Thread Brian M
b.executesql("SELECT foo,bar FROM my_table WHERE blah = ? > and something = ?" , ('criteria 1', 'criteria 2'), True) > > what do you mean by 'criteria 1' ... what kind of criteria? is that > where i put a python bit of code? > > On Nov 13, 3:23

[web2py] Re: MSSQL Select statements

2010-11-13 Thread Brian M
I use web2py and MS SQL with raw SQL queries often. results = db.executesql("SELECT foo,bar FROM my_table WHERE blah = ? and something = ?" , ('criteria 1', 'criteria 2'), True) The two extra pieces at the end will let you safely bind in query parameters and the final True arg makes it so that th

[web2py] Re: web2py 1.89.1 is OUT... update?

2010-11-13 Thread Brian M
Alex, I too am seeing that .load files are not being saved - add Chrome on windows 7 to the list. Firebug shows an error : area is not defined var data = area.textarea.value I suspect this is due to the regular editor not being defined (it is just a plain textarea instead of the usual edito

[web2py] Re: web2py 1.89.1 is OUT

2010-11-12 Thread Brian M
Probably typo in wizard at step 2 The Instructions say: If you need authentication remove the table "auth_user". Shouldn't that be: If you DO NOT need authentication remove the table "auth_user" On Nov 12, 9:22 am, mdipierro wrote: > Please give it a try and report any bug. > > 1.89.1 >

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread Brian M
p offer #5 from tab B and the client gets something completely different than what they wanted. It may not be a concern for your app, but it is something to consider. On Oct 24, 3:35 pm, cjrh wrote: > On Oct 24, 9:48 pm, Brian M wrote: > > > How about include all the calculated values i

[web2py] Re: Link-pass data to new view via session not on URL

2010-10-24 Thread Brian M
How about include all the calculated values in your form and add in an additional field that's a HMAC keyed hash of the others using a key that only you know? When the user submits, make sure the rest of the field values still combine & hash the same way and then you'll know the user hasn't messed

[web2py] Re: tooltips with custom forms

2010-09-18 Thread Brian M
{{=form.custom.comment.field_name}} will have the comment that you defined in the table definition. Perhaps check out qTip (http://craigsworks.com/projects/qtip/) for a way to create & trigger the tooltips. In your view you can do: {{=form.custom.label.field_name}}: {{=form.custom.widget.field_

[web2py] Re: MS SQL driver in Windows binary.

2010-08-26 Thread Brian M
+1 Having pyodbc included in the windows version would be great! ~Brian On Aug 26, 2:16 am, Seeker wrote: > That would be great. > > From the pyodbc page onhttp://code.google.com/p/pyodbc/: > "pyodbc is licensed using an MIT license, so it is free for commercial > and personal use. You can even u

[web2py] UUID as Primary Key?

2010-04-30 Thread Brian M
Is there anyway to use the DAL with a database that used UUIDs as the primary key in a few tables? The setup below just gives errors because registered_user.UserId (the id field) isn't an integer as expected (ValueError: invalid literal for int() with base 10: '6BBC2607-1B6A-4C8A-BBD4-8566754CFA20

[web2py] Re: what do you make of this?

2010-04-18 Thread Brian M
I ran the PDF file referred to through Microsoft Security Essentials and it was fine. Also checked online at http://www.kaspersky.com/scanforvirus and http://www.virustotal.com and it came out clean. On Apr 18, 7:07 pm, mdipierro wrote: > http://twitter.com/idlecool/status/12408675362 > > -- > Su

[web2py] Re: Feature request: xlstoweb2py [was: Where do you use web2py?]

2010-03-16 Thread Brian M
I've used this wrapper (http://code.activestate.com/recipes/483742- easy-cross-platform-excel-parsing-with-xlrd/) for xlrd (http:// www.lexicon.net/sjmachin/xlrd.htm) with good results. As long as the worksheet has column headers as the first row you're good to go - it will read in the data and pu

[web2py] Re: Is the web2py site down?

2010-02-27 Thread Brian M
Yep, down - noticed it was down last night too, so it's been like 12hrs! http://downforeveryoneorjustme.com/web2py.com On Feb 27, 9:37 am, Neno wrote: > Same here, still down. > > On Feb 27, 7:24 am, ionel anton wrote: > > > > > It doesn't work for me :( > > > On Feb 27, 6:15 am, DenesL wrote

[web2py] Re: creating Microsot Excel type charts

2010-02-22 Thread Brian M
Yahoo's YUI javascript library includes a charts component that I've had luck with. They're flashed based in the end though. As Thadeus said Google also has a charts api - theirs ends up rendering as images which is nice if your users will want to do something like copy the chart and paste it into

[web2py] Re: Not sure how stunnel works with web2py

2010-02-21 Thread Brian M
http://groups.google.com/group/web2py/browse_thread/thread/6c7f2360d1509bee/889a62630225dbad#889a62630225dbad On Feb 20, 6:27 am, Al wrote: > I managed to get stunnel working, though it is a lot more complicated > than I thought > originally. On the windows server, the stunnel.conf file is setup

[web2py] Re: How to deploy my first app

2010-02-21 Thread Brian M
xecutable " is due to trying to use the "stunnel" command (which is likely really stunnel3) instead of "stunnel4" at the command line. I found that I got the same error on linux. ~Brian On Feb 20, 11:31 pm, Brian M wrote: > Al, > > Yes, stunnel needs both a clien

[web2py] Re: How to deploy my first app

2010-02-20 Thread Brian M
ering the admin password, I cannot find any response.menu_auth to > remove. > > I also have another mac which I tried to set up stunnel, but when I > run sudo stunnel3 I got the following error: > anyone familiar with mac can give some tips on how to solve this: > > inetd mo

[web2py] Re: Ladies and Gentelmen... the web2py book is online

2010-02-11 Thread Brian M
ot;expand/collapse" or "show/hide" would make the purpose clearer? The effect isn't quite working right though, toggle only sometimes hides the responses, more often it seems to trigger a funky yo-yo effect (at least in the Chrome browser) If I've spotted typos in the boo

[web2py] Re: Form Dropdown - have value different from displayed text

2010-02-11 Thread Brian M
You could also try this method: http://wiki.web2py.com/Form_Select_Options_from_DB On Feb 11, 2:17 pm, villas wrote: > > Can I use sqlform without a database to populate the data? > > See SQLFORM.factory > Web2py book/manual  section 7.3  Pg. 201 -- You received this message because you are su

[web2py] Re: How to deploy my first app

2010-02-11 Thread Brian M
Al, You'd want to get rid of the "edit" " menu when you "Go Live" that's just there as a convenience while you're creating things. Just use this (or remove response.menu_edit from menu.py which does it once & for all): response.menu_edit = None If you don't want auth menu either do respon

[web2py] Re: powered by drupal?

2010-02-08 Thread Brian M
Insisting on having to use web2py for the documentation is silly. Sorry, but there are a bunch of wikis out there that are better/more complete than the one in web2py. Yeah we can try to built the perfect wiki in web2py but waiting to do the community documentation until that happens is a waste. W

[web2py] Re: Reading JSON file every minute

2010-02-01 Thread Brian M
Use simplejson to decode the JSON file into the appropriate array, dictionary whatever. It's included in contrib. On Feb 1, 3:22 am, Al wrote: > Hi, > > I am using web2py to build an application to read a few  .JSON files > which are updated periodically (every 300s), the information within > th

[web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread Brian M
ime','time',notnull=True, default=datetime.now().time ()), Field('what','string',notnull=True)) crontab contains (partial contents) #crontab @reboot root*default/on_reboot 0-59/5 * * * * root *default/on_five >

[web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread Brian M
ld be run split into its own function for a bit better clarity. I will send you a diff after I've had a chance to test everything on linux. Right now Windows seems to be working pretty well. ~Brian M On Jan 31, 12:11 pm, mdipierro wrote: > I think I addresses two of the issues. Please take

[web2py] Re: has anybody check the the cron in trunk?

2010-01-31 Thread Brian M
fix to trunk. Please make sure I did not > mess it up. > I very much appreciate your help. > > On Jan 30, 8:46 pm, Brian M wrote: > > > > > Massimo, > > > The problem is in def parsecronline() there needs to be an extra elif > > clause to deal with that -1

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Brian M
ploading the fix to trunk. Please make sure I did not > mess it up. > I very much appreciate your help. > > On Jan 30, 8:46 pm, Brian M wrote: > > > > > Massimo, > > > The problem is in def parsecronline() there needs to be an extra elif > > clause to deal

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Brian M
crondance: > >             elif not startup and task.get('min',[])==[-1]: >                 continue > > @reboot startup is supposed to be true the first time only and task.get > ('min',[]) is supposed to be ==[-1]. > > Is this not the case? Can you add a

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Brian M
es > (the main issue). > > On Jan 30, 5:39 pm, Brian M wrote: > > > > > Well on my Win7 setup with source distribution of web2py I can confirm > > that @reboot cron lines do not run when I start up web2py. The same > > cron line with a normal time decla

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Brian M
h the correct form is towards the top of the same page). If you use that syntax, you get an error message at the console: invalid application name: testing/***default/ on_reboot. ~Brian On Jan 30, 5:39 pm, Brian M wrote: > Well on my Win7 setup with source distribution of web2

[web2py] Re: has anybody check the the cron in trunk?

2010-01-30 Thread Brian M
Well on my Win7 setup with source distribution of web2py I can confirm that @reboot cron lines do not run when I start up web2py. The same cron line with a normal time declaration does run just fine. #...@reboot does not run @reboot * * * * root *reboot/on_reboot #But with

[web2py] Re: EOFError?

2010-01-22 Thread Brian M
e .table or everything in databases? > Does you app run if you set migrate=False for all tables? > > Massimo > > On Jan 22, 4:11 pm, Brian M wrote: > > > > > Hmm, I've been running into this problem a bunch today. WinXP with > > source web2py 1.74.5 and SQ

[web2py] Re: EOFError?

2010-01-22 Thread Brian M
Hmm, I've been running into this problem a bunch today. WinXP with source web2py 1.74.5 and SQLite. My .table files keep getting truncated to 0 bytes for some reason and then web2py chokes. ~Brian On Jan 22, 2:13 pm, Thadeus Burgess wrote: > looks like a corrupted .table file > -Thadeus > > > >

[web2py] Re: Importing a file and can't get some characters...

2010-01-13 Thread Brian M
ple shows different(multiple) > charactors for ÖÄÅ in the view. > I am using sqlight3. > Best Regards, > Jason > > > > On Tue, 2010-01-12 at 06:57 -0800, Brian M wrote: > > Which database are you using? What's the error message you're > > receiving? > > > O

[web2py] Re: Importing a file and can't get some characters...

2010-01-12 Thread Brian M
Try adding .encode("utf-8") to whatever variable(s) seem to have the unicode characters in them, as in funky_variable.encode("utf-8") ~Brian On Jan 12, 5:06 am, Jason Brower wrote: > In importing my file I seem to not be able to import ÄäÖöÅå properly. > The file I am pulling from is UTF-8 accor

[web2py] Re: Importing a file and can't get some characters...

2010-01-12 Thread Brian M
Which database are you using? What's the error message you're receiving? On Jan 12, 5:06 am, Jason Brower wrote: > In importing my file I seem to not be able to import ÄäÖöÅå properly. > The file I am pulling from is UTF-8 according to my text editor.  Could > I be doing something wrong with the

[web2py] Re: Importing a large file

2010-01-12 Thread Brian M
anything from the file. (at least for > now.) > Thank you for your patients and help.  I have learned a lot! > Best Regards, > Jason > > > > On Mon, 2010-01-11 at 07:23 -0800, Brian M wrote: > > Jason, put your csv file in the private subfolder of your application &

[web2py] Re: Importing a large file

2010-01-11 Thread Brian M
,R,Co2,30,la1,4,To1,5 > 1008-Y24R,A,DD2,88,la1,17,Fo1,60 > "147 BARWSSFD",E,do1,74,fa1,38,Ha1,44 > "148 DUNKNMFRUN",D,Do1,56,Fa1,42,Go1,110,ti1,8,, > Thank you for your help in this regard, it's a complicated process > relative to what I am used to

[web2py] Re: Importing a large file

2010-01-09 Thread Brian M
gards, > Jason > > > > On Fri, 2010-01-08 at 20:43 -0800, Brian M wrote: > > Jason, > > What's the syntax error? > > Try this, it's untested but should be verbose enough to get you there. > > If you have trouble perhaps provide a sample file (fe

[web2py] Re: Importing a large file

2010-01-08 Thread Brian M
re. :/ > BR, > Jason > > > > On Fri, 2010-01-08 at 09:17 -0800, Brian M wrote: > > I have been working on using web2py to import csv files and find that > > in general it works very well. You will need to be careful with > > pulling in the colorant and amount field

[web2py] Re: Importing a large file

2010-01-08 Thread Brian M
I have been working on using web2py to import csv files and find that in general it works very well. You will need to be careful with pulling in the colorant and amount fields - if you use the csv.DictReader() to refer to columns in the CSV file by name instead of index you'll find that you only ge

[web2py:38170] Re: SQLFORM.factory how to make a select field without database?

2010-01-01 Thread Brian M
sday","Thursday","Friday","Saturday","Sunday") > form = SQLFORM.factory(Field('dow',requires=IS_IN_SET(range > (1,8),weekdays,multiple=True))) > > On Jan 1, 12:32 am, Brian M wrote: > > > > > How would I go about c

[web2py:38151] SQLFORM.factory how to make a select field without database?

2009-12-31 Thread Brian M
How would I go about creating a select field with SQLFORM.factory that gives output like this? Monday Tuesday Wednesday Thursday Friday Saturday Sunday I know that I can do it with regular FORM like this: weekdays = [[1,"Monday"],[2, "Tuesday"],[3,"Wednesday"],[4,"Thursday"], [5,"Friday"],[6,"

[web2py:37953] Re: How to locale web2py date calendar widget

2009-12-28 Thread Brian M
If I am wrong, where find the docs about the calendar.js? > > > 2009/12/24 mdipierro > > > > the IS_DATE and IS_DATETIME accept a format argument. You should set > > > it explicitly > > > > db.table.field.requires=IS_DATE(format=T('%Y-%M-%D')) &g

[web2py:37788] Re: How to locale web2py date calendar widget

2009-12-23 Thread Brian M
hat web2py uses does. Maybe you could create a widget that would use the jQuery UI calendar instead? ~Brian On Dec 23, 6:54 pm, Mengu wrote: > And note that -mm-dd format is the way how mysql and sqlite keep > dates. > > On Dec 23, 4:39 pm, Brian M wrote: > > > > &g

[web2py:37740] Re: How to locale web2py date calendar widget

2009-12-23 Thread Brian M
I think that the format is controlled in the web2py_ajax.html view. try {jQuery("input.date").focus( function() {Calendar.setup({ inputField:this.id, ifFormat:"{{=T('%Y-%m-%d')}}", showsTime:false }); }); } catch(e) {}; try { jQuery("input.datetime").focus( function() {Calendar.setup({

[web2py:37717] Re: mercurial HELP!

2009-12-22 Thread Brian M
Hmm, just tried with a little google code project I've got and it worked fine. In my mercurial.ini file (same as .hgrc) I simply put: [auth] project.prefix = project.googlecode.com/hg project.username = myusername project.password = myprojectpassword project.schemes = https That was with my goog

[web2py:37495] Re: Custom Row Objects

2009-12-17 Thread Brian M
Are you looking for a Row object when you aren't using the DAL but are instead using your own SQL? It isn't quite a Row object, but if you are trying to use db.executesql() there is a new third option (as_dict) that if True will at least return the resultset as a list of dictionaries keyed off of t

[web2py:37142] Re: HELP with new DAL

2009-12-13 Thread Brian M
n On Dec 13, 5:52 pm, mdipierro wrote: > It would help if somebody could check the regular expressions in the > new DAL (in *Adapter.__init__) vs those in the old DAL (in > SQLDB.__init__) to check I did not do mistakes in cut and paste. > > Massimo > > On Dec 13, 5:13 pm, Br

[web2py:37138] Re: HELP with new DAL

2009-12-13 Thread Brian M
Tested with PostgreSQL 8.4 and Massimo's CRM app - seems to be working OK. (I did get a KeyError: '_db_codec' error for a while, but it went away with a later revision.) On Dec 13, 2:24 pm, DenesL wrote: > The first time I accessed appadmin/select/db3?query=db3.test.id>0 > it worked fine but aft

[web2py:37137] Re: can't upload w2p from/to changeset 10

2009-12-13 Thread Brian M
Seems to be working now - Thanks Massimo On Dec 13, 2:07 pm, mdipierro wrote: > Thank you Brian, for letting me know. I think I fixed it now. Can you > give it a try? > > Massimo > > On Dec 13, 1:26 pm, Brian M wrote: > > > Odd, now with rev 25 I'm getting

[web2py:37128] Re: can't upload w2p from/to changeset 10

2009-12-13 Thread Brian M
Odd, now with rev 25 I'm getting an error message when trying to upload an app. Traceback (most recent call last): File "C:\...\web2py\gluon\main.py", line 436, in wsgibase parse_get_post_vars(request, environ) File "C:\...\web2py\gluon\main.py", line 308, in parse_get_post_vars if len

[web2py:37086] Re: attention ! attention !

2009-12-12 Thread Brian M
Massimo, Testing of the Windows binary version fails: Creating an app with "Create new application" works fine. HOWEVER, trying to "Upload existing application" fails with the following error ticket: Traceback (most recent call last): File "gluon/main.py", line 436, in wsgibase File "gluon/m

[web2py:37074] Re: can't upload w2p from/to changeset 10

2009-12-11 Thread Brian M
Strange, I just tried with hg changeset 11 and it worked. My Steps: 1) "Pack all" an application from site admin screen. 2) Use "Upload existing application" to upload the w2p file you just downloaded. 3) New application successfully created. This is with python 2.6 and just the plain web2py buil

[web2py:37071] Re: mercurial help

2009-12-11 Thread Brian M
OK, while how to move forward is being worked out, I thought I'd provide a clear answer for anyone using the mercurial repo who can't get create app to work. Problem: You have cloned the mercurial repository and cannot create a new app from site admin. Error message: Unable to create application "

[web2py:37068] Re: Cron and Windows service

2009-12-11 Thread Brian M
;hard' >        cron= contrib.cron.hardcron() >        cron.start() > > is this code executed when you run with -W? What are the values ofcronand > options.nocron? > > On Dec 9, 3:43 pm, Brian M wrote: > > > Massimo - I'm willing to help do some testi

[web2py:37007] Re: sqlite legacy support

2009-12-10 Thread Brian M
t.staid could be the primary key as far as the database is concerned. The issue is that web2py expects the primary key field to be called ID. I'd give Massimo's suggestion of db.define_table(...Field ('staid','id'),...) a shot - he's the man, so he ought to know. Massimo - what exactly does Field

[web2py:36956] Re: Creating a CSV file from data

2009-12-10 Thread Brian M
What datatype are you using for the data currently? The python CSV module can get its data from any sequence, so if you already have all the info in a list use csv.writer if it's a in a list of dictionary objects, then use csv.DictWriter. Refer to http://docs.python.org/library/csv.html With more

[web2py:36930] Re: sqlite legacy support

2009-12-09 Thread Brian M
You can tell your model the path to the existing sqlite database file with something like db_path = os.path.join('path','to','your','existing.db") #path to wherever you existing DB is db = DAL('sqlite://'+db_path) As for telling it which existing field to use as the ID, as DenesL pointed out if t

[web2py:36920] Re: Cron and Windows service

2009-12-09 Thread Brian M
> I am in the same boat as you, Brian. I just started a project hoping this is > > possible. > > > I would try and submit a patch for this but I have *no* time at all as I am > > swamped with work :(. > > > On Wed, Dec 9, 2009 at 3:18 AM, Brian M wrote: > > >

[web2py:36845] Re: Cron and Windows service

2009-12-08 Thread Brian M
ven't tried > it with web2py, but it's probably worth a look > > 2009/12/9 Brian M > > > It certainly would be nice to have cron working under the windows > > service. I could use Windows scheduled tasks and curl, but was > > thinking that it would be nic

[web2py:36835] Re: Cron and Windows service

2009-12-08 Thread Brian M
rvice. ~Brian On Dec 8, 8:32 pm, mdipierro wrote: > How important is this to you? It should not be too difficult to add > it. It is just that I think cron and regular web2py should be > considered two different services. > > On Dec 8, 7:18 pm, Brian M wrote: > > > Cron doesn&#

[web2py:36823] Re: Cron and Windows service

2009-12-08 Thread Brian M
Cron doesn't work when running windows as a service?! :( Well that just screwed up my plans - I'm working on a reporting app that will rely fairly heavily on regularly pulling in external data and figured the built-in cron would handle that. Is it all forms of cron that don't work with web2py runn

[web2py:36738] Re: pending patches

2009-12-07 Thread Brian M
Actually my patch does not allow the use of sqlite3.Row - it provides a work around to the fact that using sqlite3.Row apparently broke .as_list() Basically it adds an alternate "legacyDB" argument to db.executesql() that, when True, causes the resultset list of lists to be converted over to a lis

[web2py:35309] Re: Database Views and DAL?

2009-11-13 Thread Brian M
a view and not have it worry about an id and also have the DAL know that it should only let you select from the view and not try to insert stuff. That'd require changes to the DAL though, so I guess db.executesql() is probably the best answer for now. ~Brian On Nov 13, 4:36 pm, Brian M wr

<    1   2   3   4   >