Re: [web2py] Re: postgres connect problem

2012-07-11 Thread Cliff Kachinske
+1 for psycopg2. Works fine for me. I missed that you weren't using it. On Wednesday, July 11, 2012 4:40:56 PM UTC-4, lucas wrote: > > hey wade, > > yes, i have been banging my head on this one because i have had success > with web2py and postgresql for quite a while. my admin interface says

[web2py] Re: Any jquery gurus out there?

2012-07-11 Thread Cliff Kachinske
Not a jquery guru... What would happen if you changed the anchor tags to spans? If it works it will also allow you to remove the "event.preventDefault()" call. Also I would change this line of code: $("a.reveal").click(function (event) { to this: $(".reveal").live('click', fun

[web2py] Re: A database design dillema

2012-07-12 Thread Cliff Kachinske
This should work. No guarantees that it will be fast. Also, limit_by would be problematic. Maybe you could cache the row set and just update the cache when there is a change. Otherwise there is a discussion here about processing the results of executesql. with_alias() and as_list() are wel

[web2py] trunk 2012-06-17 smartgrid ignoring linked table - can't figure out why

2012-07-13 Thread Cliff Kachinske
7;People' response.subtitle = '' # Here is the payoff return dict( form=SQLFORM.smartgrid( usr, linked_tables = ['user_preference', 'auth_membership',], csv=False, divider=XML('→'), fields=fields, constraints=constraints, ) ) Thanks, Cliff Kachinske

[web2py] Re: How to build a modular menu

2012-07-16 Thread Cliff Kachinske
submenu = [] response.menu = [ (T('Home'), False, URL('default', 'index'), submenu), ] if needsubmenu: sub_submenu = [] submenu.append([ (T('A submenu item'), False, URL('mygreatapp', blah), sub_submenu), # more menu items ]) if needsub_submenu: subsubmenu.append([

Re: [web2py] Re: How to build a modular menu

2012-07-17 Thread Cliff Kachinske
You are welcome. On Tuesday, July 17, 2012 2:48:35 AM UTC-4, Johann Spies wrote: > > Thanks Jaap and Cliff. > It was helpful. > > Regards > Johann > -- > Because experiencing your loyal love is better than life itself, > my lips will praise you. (Psalm 63:3) > > --

[web2py] Re: KeyError on pyfpdf

2012-07-17 Thread Cliff Kachinske
Is this report to be printed? If so, just generate a pdf. On Saturday, July 14, 2012 4:06:33 PM UTC-4, thinkwell wrote: > > Hello everyone, > > I'm experimenting with pyfpdf with HTML formatting, but it's not going so > well. Is a bit buggy. For example, this code generates a KeyError: 'width'.

[web2py] Re: two references from one table to another.

2012-07-20 Thread Cliff Kachinske
Let's say your table name is from_to. Then you have something like arbitrary_last_name = 'Smith' # make this assignment at run time query = ( (db.auth_user.last_name==arbitrary_last_name) & (db.auth_user.id==db.from_to.from_user) & (db.from_to.to_user==db.auth_user.id) ) db(query).select(db

[web2py] Re: Unions and select from tables

2012-07-20 Thread Cliff Kachinske
You can avoid a union like so: rows = db(q).select(r).as_list() rows.extend(db(qq).select(rr).as_list() You have to access attributes dictionary fashion, not in dot notation. Could be a problem for SQLTABLE and descendants. Google 'sort list of dictionaries' to see how to sort it. On Friday

[web2py] Re: DAL select queries abstraction is getting fiddly... your advice?

2012-07-21 Thread Cliff Kachinske
What are you trying to do? On Saturday, July 21, 2012 1:34:01 PM UTC-4, Alec Taylor wrote: > > Alright, I think I've made a pretty tiny test-case. > > So basically I want to grab the group and all its events on request. > > So I give the request check on `group_name`, followed by an outer left

[web2py] Re: Unions and select from tables

2012-07-21 Thread Cliff Kachinske
This does not translate into a union and runs at the web2py level. Mind > that while testing I notice a discrepancy between docs and implementation > of the sort() method. I fixed it in trunk. This code will only work with > trunk. > > Massimo > > > On Friday, 20 July 2012 1

[web2py] Re: Unions and select from tables

2012-07-21 Thread Cliff Kachinske
wrote: > > You do not have to. The line: > > y.colnames=x.colnames > > does it for you, as long as the list of fields maps 1 to 1. > > On Saturday, 21 July 2012 20:10:09 UTC-5, Cliff Kachinske wrote: >> >> This is great. >> >> I've not tried it yet, but

Re: [web2py] Re: DAL select queries abstraction is getting fiddly... your advice?

2012-07-22 Thread Cliff Kachinske
Correct, it will get you results. The drawback is you are hitting the database twice, while a join requires only one hit. In nearly every case you want to minimize database hits for performance reasons. On Sunday, July 22, 2012 1:12:39 PM UTC-4, Alec Taylor wrote: > > Took another look, real

[web2py] Best way to mix people and organizations on the same view? Opinions, please.

2012-07-22 Thread Cliff Kachinske
pport CONCAT, and I don't want to mess with raw sql if I can avoid it. Does anyone have any ideas? Any opinions gratefully accepted. Thanks, Cliff Kachinske --

[web2py] Re: Best way to mix people and organizations on the same view? Opinions, please.

2012-07-22 Thread Cliff Kachinske
Thank you Jose. I will look into this. On Sunday, July 22, 2012 7:21:29 PM UTC-4, Jose wrote: > > > > El domingo, 22 de julio de 2012 17:39:29 UTC-3, Cliff Kachinske escribió: >> >> I have a need to provide an index of both people and organizations on the >> same v

[web2py] Re: Best way to mix people and organizations on the same view? Opinions, please.

2012-07-23 Thread Cliff Kachinske
Annet, Thanks for the response. How do you handle sorting in the joined rows? Thanks, Cliff Kachinske On Monday, July 23, 2012 1:37:03 AM UTC-4, Annet wrote: > > I solved a similar problem by adding a table which I called node. A node > can either be a person or an organization. When

[web2py] Re: Confused re. "Validators in model not good MVC"

2012-07-23 Thread Cliff Kachinske
Caveat: my opinions. I am not a spokesperson for Web2py. That said: 1. No. MVC provides separation of functions as a way of organizing code. Usually programmers work together with designers, and MVC provides a way for them to interact without too much stepping on each other's toes. Typica

Re: [web2py] Re: Multi-tenant social-network?

2012-07-23 Thread Cliff Kachinske
> Separate DBs sounds messy. Some elaboration on that point. Methinks you will lose the advantage of connection pooling. Every request will need its own connection, and performance will suffer. How will you avoid duplicate db names? You will need a central repository, which probably should b

Re: [web2py] Re: Multi-tenant social-network?

2012-07-24 Thread Cliff Kachinske
ly just a perception thing, as you say, and it sounds like > the drawbacks outweigh the benefits... :\ > > So thanks for alleviating my concerns > > On Tuesday, July 24, 2012 9:57:46 AM UTC+10, pbreit wrote: >> >> On Monday, July 23, 2012 3:01:40 PM UTC-7, Cliff Kachinske w

[web2py] Re: Replacing session.var with another value

2012-07-26 Thread Cliff Kachinske
The dot notation for session.vars.a is not going to work. It's true that session is a Python object and you can assign attributes to it, but vars is not a Python object. Thus you cannot assign attributes to it. For this case, it would be simpler to just use something like session.user_input

[web2py] Re: retrieve data from many to many relation

2012-07-28 Thread Cliff Kachinske
You need to define a set that includes all three tables in the relation. ((db.genres.id==db.movies_genres.genres_id) & (db.movies_genres.movie_id==db.movies.id)) To get the set of genres for a specific movie, do ((db.genres.id==db.movies_genres.genres_id) & (db.movies_genres.movie_id==db.movies.

[web2py] Re: `update_or_insert()` is always inserting?

2012-07-31 Thread Cliff Kachinske
You need the other form of update_or_insert:. This is covered in the manual. I always encourage people to Read The Fine Manual (RTFM) to gain a good understanding what's going on. db.person.update_or_insert(db.person.name=='John', name='John',birthplace='Chicago') or db.foo.update_or_inse

[web2py] Re: Making part of User's Profile public - viewable by anyone with url

2012-07-31 Thread Cliff Kachinske
Check out fields and readonly in the SQLFORM signature at http://web2py.com/books/default/chapter/29/7 Also see crud.read() and crud.select() at http://web2py.com/books/default/chapter/29/7#Methods Either of these should do the job for you. On Tuesday, July 31, 2012 3:11:47 PM UTC-4, Rob_McC w

[web2py] Re: Giving a talk promoting web2py over Django

2012-08-01 Thread Cliff Kachinske
I auditioned a lot of web frameworks in various languages. Web2py was the only one that allowed me to be instantly productive when it came to porting my PHP apps. On Wednesday, August 1, 2012 11:46:48 AM UTC-4, Alec Taylor wrote: > > Tonight I'm going to present my little social-network to a us

[web2py] Re: grid search behaviour with foreign keys

2012-08-01 Thread Cliff Kachinske
This situation caused me to create an alternative to grid, which I will be publishing soon. Having thought through the problem, I may look at submitting a patch to incorporate my approach. On Wednesday, August 1, 2012 4:14:48 PM UTC-4, Mike wrote: > > I'm also trying to get around this issue -

[web2py] Re: unable to parse csv file (1062, u"Duplicate entry 'n...@domain.com' for key 'email'")

2012-08-01 Thread Cliff Kachinske
Jonathan, Is email really a key? What happens if you delete line 36? If it still fails, what happens if you delete lines 1 thru 36? On Monday, July 30, 2012 8:52:18 PM UTC-4, Jonathan Lundell wrote: > > I'm running into an odd csv-import problem. > > I've exported a table via SQLFORM.grid's ex

[web2py] Re: Copyright with current year in footer - automatic updating - suggestion.

2012-08-06 Thread Cliff Kachinske
Sorry for hijacking this thread, but I feel there's an important point that needs to be made. I've been following technology-related legal issues on groklaw.net since the SCO Group launched its infamous anti-Linux lawsuits. If there's one thing I've learned, it's this: if you want to know how

[web2py] Re: presenting a manytomany relation for insert

2012-08-06 Thread Cliff Kachinske
For starters, I'm not sure the syntax is correct for multiple validators. The Web2py manual states they need to be in the form of a list. http://web2py.com/books/default/chapter/29/7#Validators Also notice I have cleaned up the closing parends. db.abonnement.destinataire_id.requires = [ IS_

[web2py] Re: grid not ordering lambda-generated column values correctly

2012-08-06 Thread Cliff Kachinske
Me too. It's one of the reasons I don't use grid/smartgrid. Sorry I don't have an answer. On Monday, August 6, 2012 10:18:07 AM UTC-4, weheh wrote: > > I have an SQLFORM.grid(... orderby=db.host.id ...) where > db.host.id.represent=lambda value, row: int( > db((db.url_queue.host_id == value)

[web2py] Re: grid not ordering lambda-generated column values correctly

2012-08-06 Thread Cliff Kachinske
other field gets computed at run-time, > but to search/orderby them you have to fetch them too, and that can be > expensive. > > If you need to orderby/search by a referenced/represented/computed field, > you can pass the full queryset to the grid. > > On Monday, August 6, 2012

[web2py] Re: invalid select attribute: distinct

2012-08-06 Thread Cliff Kachinske
I have created this problem by adding the unique argument to a table column after populating it with data. try removing it from the has_line field. On Monday, August 6, 2012 8:19:36 PM UTC-4, Elton Pereira de Lima wrote: > > I'm using the latest development version, and try to add a record by th

[web2py] Re: presenting a manytomany relation for insert

2012-08-06 Thread Cliff Kachinske
specify wich fields can be exposed in the form? > thanks > > > Le lundi 6 août 2012 21:02:44 UTC+2, Cliff Kachinske a écrit : >> >> For starters, I'm not sure the syntax is correct for multiple validators. >> The Web2py manual states they need to be in the form

[web2py] RFC: web2py Google Code issues; defect vs. enhancement. Audience developers and users

2012-08-10 Thread Cliff Kachinske
Here is a quote from an earlier thread: *Looks like a large number of the issues are actually enhancements, but they're all labeled as defects* (Here is a link to the full thread: https://groups.google.com/forum/?fromgroups#!topicsearchin/web2py/google$20code$20issues/web2py/OUoiAF6ERYs%5B1-

[web2py] Re: Electronic voting anybody?

2012-08-10 Thread Cliff Kachinske
On the demo, after creating an election I was redirected to the home page rather than to the index. I would think the index would make more sense, since that is where you find the create button. This is a cool idea, though. On Friday, August 10, 2012 5:24:10 PM UTC-4, Massimo Di Pierro wrote:

[web2py] Re: Get result set back as list?

2012-08-10 Thread Cliff Kachinske
I use Anthony's method because it returns a true list. as_list() returns a list of dictionaries, and you still have to iterate over the dictionaries in the list to extract the values. On Friday, August 10, 2012 4:34:01 PM UTC-4, Toby Shepard wrote: > > > I'm in a situation where I just want a si

[web2py] Re: Janrain redirects successfully, but I'm not logged in?

2012-08-12 Thread Cliff Kachinske
Google Chrome SSL error. Server identified itself as *.rhcloud.com not giantpicnic.com Needless to say I did not go there. On Sunday, August 12, 2012 2:53:38 PM UTC-4, Alec Taylor wrote: > > After I click the login with facebook with Janrain I am redirected to my > page. > > Here is the respons

Re: [web2py] how to use Not belongs

2012-08-13 Thread Cliff Kachinske
Bruno's method is correct. With Postgres and psycopg2, make sure the array variable is not empty or wrap it in a try...except block. On Monday, August 13, 2012 7:34:55 AM UTC-4, rochacbruno wrote: > > use the unary ~ operator > > db(~db.table1.field1.belongs(array)).update(field2=False) > > Bru

[web2py] Re: autoincremente field with a specific first value

2012-08-13 Thread Cliff Kachinske
In MySQL there is ALTER TABLE mytable AUTO_INCREMENT = 500 Is that what you want to do? On Friday, August 10, 2012 11:46:54 AM UTC-4, tigmmi wrote: > > Is there a way to add an autoincremente field with a specific first value. > Compute won't work with id + number. --

[web2py] Re: Helper for many-to-many result sets?

2012-08-13 Thread Cliff Kachinske
There may be a more elegant way to do this, but it does work. Be sure to select the movie id in your query. Then you can do something like this: rows = db(query).select(.) #whatever you're doing trows = [] stars = [] for i, r in enumerate rows: stars.extend([r.stars.name, BR()]) if r.mo

Re: [web2py] retrieve data from many to many relation

2012-08-13 Thread Cliff Kachinske
gt; that application does... > > On 07/28/2012 05:37 AM, Cliff Kachinske wrote:> You need to define a set > that includes all three tables in the relation. > > > > ((db.genres.id==db.movies_genres.genres_id) & > > (db.movies_genres.movie_id==db.m

[web2py] How to email attachment with original filename

2012-08-17 Thread Cliff Kachinske
How can I email uploaded files with the original file name? I realize it is possible to make a copy of the file with the original name and attach that, but that seems like a waste of resources. Is there a better way? thanks, Cliff Kachinske --

[web2py] Re: How to email attachment with original filename

2012-08-17 Thread Cliff Kachinske
ents = [Mail.Attachment('/path/to/fist.file', filename= > "myfilename.jpg"), > Mail.Attachment('/path/to/second.file', filename= > "myfilename2.zip")]) > > > > On Friday, August 17, 2012 2:35:38 PM UTC+2, Cliff Kachinske w

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread Cliff Kachinske
Great. Many thanks to both. On Friday, August 17, 2012 10:13:45 AM UTC-4, Massimo Di Pierro wrote: > > Congratulations to Bruno Rocha and Mariano Reingart, > > New members of the Python Software Foundations. > > http://pyfound.blogspot.com.br/2012/08/welcome-new-psf-members.html > > > --

[web2py] Re: Congratulations to Bruno and Mariano

2012-08-17 Thread Cliff Kachinske
Massimo, you forget the salt. NaCl, without which there would be no USA cuisine. On Friday, August 17, 2012 3:54:38 PM UTC-4, Massimo Di Pierro wrote: > > I think you have a point. > Bruno is Vegan. Mariano eats excellent quality Argentinian meat. > We in US on the other side eat processed food

[web2py] Re: Where should I put functions that are useful/common to muliple applications?

2012-08-17 Thread Cliff Kachinske
curiouslearn I agree it's a good idea to learn as much as you can about the underlying database. That said, you need to learn about sql injection and perhaps other MySQL attack vectors before making your application public. See, for example xkcd.com/327/ On Friday, August 17, 2012 12:17:48 AM

[web2py] mail.send transposing "to" and "subject" ; can anybody explain this?

2012-08-17 Thread Cliff Kachinske
;m downloading a fresh zipball of 1.99.7 even as I type this, so I'm going to try the code on the latest stable. Still, this is strange. Does anybody know what's going on? Thanks, Cliff Kachinske --

[web2py] Re: Get row count for query without loading data into memory

2012-08-17 Thread Cliff Kachinske
I'm not really a DAL guru, but I can't imagine DAL doing that. Every dbms I know about has something like "SELECT COUNT(id) WHERE ..." On Friday, August 17, 2012 5:54:32 PM UTC-4, Mike Girard wrote: > > Does this load the rows into memory? > > db(db.person.id > 0).count() > > > If so, is ther

[web2py] Re: mail.send transposing "to" and "subject" ; can anybody explain this?

2012-08-17 Thread Cliff Kachinske
ixed in recent > versions. > > On Friday, August 17, 2012 11:25:44 PM UTC+2, Cliff Kachinske wrote: >> >> The simple controller says this: >> >> record = get_email_record() >> approved_suppliers = get_approved_suppliers(recor

[web2py] Re: Pre-populate profile form

2012-08-20 Thread Cliff Kachinske
Have you looked into Selenium at www.seleniumhq.org? With it you can simulate user input and check the system response. On Monday, August 20, 2012 5:30:19 AM UTC-4, Daniel Gonzalez wrote: > > Hi, > > I am trying to pre-populate the profile form with some random data, which > I am using for testi

[web2py] erratum in book? upload saving original filename

2012-08-24 Thread Cliff Kachinske
The book says use code like this: if request.vars.image!=None: form.vars.image_filename = request.vars.image.filename The code uses SQLFORM without defining download. When editing the record, if the upload field has nothing in it, it is empty, not None. So this exception gets raised: req

[web2py] Another strange email behavior on 1.99.2; anybody know what's going on?

2012-08-24 Thread Cliff Kachinske
Running 1.99.2 on localhost. When sending email, it prints the message to the console. All else works fine. Can anyone suggest why this might be going on? The production system is Ubuntu 10.4 running Apache. Will this behavior cause a problem there? Or should I just upgrade to 99.7? --

[web2py] Re: Another strange email behavior on 1.99.2; anybody know what's going on?

2012-08-24 Thread Cliff Kachinske
mail.settings.server = 'logging' in your model > (just to check)? > BTW: upgrading is always fine. > > On Friday, August 24, 2012 6:55:44 PM UTC+2, Cliff Kachinske wrote: >> >> Running 1.99.2 on localhost. >> >> When sending email, it prints the message to t

Re: [web2py] Re: how to escape data from request.post_vars to prevent SQLi

2012-08-28 Thread Cliff Kachinske
>From the manual: A field also has methods. Some of them are used to build queries and we will seem them later. A special method of the field object is validate and it calls the validators for the field. print db.person.name.validate('John') which returns a tuple (value, error). error is None i

[web2py] Re: IMPORTANT - NEED HELP: more speed improvements to be tested

2012-08-28 Thread Cliff Kachinske
Found no problems running my production code against today's trunk. Didn't change the models. I use grid to manage configuration items like currencies, locations, payment terms, delivery terms. More complex objects involve many-to-many relationships; lots of table joins, but very vanilla stuff

[web2py] Re: web2py 2.0 stats

2012-08-29 Thread Cliff Kachinske
Woo Hoo! On Tuesday, August 28, 2012 11:35:15 PM UTC-4, Massimo Di Pierro wrote: > > It is ready but we cannot stop tweaking it ... > > we replaced 16,000 lines of code and we added 41,000 new lines when > compared with web2py 1.99.2 (minified js count as one line). > > We may release it tomorrow

[web2py] How can I make SQLFORM upload field look better?

2012-08-29 Thread Cliff Kachinske
mpty upload field is so much bigger, it looks like the specification is missing. My current solution is this, but I would love to have a better one. The "Replace Specification" button is a link to a dedicated upload form. It works OK but I would like something cleaner. Any i

[web2py] Re: web2py 2.0.2 is out

2012-08-30 Thread Cliff Kachinske
This is the best Christmas ever. So many shiny new toys. Thanks to Massimo and all who contributed. Cliff Kachinske --

[web2py] Re: Multiple tables or a single big one?

2012-08-30 Thread Cliff Kachinske
It almost comes down to a matter of personal preference and where you want your complexity. One join more or less doesn't mean much. But you will want to index your foreign key on the second table. That will slow things a bit on inserts. You want to make sure your auth_user table has ON DEL

Re: [web2py] help with apache

2012-08-31 Thread Cliff Kachinske
Maybe you have an orphan process? http://www.geekride.com/orphan-zombie-process/ On Friday, August 31, 2012 7:10:25 PM UTC-4, Massimo Di Pierro wrote: > > That helps. Somehow my screen was not large enough and I did not see the > PID. > > mdipierro@www:~$ sudo /etc/init.d/apache2 stop > [sudo] p

[web2py] Re: Updated cheatsheet

2012-09-05 Thread Cliff Kachinske
Bless you for this. It helps so much with my advanced case of CRS. On Tuesday, September 4, 2012 11:12:03 AM UTC-4, Massimo Di Pierro wrote: > > http://web2py.com/examples/static/web2py_cheatsheet.pdf > --

[web2py] Re: Why would I use DIV classes/helpers, over an html template?

2012-09-07 Thread Cliff Kachinske
Because you can do stuff like this: rows = db(...#get some arbitrary rows tbody = TBODY() for r in rows: tbody.append(TR(...# do complex stuff with row data. If a list of rental properties, for example, style the address red if vacant table=TABLE(THEAD(...arbitrary column headings), tbody) Th

[web2py] Re: HTTPS admin access has stopped working

2012-09-18 Thread Cliff Kachinske
You did remember to stop and restart apache after copying the parameters file, right? I ask only because I have overlooked this step. On Monday, September 17, 2012 3:15:40 PM UTC-4, David Phillips wrote: > > I had a web2py 1.99.7 app running on Elastic Beanstalk. I was able to use > the admin i

Re: [web2py] Re: Workflow engine for web2py

2012-09-25 Thread Cliff Kachinske
My workflow got pushed to the back burner. Right now I have so much on my plate I don't know when I'll get back to it. On Monday, September 24, 2012 6:07:54 AM UTC-4, Ramos wrote: > > No news about workflows in web2py? > > > 2012/4/16 António Ramos > > >> For me, the advantage i see is to centra

Re: [web2py] Re: Help me prepare a talk on Web2py for the June Meetup of the Atlanta Python User Group (PyATL).

2012-05-22 Thread Cliff Kachinske
Thank you. I think I will use this. On Mon, May 21, 2012 at 9:44 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Perhaps this can be useful. > > Sample: > http://dl.dropbox.com/u/18065445/MarkminSlides/test.html > > Source: > https://github.com/mdipierro/markmin-reveal-slides > > It

Re: [web2py] workflow manager design issues - comments invited

2012-05-24 Thread Cliff Kachinske
Thanks Khalil. Some reading for me. On Thursday, May 24, 2012 4:22:15 AM UTC-4, Khalil KHAMLICHI wrote: > > I think you are talking about something called BPMN (Business Process > Model and Notation) > There are plenty of resources for bpmn on the Internet, in some advanced > IDEs there is even

Re: [web2py] Development Environments vs Live Environment

2012-05-24 Thread Cliff Kachinske
If your development environment is Linux, you can set and read an environment variable to take care of this. As sudo or su, add the following line to /etc/environment: W2PYENV="dev" Python only loads the environment once, so I had to kill all the python instances. I just rebooted. Then, in db

Re: [web2py] Development Environments vs Live Environment

2012-05-24 Thread Cliff Kachinske
Foo, typo. My bad. Line should be this: if 'W2PYENV' in environ.keys() and environ['W2PYENV'] == 'dev': On Thursday, May 24, 2012 2:22:50 PM UTC-4, Cliff Kachinske wrote: > > If your development environment is Linux, you can set and read an > environmen

Re: [web2py] Development Environments vs Live Environment

2012-05-24 Thread Cliff Kachinske
I don't think it's the DAL, I think it's in the drivers or the db systems. Something like this worked on SQLite but Psycopg2 raises an exception: list_1 = [2,4.5] list_2 = [] db((db.sometable.id.belongs(list_1) & ~(db.sometable.id.belongs(list_2)).select() On Thursday, May 24, 2012 2:35:44 P

Re: [web2py] Re: RFC: web2py-based workflow engine

2012-05-25 Thread Cliff Kachinske
Ross, Does this mean your workflow engine is also a background task? Something like my_queue = [] def handle_it(it): blah... while True: my_queue.extend(db.q_table while my_queue: mytask = my_queue.pop() handle_it(mytask) On Friday, May 25, 2012 9:31:33 AM UTC-4, Ross Peo

[web2py] Re: Questions for an application with a large number of features and a large database.

2012-05-25 Thread Cliff Kachinske
Maybe you could soft link the model files. For controller foo you would have a file models/foo/foo.py If controller bar needs needs data from table foo, you would create a soft link in you models/bar directory to models/foo/foo.py. Note if you link it in as foo.py, it will run after bar.py, so

Re: [web2py] Re: How to prevent delete of a row with SQLFORM.grid -

2012-05-27 Thread Cliff Kachinske
elete button and immediately clicks the next page link? Thanks Cliff Kachinske On Thursday, May 24, 2012 6:23:58 PM UTC-4, Niphlod wrote: > > well, the intended design is NOT to reload page if a row is deleted > (better user experience). > Small corner cases are "delete every ro

[web2py] Re: Questions for an application with a large number of features and a large database.

2012-05-27 Thread Cliff Kachinske
Cliff, > > Certainly an interesting idea. I'm assuming that you mean soft-linking > the file system? Would that work on Windows (I have to be able to deploy to > Windows and Mac)? > > -David > > On Friday, May 25, 2012 8:05:06 PM UTC+1, Cliff Kachinske wrote: >> >

Re: [web2py] Re: How to prevent delete of a row with SQLFORM.grid -

2012-05-28 Thread Cliff Kachinske
You could disable the page navigation links until the server comes back with the new page data. It will still be faster than a complete page reload because you won't be fetching the css, etc. again. On Sunday, May 27, 2012 12:29:40 PM UTC-4, Anthony wrote: > > But isn't there a risk of a race c

[web2py] Re: What do you think of this service? Pagodabox

2012-05-31 Thread Cliff Kachinske
I'm way too paranoid to allow some third party to read data from my computer. On Thursday, May 31, 2012 11:25:42 AM UTC-4, encompass wrote: > > They do php deployments, but in a very unique way. > They pull from your git repository to deploy an application. Do you see > a demand for something

Re: [web2py] Thinking of building a bug tracker...

2012-05-31 Thread Cliff Kachinske
Disagree. A bug and a feature are not the same. Fixing a bug means making your code live up to its specifications. Adding a feature may affect modules outside your control and require collaboration with others. Sometimes very close collaboration and changes to many modules. The design change

Re: [web2py] Thinking of building a bug tracker...

2012-05-31 Thread Cliff Kachinske
+1 for git. It seems so much simpler. On Thursday, May 31, 2012 10:32:14 AM UTC-4, Bruce Wade wrote: > > I second this idea and would be interested in helping. However I want to > get git integration more then HG :D > > Thinking we should also have a feature request built into this, because >

[web2py] Re: Removing a row from a list

2012-06-01 Thread Cliff Kachinske
This looks like a job for ajax. Make a callback to the controller to delete the row using :eval. The callback function returns a jquery code to delete the row from the page. I would give you a link to the book, but I'm having problems going to web2py.com. On Friday, June 1, 2012 6:43:37 AM UT

[web2py] Re: Removing a row from a list

2012-06-01 Thread Cliff Kachinske
Based on this thread and an earlier one on the same topic, I think I'm going to rework my index list pages something like this. The link to the delete function will include the record id, index row number of the record and number of rows on the page. When the user clicks the delete button, the

[web2py] Re: Innovation under Austerity

2012-06-06 Thread Cliff Kachinske
Re: Facebook and other 'Free' social networking sites, this old quote applies: "If you aren't paying for it, you are not the customer. You are the product." On Tuesday, June 5, 2012 7:02:25 PM UTC-4, mcm wrote: > > F2C2012: Eben Moglen keynote - "Innovation under Austerity" > > http://youtu

[web2py] Re: Newbie Alert: A flow chart of how things happen

2012-06-07 Thread Cliff Kachinske
Some googles: http request http response On Thursday, June 7, 2012 6:15:26 AM UTC-4, Omar Ali wrote: > > I'm a total newbie. I have programmed extensively during the VB days > (event driven programming) (I know, you'd hardly call that programming!) so > ... Web programming is taking a toll on

Re: [web2py] Re: recognizing web2py restart

2012-06-07 Thread Cliff Kachinske
It's not unusual to have a setup like this: development box -> test box -> production box The test box is a clone of the production box, as much as you can make it so. No reason why it couldn't be a virtual machine, but it has to be there to prevent surprises due to different patch/version lev

[web2py] Help me get a better feel for efficient code

2012-06-07 Thread Cliff Kachinske
I'm just starting to use modules with classes for code commonality. I don't have a good feel for the most efficient way to, for example, pass the db to a class method. I can think of three ways. - Pass it in when you call the method. - Pass it in when you initialize the class - Import current,

Re: [web2py] Help me get a better feel for efficient code

2012-06-07 Thread Cliff Kachinske
at 2:42 PM, Cliff Kachinske wrote: > > I don't have a good feel for the most efficient way to, for example, pass > the db to a class method. I can think of three ways. > > - Pass it in when you call the method. > - Pass it in when you initialize the class > - Import curre

[web2py] Re: Help me get a better feel for efficient code

2012-06-07 Thread Cliff Kachinske
Anthony, Bruce, thank you. I will study the Auth and Crud code. On Thursday, June 7, 2012 5:42:33 PM UTC-4, Cliff Kachinske wrote: > > I'm just starting to use modules with classes for code commonality. > > I don't have a good feel for the most efficient way to, for exam

[web2py] Re: Which checker (PyChecker, Lint, PyFlakes, ...?) is good for using with web2py projects, and how?

2012-06-08 Thread Cliff Kachinske
I've used PyFlakes. if 0: from gluon import * Integrated with gvim/vim. It still complains because gluon isn't on the pythonpath. I suppose I could set up a virtualenv so this doesn't happen, but it's not much of a bother so I'm ignoring it for now. On Friday, June 8, 2012 1:38:57 AM UTC-4

[web2py] Re: Table already exists, yes I know so SKIP it.

2012-06-11 Thread Cliff Kachinske
If applications share a table, you must decide which app owns the table. Only that application should ever migrate the table. Assuming an application called 'foo', this could be accomplished by something like this in your model file. should_migrate = False if request.application=='foo': shou

[web2py] Re: web2py book now free in PDF

2012-06-12 Thread Cliff Kachinske
Thank you, Massimo. On Tuesday, June 12, 2012 9:17:46 AM UTC-4, Massimo Di Pierro wrote: > > The official web2py book is now free for everybody: > > https://dl.dropbox.com/u/18065445/web2py/web2py_manual_4th.1.pdf > > Massimo >

Re: [web2py] pyFpdf supports gif images?

2012-06-13 Thread Cliff Kachinske
Thanks, Mariano I'm using PyFPDF for printed reports with various logos on them; the extended report will come in handy. Cliff Kachinske On Wednesday, June 13, 2012 5:41:21 PM UTC-4, Mariano Reingart wrote: > > PyFPDF currently supports jpg and png (binary transparency should

Re: [web2py] Switching sqlite/postgres

2012-06-13 Thread Cliff Kachinske
Gabriella, Does the problem go away if you define the pictures table before the route table? On Wednesday, June 13, 2012 6:38:07 PM UTC-4, Gabriella Canavesi wrote: > > Yes off course :-) > It is just below the route table definition, here: > > db.define_table('pictures', >

Re: [web2py] Switching sqlite/postgres

2012-06-14 Thread Cliff Kachinske
Paolo, You said, " I cannot move the pictures table declaration because both off them have references to each other (mutual reference?) " Why would the tables have mutual references? What kind of relation would cause that? Here are the kinds of relations I know about. One to many; put the re

[web2py] Web2py talk went okay

2012-06-14 Thread Cliff Kachinske
Thanks to all who provided pointers to information for preparing for the talk, especially Massimo. This evening I presented a talk before PyAtl, the Atlanta Meetup Python User Group. Because of time constraints, (30-40 mins) I was really only able to cover the DAL. Out of the ~32 attendees, I

[web2py] Re: web2py book now free in PDF

2012-06-14 Thread Cliff Kachinske
You can't beat free. I publicized the free pdf in tonight's PyAtl user group meeting. PyAtl is a Meetup group. On Tuesday, June 12, 2012 9:17:46 AM UTC-4, Massimo Di Pierro wrote: > > The official web2py book is now free for everybody: > > https://dl.dropbox.com/u/18065445/web2py/web2py_manual_4

[web2py] Re: I am planning to re-develope my windows applications in python

2012-06-14 Thread Cliff Kachinske
I have tried both Django and Web2py. I was able to get productive with Web2py right away, while I struggled with Django. I suggest your experience will be the same. On Thursday, June 14, 2012 9:58:22 AM UTC-4, KarlHeinzF wrote: > > Hallo everybody, > first of all I am new to python and web2py.

[web2py] Re: Web2py talk went okay

2012-06-15 Thread Cliff Kachinske
erro wrote: > > Congratulations. Not sure I was of any help. We should make a repository > of info for people who need to give talks. > > On Friday, 15 June 2012 01:17:37 UTC-5, Cliff Kachinske wrote: >> >> Thanks to all who provided pointers to information for preparing

[web2py] Re: Users Poll: To keep the button look for the welcome app's auth options, or not ?

2012-06-17 Thread Cliff Kachinske
I agree that the old look, with dividers, *looks* better. I also think the buttons are easier to find on the page, so I would like to optionally use them. Would you take a patch with the option? On Saturday, June 16, 2012 11:30:04 PM UTC-4, Andrew wrote: > > A week or two ago a change was mad

[web2py] Works, but is it valid: db.sometable.id.table ??

2012-06-19 Thread Cliff Kachinske
It seems to work, because print db.sometable.id.table returns 'sometable'. But I can't find any documentation for it. Is this how things are supposed to work, or am I just seeing a side effect? Thanks Cliff Kachinske

[web2py] Re: Works, but is it valid: db.sometable.id.table ??

2012-06-19 Thread Cliff Kachinske
ter/29/6#Recursive-selects>, > but I don't think .id is documented). > > Anthony > > On Tuesday, June 19, 2012 9:15:21 AM UTC-4, Cliff Kachinske wrote: >> >> >> It seems to work, because >> >> print db.sometable.id.table >> >> returns 'som

Re: [web2py] Re: Problem while using two sqlform.grid in a single form

2012-06-19 Thread Cliff Kachinske
Jonathan, I realize fixing this isn't a priority. Could you retain the edit/view state in the session and retrieve it on reload? On Monday, June 18, 2012 8:48:50 PM UTC-4, Jonathan Lundell wrote: > > On Jun 18, 2012, at 5:17 PM, Massimo Di Pierro wrote: > > The grid uses the request args to fig

[web2py] Re: Mysql reserved words in a legacy db

2012-06-20 Thread Cliff Kachinske
It occurs to me you might try this Field("'group'"), On Wednesday, June 20, 2012 2:03:48 PM UTC-4, acidjunk wrote: > > Hi All, > > I use web2py to create a admin interface for an older project with an > existing database in MySQL. > So I extracted the DAL info with an script. > > --extr

[web2py] Re: Question about a complex model & the associated form ( from controller to view )

2012-06-20 Thread Cliff Kachinske
Why do you say this: A league will most definitely needs its own database instead of a table ? I ask because it's probably not true. On Wednesday, June 20, 2012 10:12:13 AM UTC-4, Don_X wrote: > > A league will most definitely needs its own database instead of a table > ... while a team can hav

  1   2   3   4   5   >