[web2py] Update record in session

2012-02-09 Thread scausten
Is is possible to hold a record in session, something like: id = db.transactions.insert() session.transaction = db.transactions[id] and directly update_record the session.transaction, session.transaction.update_record(x=y)# This throws KeyError: 'update_record' or is it necessary to res

[web2py] Re: custom.widget manipulation with checkboxes

2012-02-09 Thread Serbitar
Got the solution myself. The right code is: form.custom.widget['myfield']['_checked'] = db((db.mytable.id==id).select(db.mytable.myfield).first() #updated form.custom.widget['myfield']._postprocessing() On 6 Feb., 17:55, Serbitar wrote: > I can do something like this: > > fields = [Field('myfi

[web2py] Re: Update record in session

2012-02-09 Thread Niphlod
session is not the database. you can save the transactionid into the session and update the db in the controller. e.g. id = db.transactions.insert() session.transaction = id db(db.transactions.id == session.transaction).update(x=y) or you can manage transaction record in the session and updat

[web2py] Re: why many lines in /root/var/log/uwsgi-python/web2py log : routing 0 routes 0 ?

2012-02-09 Thread Niphlod
logging in /var/log/uwsgi-python is pertinent to uwsgi-python. you probably have the directive --memory-report in your app configuration. ( in xml, etc.)

[web2py] Re: Advice please: best way to count records?

2012-02-09 Thread Niphlod
The two methods you described are the only available methods to achieve such a thing. If you have 100 records returned and you want to paginate by 20 (5 pages), then the difference between one method or the other is negligible. If you have 1000 records returned and you want to paginate by 20 (5

[web2py] Re: Update legacy table using primarykey failed

2012-02-09 Thread Niphlod
can you post the html generated by the form before submitting the record and the "beautified" session ? In order to avoid race conditions, web2py places some hidden fields in the form and store a key in the session when accessing a edit form: seems that this fields don't match, hence the traceba

[web2py] query on a JOIN

2012-02-09 Thread shartha
Hello everyone! In the example in the book for JOIN, http://web2py.com/books/default/chapter/29/6#Inner-joins how can you write a query that only returns the dogs that Alex has? I need to have access to all the fields for Alex and all the fields for the dogs he has (This is not my exact problem

[web2py] Modules: how to access db

2012-02-09 Thread Johann Spies
I am not ready with this project to try out Bruno's way of setting up a database using modules and not models. But I want to be able to do something like this in a module: def number_or_records(table): count = db(db[table]).count() -- Because experiencing your loyal love is

[web2py] Re: Modules: how to access db

2012-02-09 Thread Johann Spies
Sorry the message was sent before I have finished typing. How do I get the same environment available in the module as in the controller? Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3)

[web2py] Re: Modules: how to access db

2012-02-09 Thread Ross Peoples
from gluon import * This should give you the "current" object which has these: current.request current.response current.cache You must initialize your modules with a db instance though. So I usually do this: class MyModule(object): def __init__(self, db, ...)

Re: [web2py] Re: keep shared objects permanently in RAM: Is it possible ?

2012-02-09 Thread Ross Peoples
Thanks for pointing that out Michele. I may need to use something like this in the future.

[web2py] Re: option to move smartgrid buttons to the left side

2012-02-09 Thread Ross Peoples
I was wondering about the previously. I haven't tried this yet, but as a temporary workaround, are you able to insert buttons using JavaScript?

Re: [web2py] query on a JOIN

2012-02-09 Thread Manuele Pesenti
Il 09/02/2012 12:33, shartha ha scritto: how can you write a query that only returns the dogs that Alex has? you can add your filter condition to the join condition usch as: rows = db((db.person.id==db.dog.owner)&(db.person.id==1)).select() If I understand the quest... M.

[web2py] Re: xml-rpc code causes compile error in mywiki default.py

2012-02-09 Thread Ross Peoples
You have a syntax error in fony_by(keyword): return db(db.page.title.contains(keyword).select().as_list() Should be: return db(db.page.title.contains(keyword)).select().as_list() You forgot the closing parenthesis before .select().

[web2py] Re: why many lines in /root/var/log/uwsgi-python/web2py log : routing 0 routes 0 ?

2012-02-09 Thread Carlos
Hi Niphlod, No, I do not have that option / directive on. What other directive could be the problem?. Btw I do have: Thanks again, Carlos

[web2py] Multiple different problems - Dealing with "Integrity Error" for nutnull=True and unique=True database fields

2012-02-09 Thread Rahul
Hi All, I have three problems - Please help me understand how to troubleshoot these Problem1 - (Primary issue) I have a table as below - How do I handle unique = True and notnull= True fields i.e when I am doing negative testing and adding similar fields, it throws me an exception. I am

[web2py] Folder inside controller dosen't work.

2012-02-09 Thread Phyo Arkar
Is that a bug or by design? I am using JSONRPC of web2py , i want to keep JSONRPC services int its own subfolder so not mixed with controllers for html. But web2py is not allowing me to do so. Here is my web2py's conttrolelr path: /home/v3ss/web2py/applications/FastTract/controllers/ i want to

Re: [web2py] Re: Modules: how to access db

2012-02-09 Thread Johann Spies
Thanks Ross. On 9 February 2012 14:39, Ross Peoples wrote: > from gluon import * > > This should give you the "current" object which has these: > > current.request > current.response > current.cache > > You must initialize your modules with a db instance though. So I usually > do this: > > class

Re: [web2py] Re: Modules: how to access db

2012-02-09 Thread Anthony
> > I do not understand this properly. > > After explicitly importing 'current' in the controller, I made some > progress. But why is the class definition necessary and how does it > initialise db when db is not available in the module? > You don't necessarily need a class. The point is just

Re: [web2py] Re: Modules: how to access db

2012-02-09 Thread Johann Spies
On 9 February 2012 15:45, Anthony wrote: > I do not understand this properly. >> >> After explicitly importing 'current' in the controller, I made some >> progress. But why is the class definition necessary and how does it >> initialise db when db is not available in the module? >> > > You don't

[web2py] Re: Folder inside controller dosen't work.

2012-02-09 Thread Phyo Arkar
I saw other people requested long ago since 2009. Why it would be a bad addition to web2py , i cant understand. There are many uses cases for it , my case is one very good example : To separate WEB CONTROLLER code from JSON/XML RPC Services. On 2/9/12, Phyo Arkar wrote: > Is that a bug or by

[web2py] Select Where first letter is A

2012-02-09 Thread Web2Py Freak
Dear All , How Can i select everything in the table the starts with A Best Regards, Hassan Alnatour

[web2py] Re: Multiple different problems - Dealing with "Integrity Error" for nutnull=True and unique=True database fields

2012-02-09 Thread Anthony
> > Problem1 - (Primary issue) > I have a table as below - How do I handle unique = True and > notnull= True fields i.e when I am doing negative testing and adding > similar fields, it throws me an exception. If you set unique=True and notnull=True and then try to insert non-unique or

[web2py] Re: Advice please: best way to count records?

2012-02-09 Thread Anthony
Would another option be to cache the entire select and pull out the needed records based on the "page" requested: records = db(db.pages.active==True).select(cache=(cache.ram, 300)) I suppose that wouldn't be a good idea if there are likely to be enough records and/or enough simultaneous users w

[web2py] best way to fetch data from multiple tables?

2012-02-09 Thread Sonal_b
I have to query 3 tables which contains large number of data I have to come up with report which displays Employee Firstname, Lastname, Manager's FirstName, Manager's Lastname and Organisation name. Table Structure/Details: 1. Employee table: which contains employee information(First name, last

Re: [web2py] Select Where first letter is A

2012-02-09 Thread Javier Pepe
>From manual: http://web2py.com/books/default/chapter/29/6#like,-startswith,-contains,-upper,-lower db.mytable.myfield.startswith('value') On Thu, Feb 9, 2012 at 11:06 AM, Web2Py Freak wrote: > Dear All , > > How Can i select everything in the table the starts with A > > Best Regards, > Hassan

[web2py] Re: best way to fetch data from multiple tables?

2012-02-09 Thread Omi Chiba
Sound like you're looping all the records to connect different table. I use join for the purpose and working fine though I only have about 1 records. http://www.web2py.com/books/default/chapter/29/6?search=join#Inner-joins On Feb 9, 8:19 am, Sonal_b wrote: > I have to query 3 tables which c

Re: [web2py] Re: Modules: how to access db

2012-02-09 Thread Bruno Rocha
On Thu, Feb 9, 2012 at 11:45 AM, Anthony wrote: > from gluon import current > current.db = db > I dont think that adding db to current will work properly, it can work in SQLITE, but for sure will raise problems with another databases. I realized that db needs to be instantiated inside a module

Re: [web2py] Re: How to replace this native query with DAL

2012-02-09 Thread Bruce Wade
Sorry I just seen this message now, I ended up deleting it by accident and wondering why no-one responded. I will try this today. I didn't know there was a seconds() method attached to the date. Will respond back in a couple of hours when I get to work. -- Thanks, Bruce On Mon, Feb 6, 2012 at 4:

Re: [web2py] Re: Folder inside controller dosen't work.

2012-02-09 Thread Bruno Rocha
The main problem is the routing, web2py routes the second arg in url to the function, how would web2py knows if it has to be a function or a subfolder? IMO, controllers have to be small, less code, only code which decide the workflow, the long code I prefer to put in modules, and there I can have

[web2py] Re: Folder inside controller dosen't work.

2012-02-09 Thread Ross Peoples
Not sure on the subfolder thing, but is it possible for you to put most of your code into modules and just use controllers as the gateway to your modules?

[web2py] Re: Advice please: best way to count records?

2012-02-09 Thread Anthony
> > I can think of two ways to do it, but I don't like either one. First > is to formulate the query without the limitby clause and do a > db(query).count(). That would give me the total number of records in > the set. Then add the limitby clause to the query to get the records > of interes

Re: [web2py] Re: How to replace this native query with DAL

2012-02-09 Thread Bruce Wade
To answer your question, happen_time is a column of cash_journal. The point of this call, is we allow people to cancel the site within 72 hours so any money they have made in that time if they cancel they do not get. IE: payback_types = ['s','p'], s = sponsor bonus, p = product bonus We use second

[web2py] Re: best way to fetch data from multiple tables?

2012-02-09 Thread Sonal_b
Thanks Omi. I will give it a try. Also will it possible for me put filters on table 1(say Employees) and then perform join with other tables? On Feb 9, 7:34 pm, Omi Chiba wrote: > Sound like you're looping all the records to connect different table. > I use join for the purpose and working fine

[web2py] response.google_analytics_id

2012-02-09 Thread Web2Py Freak
Dear ALL, How do i use response.google_analytics_id in menu.py : my google analytics id is Tracking ID: UA-29069723-1 ,

[web2py] Re: best way to fetch data from multiple tables?

2012-02-09 Thread Omi Chiba
> Also will it possible for me put filters on table 1(say Employees) and> then > perform join with other tables? I'm not sure. I think it's more like join then filter. Something like below... query = (db.person.id==db.dog.owner) & (db.person.name.like('Omi%')) rows = db(query).select() On Feb 9

[web2py] response.google_analytics_id

2012-02-09 Thread Web2Py Freak
Dear All, How can i use response.google_analytics_id in menu.py as i understand i need to have a script with my analytics id , but why is the response.google_analytics_id in menu.py and how can i use it ?

[web2py] Re: Script to generate schema (models) from mysql

2012-02-09 Thread KMax
Hi I was trying to create model/db.py for RequestTracker mysql schema, and was fail. I found quite good plugin_legacymysql and fixed for my needs - added few types - remove 'SET' lines same as remarks - mysql data types without params (like text,) - import form_factory from sqlhtml

[web2py] Re: Modules: how to access db

2012-02-09 Thread omicron
With the last version, you can do this : from gluon import current dba = current.globalenv['db']

[web2py] Re: Update record in session

2012-02-09 Thread Anthony
On Thursday, February 9, 2012 3:10:52 AM UTC-5, scausten wrote: > > Is is possible to hold a record in session, something like: > > id = db.transactions.insert() > session.transaction = db.transactions[id] > > and directly update_record the session.transaction, > > session.transaction.update_re

[web2py] Re: option to move smartgrid buttons to the left side

2012-02-09 Thread Adi
Thanks Ross. I'm not sure how to do it, plus to assign the same functionality as existing buttons. Do you have some sample from your code? Just tried the application also on the iphone, and (smartgrid) horizontal scroll doesn't work there either... Practically, can't reach buttons :) Anyone e

Re: [web2py] Re: Modules: how to access db

2012-02-09 Thread Bruce Wade
Now that is a lot nicer then passing in the db to every module class. Does this only work with trunk? Or the latest stable release? On Thu, Feb 9, 2012 at 7:30 AM, omicron wrote: > With the last version, you can do this : > > from gluon import current > > dba = current.globalenv['db'] > > --

[web2py] Re: Modules: how to access db

2012-02-09 Thread Anthony
On Thursday, February 9, 2012 10:30:12 AM UTC-5, omicron wrote: > > With the last version, you can do this : > > from gluon import current > > dba = current.globalenv['db'] > I wonder why current.globalenv['db'] would work but current.db would not.

[web2py] Re: Modules: how to access db

2012-02-09 Thread howesc
based on advice on the group long ago i am using a pattern like this: in db.py: current.myapp = Storage() current.myapp.db = db #after db is inited then in my module refrencing db as: current.myapp.db i'm using this on GAE and it has been working like a champ. the key is to add the j

[web2py] Re: Modules: how to access db

2012-02-09 Thread Anthony
> > based on advice on the group long ago i am using a pattern like this: > > in db.py: > >current.myapp = Storage() >current.myapp.db = db #after db is inited > If that works, then current.db should work as well, no (I understand the idea behind putting everything app-specific in curren

Re: [web2py] Re: Modules: how to access db

2012-02-09 Thread Bruno Rocha
I dont know exactly how it works, but I had problems serializing db in to current, so Massimo said to always pass it explicitly to classes ad functions, I remember that SQLITE worked, but not Postgres. -- Bruno Rocha [http://rochacbruno.com.br]

[web2py] Re: xml-rpc code causes compile error in mywiki default.py

2012-02-09 Thread bill.tha...@live.com
Thanks Ross. Found that this morning. It's a typo in the book. For future readers finding this post on a search; Make sure you put the closing paren in the correct spot or your new error is a bit more substantial. (Python shell returns an error saying, 'Query' object has no attribute 'select' )

[web2py] Re: how to deploy web2py not in the apache root (help with url rewriting)

2012-02-09 Thread Wikus van de Merwe
If you have just one application all you need to do is set the web2py WSGI script alias and serve files from the web2py folder excluding admin parts. WSGIDaemonProcess web2py display-name=%{GROUP} WSGIProcessGroup web2py WSGIScriptAlias /prefix /var/www/web2py/wsgihandler.py Options +Follow

[web2py] Re: query on a JOIN

2012-02-09 Thread shartha
Thank you so much. I will try this and let you know how it works. =) On Feb 9, 6:48 am, Manuele Pesenti wrote: > Il 09/02/2012 12:33, shartha ha scritto:> how can you write a query that only > returns the dogs that Alex has? > > you can add your filter condition to the join condition usch as:

[web2py] Re: response.google_analytics_id

2012-02-09 Thread Niphlod
if you watch the layout.html you'll find the snippet. {{if response.google_analytics_id:}} var _gaq = _gaq || []; _gaq.push(['_setAccount', '{{=response.google_analytics_id}}']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript

Re: [web2py] Re: Advice please: best way to count records?

2012-02-09 Thread Richard Vézina
Is it just me ? db(query).count(cache=(cache.ram, 60)) Won't work... I get : TypeError: count() got an unexpected keyword argument 'cache' Richard On Thu, Feb 9, 2012 at 9:44 AM, Anthony wrote: > I can think of two ways to do it, but I don't like either one. First >> is to formulate the qu

Re: [web2py] Re: Advice please: best way to count records?

2012-02-09 Thread Richard Vézina
Under web2py 1.99.4 Richard On Thu, Feb 9, 2012 at 12:42 PM, Richard Vézina wrote: > Is it just me ? > > db(query).count(cache=(cache.ram, 60)) > > Won't work... > > I get : > > TypeError: count() got an unexpected keyword argument 'cache' > > Richard > > > On Thu, Feb 9, 2012 at 9:44 AM, Antho

[web2py] Re: Update legacy table using primarykey failed

2012-02-09 Thread Niphlod
uhm, this is the relevant part for the form I was asking for for the "session" , just put {{=BEAUTIFY(session)}} into the template and watch the keys Here the strange part is that it seems that employee code is not an integer as defined into the model but a decimal. I don't know if this

Re: [web2py] Re: Advice please: best way to count records?

2012-02-09 Thread Anthony
I don't think a count can be cached that way, but since it just returns a number, it can be cached in the usual way instead: count = cache.ram('count', lambda: db(query).count(), time_expire=60) Anthony On Thursday, February 9, 2012 12:42:02 PM UTC-5, Richard wrote: > > Is it just me ? > > db(q

[web2py] Re: why many lines in /root/var/log/uwsgi-python/web2py log : routing 0 routes 0 ?

2012-02-09 Thread Niphlod
can you post your conf ?If we don't come up with a solution we can rely on roberto de ioris, that is one of uwsgi developers and every now and then joins this list :D

Re: [web2py] Re: Advice please: best way to count records?

2012-02-09 Thread Richard Vézina
I just check gluon/dal.py and if it is the count() code location it's not have cache argument... Also I notice that there seems to have many differents implementations of count... I wouder why it could not be a generic function reused everywhere, it would be more DRY... Richard On Thu, Feb 9, 201

[web2py] Re: option to move smartgrid buttons to the left side

2012-02-09 Thread peter
I use sqlform.grid, I use 'links' for edit and delete. These appear as buttons on the right hand column. I have no problem accessing these buttons on my android phone. Are you sure you are attributing the problem correctly? My web2py website is identical on my android phone to what appears on a com

[web2py] Re: why many lines in /root/var/log/uwsgi-python/web2py log : routing 0 routes 0 ?

2012-02-09 Thread Carlos
This is my config for uwsgi-python: 127.0.0.1:9001 /home/www-data/web2py/ 4 wsgihandler Note that I use routes.py, so I'm not sure if these logging lines comes from here (although I have logging = 'off' )?. Thanks!

[web2py] uwsgi configuration: why many lines in /root/var/log/uwsgi-python/web2py log : routing 0 routes 0 ?

2012-02-09 Thread Niphlod
ok, this line is dne by uwsgi, and I don't know how to turn it off. Thu Feb 9 17:58:12 2012 - routing 0 routes 0 if you have memory report on, there will be also a line like {address space usage: 46809088 bytes/44MB} {rss usage: 34369536 bytes/32MB} [pid: 17838|app: 0|req: 23/90] 188.10.176.36

[web2py] markdown

2012-02-09 Thread Lewis
Markdown display using the imported WIKI function shifts text down by about 1/2em (one half of a line). This is very annoying in a table which no longer lines up vertically. The markdown rendered text column shows up below the other columns across a row. This just looks bad. Is there any reason

[web2py] Re: maybe minor bug or just documentation

2012-02-09 Thread Lewis
Then why did web2py fail with a run time error? Or why wasn't the run time error trapped? Maybe because I had requires on the same table for a different constraint? It doesn't look good when visitors to your site see the web2py error ticket page. Adding the explicit constraint prevented that.

Re: [web2py] uwsgi configuration: why many lines in /root/var/log/uwsgi-python/web2py log : routing 0 routes 0 ?

2012-02-09 Thread Roberto De Ioris
> ok, > this line is dne by uwsgi, and I don't know how to turn it off. > Thu Feb 9 17:58:12 2012 - routing 0 routes 0 > > if you have memory report on, there will be also a line like > > {address space usage: 46809088 bytes/44MB} {rss usage: 34369536 > bytes/32MB} > [pid: 17838|app: 0|req: 23/90

[web2py] DAL speed - an idea

2012-02-09 Thread nick name
One of my controllers need to go through a lot of records to provide a meaningful answer -- as in, 60k records. Just loading them from the database takes about 100ms (db.executesql("select * from table order by id;")); Doing the same through DAL takes over 6 seconds. I realize that the DAL does

Re: [web2py] DAL speed - an idea

2012-02-09 Thread Bruno Rocha
You mean using the generated SQL command to fire execute_sql and returns as a named tuple? >>> db(db.query).raw_select() it is the same as doing command = db(db.query)._select() result = db.execute_sql(command) On Thu, Feb 9, 2012 at 4:51 PM, nick name wrote: > One of my controllers need to go

[web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Wikus van de Merwe
What I see you are trying to say is that by keeping the code secret one gains a temporary advantage over the competition. That might be true. But this is the way of thinking coming from the proprietary software philosophy. How much will I loose by making the software free? If this is your line

[web2py] Re: markdown

2012-02-09 Thread Lewis
Here is an easier solution: {{=XML(joke.joke.joketext.replace('\n',''), sanitize=True)}} {{=joke.auth_user.first_name}} {{=joke.auth_user.last_name}} All I really wanted. Didn't need the rest of markdown or markmin. BTW, MARKMIN also pads the top of the text. Curious why this is s

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Bruce Wade
I can see your point even though I don't 100% agree with it. I write most of my code opensource, however I also have been writing software for a living for around 14 years so sometimes we don't have the choice between open and closed source. We also can't expect only people interested in free soft

Re: [web2py] uwsgi configuration: why many lines in /root/var/log/uwsgi-python/web2py log : routing 0 routes 0 ?

2012-02-09 Thread Niphlod
strange, really :D I don't mind if that turns out in the logging, but I have the same behaviour niphlod@platypus:~$ uwsgi-python --version uWSGI 0.9.6.8 I use uwsgi-python in production /usr/bin/uwsgi-python . If I recall correctly that is a symbolic link to `/etc/alternatives/uwsgi-python', an

[web2py] Re: Update legacy table using primarykey failed

2012-02-09 Thread Omi Chiba
You're right ! I thought it doesn't matter but it does. I define another table which has a same field type for key and works !! But I employee table doesn't work even I changed from 'string' to 'double' "SyntaxError: user is tampering with form's record_id: {'EmployeeCode': '61339.00'} != {'Emplo

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Bruno Rocha
*Movuca goals:* *Everybody should be able to use it for free* - Use it for creating sites, blogs and social networks (free or commercial) *Everybody can sell it as a service* - Use it to offer Movuca based websites as a service - Use it for developing websites for customers *Everybody can extend

[web2py] Re: Update legacy table using primarykey failed

2012-02-09 Thread Niphlod
that seems a float vs decimal problem bottom line, I didn't get what is not working right now ? PS: post table definition in "raw sql", model of the table as in the models.py, and controller, so I can at least try to reproduce with sqlite or postgres (again, sorry but I don't have DB2

Re: [web2py] Re: keep shared objects permanently in RAM: Is it possible ?

2012-02-09 Thread Sebastian E. Ovide
Thanks for that Michele ! That is a nice trick for sharing information with different processes reducing to the minimum the FS IO... It still has the IO bottleneck of read/write from/to file compare with real data permanent in memory... but still a valid approach... On Thu, Feb 9, 2012 at 12:58 AM

Re: [web2py] DAL speed - an idea

2012-02-09 Thread nick name
Yes, that is the basis of what I am suggesting. There is not currently such a thing; there is something called 'select_raw' implemented in the GoogleDataStore adapter, but not in anything else, and it isn't exactly what I am proposing. To elaborate: Assume the table is defined as follows:

[web2py] Re: option to move smartgrid buttons to the left side

2012-02-09 Thread Adi
Hi Peter... I put a simple smartgrid together, with a longer text field... so this one doesn't scroll horizontally for me. I'm not sure if it's something that we did on css or somewhere, but i noticed it worked on ipad as it should... here is the link: http://w2p.thanedev.com/test2/test/test

Re: [web2py] uwsgi configuration: why many lines in /root/var/log/uwsgi-python/web2py log : routing 0 routes 0 ?

2012-02-09 Thread Carlos
I installed uwsgi via: add-apt-repository ppa:uwsgi/release So there's nothing I can do to turn this logging off?. Thanks.

[web2py] Re: Update legacy table using primarykey failed

2012-02-09 Thread Omi Chiba
Thank you the help. So far, I found... - Ver 1.99.2 doesn't support update for primarykey - Ver 1.99.4 does support update for primarykey if it's string So this will fail. If it works for posgres and maybe problem with db2/ mssql. (I use DAL: mssql2). From the syntax error, it's ignore the 'inte

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Mariano Reingart
On Thu, Feb 9, 2012 at 4:34 PM, Bruce Wade wrote: > > GPL = Doesn't want anyone making money off their code and forces people to > recommit their code. This is good because everyone gets the code, bad > because you don't have a choice. > This is not completely true. GPL has nothing to do with ma

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Bruno Rocha
Yes exactly what I want. I should go with GPL3 or LGPL3 ? On Thu, Feb 9, 2012 at 6:34 PM, Mariano Reingart wrote: > > This is not completely true. > > GPL has nothing to do with making money. > GPL do not forces anyone to recommit their code. It only says that if > you make a GPL derivative, you

Re: [web2py] DAL speed - an idea

2012-02-09 Thread Willoughby
"In my case, I need to pull all the records (60,000) from the database to compute some aggregation which I cannot compute using sql" Are you familiar with window functions in SQL? I've never met an aggregation need that couldn't be met with clever use of windows...

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Anthony
> > *Everybody can extend, create plugins and add functionalities or plug in > to another apps* > - If used to deploy a website for you or client, free or commercial I dont > care about modifications, you can keep it as a secret (because it can have > your own business logic) > > *NOBODY can cr

Re: [web2py] DAL speed - an idea

2012-02-09 Thread Anthony
I've been thinking about something like this as well. Instead of a separate select_raw() method, maybe we can just add a raw=True|False argument to the existing select() method. I like the namedtuple idea as well (I think some adapters already provide that as an option -- e.g., psycopg2). Antho

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Bruno Rocha
Example, I can use joomla to create commercial websites for my clients, also I can use it if I am a hosting provider to offer as a service "create site" tool. But I cant use Joomla to create a : *Bruno's joomla commercial platform* to compete with Joomla. I think if you are going to keep the code

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Bruce Wade
>From your description you are wanting to go with LGPL3. On Thu, Feb 9, 2012 at 1:21 PM, Bruno Rocha wrote: > Example, I can use joomla to create commercial websites for my clients, > also I can use it if I am a hosting provider to offer as a service "create > site" tool. > > But I cant use Joom

[web2py] Odd hasattr(session, 'blah'). Don't understand it.

2012-02-09 Thread Cliff
In an index function I do something like session[request.controller].something = 'foo' This raises a key error exception on the first visit to the controller after restarting the browser. Session can't find the controller name, so I can't add an attribute to it. So I need to initialize the sessi

[web2py] Re: option to move smartgrid buttons to the left side

2012-02-09 Thread peter
Yes, I can not move right on your app. But surely the solution is to find out your css's problem with android rather than move the buttons to the left. There might be other reasons for the having the buttons on the left, but buttons on the right work fine with android if one can move right. Peter

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread R. Strusberg
Bruno, You already wrote it: It is the Movuca License. :-) Ricardo 2012/2/9 Bruno Rocha > > *Movuca goals:* > > *Everybody should be able to use it for free* > - Use it for creating sites, blogs and social networks (free or commercial) > > *Everybody can sell it as a service* > - Use it to off

Re: [web2py] Odd hasattr(session, 'blah'). Don't understand it.

2012-02-09 Thread Bruno Rocha
session is an Storage, Storages always return an attribute, defaults to None. You do not have to always access session objects by keys, you can do it by attribute and it will always return an object, even if the object does not exists. examples my_var = getattr(session, request.controller) Even

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Bruno Rocha
On Thu, Feb 9, 2012 at 7:52 PM, R. Strusberg wrote: > Bruno, > > You already wrote it: It is the Movuca License. :-) Legally, can I use this as a license? it has any matter? or I need to choose an existing license (I dont know how this things works, do I need to register it?) -- Bruno Roch

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Mariano Reingart
For this case, LGPL3 or GPL3 are almost indistinguishable in this context (web app) AFAIK, LGPL3 is better if you want that subparts of Movuca being used/distributed in other contexts (i.e., with other closed source CMS, or with other open source software MIT/BSD licensed) With web2py it is more c

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Anthony
> > Example, I can use joomla to create commercial websites for my clients, > also I can use it if I am a hosting provider to offer as a service "create > site" tool. > > But I cant use Joomla to create a : *Bruno's joomla commercial platform*to > compete with Joomla. > > I think if you are goi

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Mariano Reingart
I bet you'll get better luck in courts if you use a well-known licence. GPL has been written by lawyers and it has some enforcement jurisprudence right now. Mariano Reingart http://www.sistemasagiles.com.ar http://reingart.blogspot.com On Thu, Feb 9, 2012 at 6:56 PM, Bruno Rocha wrote: > > > O

[web2py] Re: maybe minor bug or just documentation

2012-02-09 Thread Anthony
On Thursday, February 9, 2012 1:28:28 PM UTC-5, Lewis wrote: > > Then why did web2py fail with a run time error? Or why wasn't the run > time error trapped? Maybe because I had requires on the same table > for a different constraint? > I assume there must be an explicit "requires" attribute se

[web2py] Customize SQLFORM.grid

2012-02-09 Thread Bruce Wade
Hi, In the old framework I would just query the database and loop through the values manually creating the HTML table etc... Which allows me to do something like this: types = { 'bp': 'Product Bonus', 'sb': 'Sponsor Bonus', } for row in rows: Type types[row.type] Is there a

[web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Cliff
I think it's good for people to advocate for their license preferences. I also think the discussion should be based on facts, so I would like to offer some observations about statements that make me uncomfortable. > The freedom in software also comes the freedom of choice, to either give > back o

Re: [web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Bruce Wade
Making money off the code, meaning you can't go sell the code. With BSD code you can. I said a lot of people, I didn't say MORE people. With BSD there is also a lot of people using it that don't announce they are using the BSD based software. On Thu, Feb 9, 2012 at 2:46 PM, Cliff wrote: > I thi

[web2py] Re: Customize SQLFORM.grid

2012-02-09 Thread Bruce Wade
Never mind figured it out. types = { 'bp': 'Product Bonus', 'sb': 'Sponsor Bonus', } db.cash_journal.transaction_type.represent = lambda transaction_type,row: types[transaction_type] ucashHistoryGrid = SQLFORM.grid( db.cash_journal, paginate=10, deletable=False, edit

[web2py] restricting the options in drop-down menu based on another drop-down menu value

2012-02-09 Thread shartha
Let's say the model has three tables, called country, cities and customers that are defined like: db.define_table('continents', Field('name'), ) db.define_table('countries', Field('name'), Field('continent', db.continents), ) db.define_table('customers', Field('name'), Field('coun

Re: [web2py] restricting the options in drop-down menu based on another drop-down menu value

2012-02-09 Thread Bruce Wade
You have to do this with Javascript http://176.34.12.39/welcome/en/static/js/location.js That is how I am handling the situation where select a continent only the countries for that continent show in the select box. On Thu, Feb 9, 2012 at 4:53 PM, shartha wrote: > Let's say the model has thre

[web2py] Re: [w2py-dev] Re: Movuca - Social CMS beta 0.1

2012-02-09 Thread Anthony
> > I don't know what is meant by "a lot of people." But there are some > statistics that seem to indicate a lot more people prefer the GPL. As > of June 2009, the GPL licenses accounted for ~ 65% usage. BSD > accounted for 6.3. Now I realize that's more than 30 months ago, or > two centur

[web2py] The web2py version

2012-02-09 Thread Bruce Wade
Hi, I know I have been posting a lot of questions in this group, here is why: http://176.34.12.39 The port is about 90% complete now after 1.5 months of work :D Have removed 100s of lines of code in some parts of the application. Let me know what you think so far. The database is just junk data

  1   2   >