[web2py] Re: Can I specify an existing named field as the autonumber ID in a legacy database?

2010-07-14 Thread mwolfe02
Got it working. Thanks for the help. On Jul 12, 6:28 pm, mdipierro wrote: > No need. You should be able to just do > > db.define_table('property',Field('PropertyID','id'),) > > i.e. add an extra field of type 'id' with the proper name. Let us know > if this works. > > Massimo > > On 12 Lug,

[web2py] Re: LEFT JOIN query as object?

2010-07-22 Thread mwolfe02
It turns out the error I got it was for a different syntactical mistake I'd made. The relevant error is slightly different: TypeError: 'Rows' object is not callable I assume this is because the .select() method returns a 'Rows' object? On Jul 22, 4:09 pm, Michael Wolfe wrote: > I'm still learn

[web2py] Re: LEFT JOIN query as object?

2010-07-22 Thread mwolfe02
db.dog.id) > where = db(db.friend.name == "fred") > ... continue and do some stuff with the "where" query object > results = where.select(db.friend.ALL, left = lefton) > > -- > Thadeus > > On Thu, Jul 22, 2010 at 4:10 PM, mwolfe02 > wrote: >

[web2py] Re: LEFT JOIN a table to a SUM query

2010-07-23 Thread mwolfe02
The example under Grouping and Counting returns: Alex 2 Bob 1 In other words, it performs an INNER JOIN not an OUTER JOIN. This is a critical difference. In this simple example we don't get a row of information for 'Carl' because he owns no dogs. It may not be a big deal for such a simple, co

[web2py] Re: LEFT JOIN a table to a SUM query

2010-07-23 Thread mwolfe02
.freeze" wrote: > Does this work? > count = db.dog.id.count() > rows=db().select(db.person.name, count, groupby=db.person.id, > left=db.dog.on(db.person.id==db.dog.owner)) > > On Jul 23, 2:08 pm, mwolfe02 wrote: > > > > > The example under Grouping and Cou

[web2py] Any movement on implementing inline-tables functionality?

2010-07-26 Thread mwolfe02
I need to be able to perform multiple LEFT JOINs on sub-SUM queries. For example: SELECT C.Name, O.TotalOrderAmt, R.TotalRefundAmt FROM Customers AS C LEFT JOIN (SELECT CustomerID, Sum(Amount) AS TotalOrderAmt FROM Orders GROUP BY CustomerID) O ON C.id = O.CustomerID LEFT JOIN (SELECT CustomerID,

[web2py] Re: book 3rd edition call of help

2010-07-27 Thread mwolfe02
I'd vote for CHAPTERS as well, with the previously mentioned caveat that searches would need to be able to jump to the relevant section(s) within a chapter. Also, I think a fixed (ie, non-scrolling and always on-screen) sidebar with the current chapter's section table of contents allowing easy nav

[web2py] Re: book 3rd edition call of help

2010-07-28 Thread mwolfe02
Very nice! I especially like the yellow highlighting of the search terms. Maybe this is nitpicking or you just haven't gotten that far yet, but I think the index should be in case-insensitive alphabetical order. Also, I don't know if you're taking feedback on specific content yet, but I think th

[web2py] DAL does not raise SyntaxError on malformed connection string

2010-07-28 Thread mwolfe02
There's a generic except: in dal.py/sql.py that prevents SyntaxErrors from being reported. For example, db = DAL('mssql://user:p...@127.0.0.1/') results in: RuntimeError: Failure to connect to DB. Tried 5 times instead of: SyntaxError: Invalid URI string in SQLDB: mssql://user:p...@127.0.0.1/

[web2py] Configure Apache to forward http://1.2.3.4/admin/ to https://1.2.3.4/admin/

2010-07-29 Thread mwolfe02
When I follow a ticket link it goes to http: instead of https:. Can I configure Apache to recognize http://1.2.3.4/admin/ and automatically redirect to https://1.2.3.4? This is more an annoyance than anything, but it has gotten really annoying. I'm testing my new app in its future production env

[web2py] Re: Configure Apache to forward http://1.2.3.4/admin/ to https://1.2.3.4/admin/

2010-07-29 Thread mwolfe02
glaringly obvious now... On Jul 29, 5:20 pm, mwolfe02 wrote: > When I follow a ticket link it goes to http: instead of https:.  Can I > configure Apache to recognizehttp://1.2.3.4/admin/and automatically > redirect tohttps://1.2.3.4? > > This is more an annoyance than anything, but it ha

[web2py] FreeTDS returns MS SQL money type as Python float, not Decimal

2010-07-30 Thread mwolfe02
For background, refer to related questions on SO: http://stackoverflow.com/questions/3364699/ http://stackoverflow.com/questions/3371795/ I'm developing my app on Windows, but will be deploying it on a Linux server. The following lines are from the top of my db.py: if os.name=='posix': #Ubuntu

[web2py] Re: FreeTDS returns MS SQL money type as Python float, not Decimal

2010-07-30 Thread mwolfe02
x.com/products/python/mxODBC/ > > 2010/7/30 mwolfe02 > > > > > For background, refer to related questions on SO: > >http://stackoverflow.com/questions/3364699/ > >http://stackoverflow.com/questions/3371795/ > > > I'm developing my app on Windows, but will be d

[web2py] Re: FreeTDS returns MS SQL money type as Python float, not Decimal

2010-07-30 Thread mwolfe02
alue)) > ... > > so technically even if the database where to return float (wrong), > web2py should still return decimal. Is this the case for you? > > On Jul 30, 8:35 am, mwolfe02 wrote: > > > > > For background, refer to related questions on > > SO:http://stackov

[web2py] Re: FreeTDS returns MS SQL money type as Python float, not Decimal

2010-07-30 Thread mwolfe02
.8.30/TaxDB', migrate=False) On Jul 30, 10:43 am, mwolfe02 wrote: > I'm using .executesql.  I added a line to sql.py for debugging > purposes.  It returns the second column of the first row of results (a > SUM of a SQL Server money column): > > diff --git a/gluo

[web2py] Re: FreeTDS returns MS SQL money type as Python float, not Decimal

2010-07-30 Thread mwolfe02
where I can leverage the DAL, I think web2py will handle things just > fine. > > I'm going to post a message to the FreeTDS message board and see what > I can learn. > > On Fri, Jul 30, 2010 at 11:08 AM, Michele Comitini > > > > wrote: > > > 2010/7/30

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

2010-08-03 Thread mwolfe02
I'm having the same issue logging in. Any resolution/workaround? Thanks, Mike On Jul 31, 5:49 am, LordMax wrote: > HI > > I'll see some imagesnotrendered. > > for example onhttp://web2py.com/book/default/chapter/01#Model-View-Controller > > On source page they are linked like: > /book2/static/b

[web2py] Best practice for removing link to active page from menu?

2010-08-03 Thread mwolfe02
I wrote this simple website using Django (http:// www.heberlings.com/). As part of the navigation, I wanted to turn off the link for the currently active page. If you visit the site and click on a couple of the menu items on the left side of the page, you will see what I mean. To implement this

[web2py] Re: FreeTDS returns MS SQL money type as Python float, not Decimal

2010-08-05 Thread mwolfe02
re command as root). I fought with that for a long time before realizing I could pass that setting in the web2py connection string: db = DAL('mssql://user:p...@dbserver.domain.com/DBName? DRIVER=FreeTDS;TDS_Version=8.0') Hopefully this information will be useful to someone. On Jul 3

[web2py] Re: Best practice for removing link to active page from menu?

2010-08-06 Thread mwolfe02
.function=='info',URL(r=request,f=info'), > []), > ] > > The latter code can go in menu.py but you can place it in any mode. > MENU(...) takes arguments that allows you to customize the class of > the amd . It also handles submenu (the [] above are > subm

[web2py] Why is routes.py not recommended for production?

2010-08-08 Thread mwolfe02
According to the web2py book, routes.py should not be used in production environment (http://web2py.com/book/default/chapter/04? search=lighttpd). Instead, Apache/lighttpd web server rewrite is suggested. I assumed this was due to some overhead that using routes.py would incur. However, massimo's

[web2py] Re: Why is routes.py not recommended for production?

2010-08-09 Thread mwolfe02
athan Lundell wrote: > > > > > On Aug 8, 2010, at 2:35 PM, mwolfe02 wrote: > > > > According to the web2py book, routes.py should not be used in > > > production environment (http://web2py.com/book/default/chapter/04? > > > search=lighttpd). Instead,

[web2py] Managing routes.py with mercurial checkout

2010-08-09 Thread mwolfe02
I'm just looking for a best practice here. I am running web2py using a clone of the repository https://web2py.googlecode.com/hg/. This has worked really well for me. However, I just added a routes.py file. Clearly, I want to version control this file, but that requires committing the change to m

[web2py] Error trying to run db queries from on-line shell

2010-08-13 Thread mwolfe02
I'm trying to run a very simple select query from the built-in web- based shell, but I keep getting the following error: The cursor's connection has been closed. Here is the full traceback: Traceback (most recent call last): File "", line 1, in File "...\web2py\gluon\sql.py", line 3214, in

web2py@googlegroups.com

2010-08-16 Thread mwolfe02
I'm trying to use routes_onerror, but requested_uri keeps coming through as None (subject of this e-mail is the query string from the redirect). I searched through the source code and could not find where this is supposed to be set. I stepped through using WinPDB and there is simply no entry in r

web2py@googlegroups.com

2010-08-16 Thread mwolfe02
any control over. I hope I can save someone else some trouble in the future. -Mike On Aug 16, 12:52 pm, mwolfe02 wrote: > I'm trying to use routes_onerror, but requested_uri keeps coming > through as None (subject of this e-mail is the query string from the > redirect).  I searched

[web2py] Re: per app routes

2010-08-31 Thread mwolfe02
I'm still debugging now, but there seems to be an issue using the special $anything token inside app-specific routes_in. It appears that the incoming URL is being applied to each app-specific routes_in one at a time before it is applied against routes_app. I'll try to include more details later,

[web2py] Re: per app routes

2010-08-31 Thread mwolfe02
31, 12:31 pm, mwolfe02 wrote: > I'm still debugging now, but there seems to be an issue using the > special $anything token insideapp-specificroutes_in.  It appears > that the incoming URL is being applied to eachapp-specificroutes_in > one at a time before it is applied against rou

[web2py] Re: per app routes

2010-08-31 Thread mwolfe02
gt; On Aug 31, 2010, at 10:01 AM, mwolfe02 wrote: > > >> More clues...  When web2py loads, rewrite.params.routes_in gets set as > >> follows: > > >> - items from base routes_in are appended first > >> - then items fromapp-specificroutes_in are appended

[web2py] Re: per app routes

2010-08-31 Thread mwolfe02
com/ I receive the 'invalid function' page instead of rewriting to http://domain.com/my_app/default/search/. I'm debugging now and will post back when I learn more. -Mike On Aug 31, 2:04 pm, mwolfe02 wrote: > This fixed the problems I was having.  I'll let you know if I run

[web2py] Re: per app routes

2010-09-02 Thread mwolfe02
ll be heading home for the day soon and won't be > > working on this project again until Thursday.  So if you don't get a > > response from me for awhilethat's why. > > OK. I'll take a closer look. It's helpful to know that it's getting 'index'

[web2py] Re: Redirect after login

2010-09-17 Thread mwolfe02
I'm not sure if this is the officially correct way to do this, but I implemented this functionality by making a change to layout.html: I replaced these lines: - {{=A(T('login'),_href=URL(r=request,c='default',f='user/login'))}} | - {{=A(T('register'),_href=URL(r=request,c='default',f='

[web2py] Re: StackExchange for web2py community

2010-09-17 Thread mwolfe02
My vote: - ask questions on StackOverflow using the existing web2py tag - follow the questions using this RSS feed: http://stackoverflow.com/feeds/tag/web2py I like StackOverflow a lot and I think it is a much better interface than Google Groups. I asked my first few questions about web2py on S

[web2py] ?requested_uri=None in routes_onerror redirected page

2010-09-21 Thread mwolfe02
I'm troubleshooting my routes_onerror by starting with a simple case, redirecting everything to a status page for debugging: routes_onerror = [(r'*/*', r'/status/'),] When I type the following url into the browser: http://127.0.0.1:8000/faq I get redirected to this url: http://127.0.0.1:8000/s

[web2py] Bug?: db.mytable(1) shortcut does not work for table with ID field not named 'id'

2010-09-21 Thread mwolfe02
I'm using a legacy tables and trying to use the shortcut method of returning a row/record by passing the value of the ID field directly to the table. It appears that 'id' is still hardcoded into the logic at some level, though. This works: db.mytable(db.mytable.my_id==1) But this does not: db

[web2py] Re: Bug?: db.mytable(1) shortcut does not work for table with ID field not named 'id'

2010-09-21 Thread mwolfe02
th this table definition: db.define_table('mytable', Field('my_id', 'id') ) This line: hasattr(db.mytable, '_primarykey') # returns False It seems like the above line should return True and db.mytable._primarykey should equal 'my_id'. Which makes m

[web2py] Re: Bug?: db.mytable(1) shortcut does not work for table with ID field not named 'id'

2010-09-21 Thread mwolfe02
marykey) or [self._db[t]['id'].name] or ['id'])]) sql_s += ' TOP %i' % lmax elif self._db._dbname == 'firebird': if not attributes.get('orderby', None) and w2p_tablenames: On Sep 21, 5:10 pm, mwolfe02 wrote: > w

[web2py] Re: Bug?: db.mytable(1) shortcut does not work for table with ID field not named 'id'

2010-09-22 Thread mwolfe02
;orderby', None) and w2p_tablenames: On Sep 22, 10:16 am, mdipierro wrote: > actually I just fixed it in trunk for a few APIs which will cover the > case you described. > There are still a few cases where a custom ID name breaks something. > > Massimo > > On Sep

[web2py] add db.commit() requirement for shell to documentation

2010-09-23 Thread mwolfe02
I just spent several hours troubleshooting why my application seemed to be randomly hanging when I was running both the Rocket Server and the shell. It came down to the fact that I was performing db io (Create/Update/Delete) in the shell and not explicitly committing it. I was misled by this line

[web2py] Re: welcome app normalize hack ie and html5 ready

2010-09-28 Thread mwolfe02
I think one of the keys to getting a csszengarden-type database of base.css files is to have an html page dedicated to showcasing all of the different styles. Would it be worth having a separate css_sampler.html file that accomplishes this so that the main page does not have to get too cluttered..

[web2py] Re: Request for a logo - PluginCentral

2010-10-26 Thread mwolfe02
I really like the idea of a bold, simple image to represent the framework. I'm just not convinced a ship is the right image. Maybe it would be more helpful to the few good logo designers on this list (of which Branko is certainly one), for us to propose different images. I'll list what I feel (p

[web2py] Re: Request for a logo - PluginCentral

2010-10-26 Thread mwolfe02
(e.g., like the old logo). > > Anthony > > On Oct 26, 11:27 am, mwolfe02 wrote: > > > > > > > > > I really like the idea of a bold, simple image to represent the > > framework.  I'm just not convinced a ship is the right image. > > > Maybe it wo

[web2py] web2py equivalent of Django's pluralize?

2010-10-27 Thread mwolfe02
How do you do this in web2py: http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#pluralize Thanks, Mike

[web2py] Error running routes.py doctest after update to changeset 1054

2010-10-27 Thread mwolfe02
When I run the doctest for my routes file (python routes.py) after updating to changeset 1054 or later, I receive the following error message: Traceback (most recent call last): File "routes.py", line 103, in from gluon.rewrite import select, load, filter_url, filter_out, filter_err, compil

[web2py] Syntax to INNER JOIN table to itself

2010-12-21 Thread mwolfe02
I have a legacy table with a three-character primary key and a three- character self-referencing field. I'm trying to implement the following sql using the DAL: SELECT District.Description, SchoolDistrict.Description FROM District.DistrictID INNER JOIN District AS SchoolDistrict ON District.Schoo

[web2py] Invalid syntax when compiling HTML helper code

2012-09-20 Thread mwolfe02
I'm receiving an invalid syntax error when running from Windows. I do not receive the error when running the same code from my Webfaction account on CentOS. The error appears to be related to compiling of the code. I assume the compile code is taking issue with the HTML helper functions whi

[web2py] Syntax Error when compiling html helpers with attributes

2012-09-20 Thread mwolfe02
I receive the following traceback when trying to run some pretty straightforward code: Traceback (most recent call last): File "M:\My Documents\EstateCommander\web2py\gluon\restricted.py", line 208, in restricted ccode = compile2(code,layer) File "M:\My Documents\EstateCommander\web2py\g

Re: [web2py] Invalid Syntax Error with HTML Helper attributes

2012-09-23 Thread mwolfe02
Right on both counts, Bruno. Thanks. I thought I was running the same Python version in both environments, but I was not. I am running Python 2.7.3 in my linux environment (which works without error) and Python 2.5.5 on Windows (where I was receiving the error). Your workaround was effective

[web2py] Re: drop support for python 2.4?

2011-02-08 Thread mwolfe02
Are there any shared hosts with Python 2.4 support where it is NOT possible to upgrade to Python 2.5 or later? If not, then I support Jonathan Lundell's suggestion of providing a simple recipe to move to a later Python. On second thought, how universal would such a 'recipe' be? Will it vary grea

[web2py] Re: Proposals for New Tagline

2011-03-15 Thread mwolfe02
+1 Productivity by design On Mar 15, 2:13 pm, danto wrote: > 2011/3/15 mart > > > > > > > > > > > Just throwing in my 2 cents worth, > > > Personally, I kind of like the that it says Enterprise, but as > > mentioned here, depends on who's reading it. This is my first try in > > world if open sou

[web2py] Re: Proposals for New Tagline

2011-03-17 Thread mwolfe02
> IMNSHO, "Productivity by Design" sucks. > > It is vague, wishy-washy, and banal.  It could be said of every web > development tool from Apache to Zope.  It fails to capture any of > web2py's essential advantages. I disagree. I think it speaks to the very thing that sets web2py apart from every

[web2py] Re: default function of a controller

2011-06-14 Thread mwolfe02
Someone please correct me if I'm wrong, but I believe the Pattern- Based System supports URL re-writing different domains to different applications. On Jun 14, 1:56 pm, Francisco Costa wrote: > > If you use the parameter-based URL rewrite system > > (seehttp://web2py.com/book/default/chapter/04#

[web2py] Can website visitors update my languages files?

2016-01-14 Thread mwolfe02
I've got a live web2py application under Mercurial version control. When I did my latest commit, I noticed there were several changes to the following two files (the Polish and Russian translation files): /languages/pl.py /languages/ru-ru.py I did not make these changes. The changes look like