[web2py] grid and smartgrid issue

2012-02-07 Thread Manuele Pesenti

Hi,
I've just reported another issue... and I want to ask to the list if you 
agree with it.


http://code.google.com/p/web2py/issues/detail?id=651

essentially I found that the two options for deletion has a different 
behavior. It seams that the function passed to ondelete is never 
performed and the one passed to onvalidation is performed only deleting 
the record from the edit interface, not from the delete button in the grid.


Everything is good for creation and edit records.

Thaks a lot

Cheers

Manuele


[web2py] Re: Database error from constraint violation seemingly ignored

2012-02-07 Thread Mark Kirkwood

Sorry, I was not being all that clear. What I meant to say was:

When I try to delete such a record, instead of the form telling me that 
the delete was prevented it appears to have succeeded. However a refresh 
of the form shows the record survived (and obviously the database log 
tells us why)!


Thanks

Mark

On 08/02/12 20:10, Mark Kirkwood wrote:
I'd like to prevent dogs that have sired other dogs being deleted. 
When I attempt this it looks liek it has worked (i.e one less row in 
the grid), but on refresh I see the alleged deleted row back again.




[web2py] Database error from constraint violation seemingly ignored

2012-02-07 Thread Mark Kirkwood
I'll illustrate with a variant of the dog example schema (see below): I 
have a 'sire_id' field that refers back to the 'dog' table. However I 
have the ondelete attribute set to 'RESTRICT' [1]. I'd like to prevent 
dogs that have sired other dogs being deleted. When I attempt this it 
looks liek it has worked (i.e one less row in the grid), but on refresh 
I see the alleged deleted row back again.


The database log shows:

ERROR:  update or delete on table "dog" violates foreign key constraint 
"dog_sire_id_fkey" on table "dog"

DETAIL:  Key (id)=(1) is still referenced from table "dog".
STATEMENT:  DELETE FROM dog WHERE (dog.id = 1);


Shouldn't the form detect that the delete failed?

regards

Mark

model:
-

db.define_table(
'dog',
Field('owner_id', 'reference person'),
Field('name'),
Field('type'),
Field('sire_id', 'reference dog', ondelete='RESTRICT'),
Field('picture', 'upload', default=''),
format = '%(name)s',
singular = 'Dog',
plural = 'Dogs',
)

db.dog.name.requires = IS_NOT_EMPTY()
db.dog.type.requires = IS_IN_SET(('small', 'medium', 'large'))
db.dog.sire_id.requires = IS_EMPTY_OR(IS_IN_DB(db,'dog.id','%(name)s'))


[1] I'm using postgres here but sqlite will work too if you do:
sqlite> pragma foreign_keys=on;

Controller:
--

def register_dog():
form=SQLFORM.grid(db.dog, csv=False, paginate=5, user_signature=False)
return dict(form=form)




[web2py] Re: Just lost all my data

2012-02-07 Thread pbreit
Hmmm, I would not think that would happen.

Mine just looks like this:

auth = Auth(db)
auth.settings.hmac_key = 'sha512:5669f-51df-5-9e-4'


Possible the get_or_create_key() function is the culprit but I don't know 
why that would happen.


[web2py] Re: a beginner question about queries

2012-02-07 Thread pbreit
I'm not sure that reference is going to work. The reference usually points 
to the "id". So:

db.define_table('customers', 
Field('name'), 
Field('age'), 
format = '%(name)s' 
) 

db.define_table('purchases', 
Field('customer_id', db.customers), 
Field('cart') 
)

Then the query might be:

rows = 
db((db.purchases.id>0)&(db.purchases.customer_id==db.customers.id)).select()

The purchases table would need to look like:
(1, CD) 
(1, DVD)

Web2py automatically makes the first column in all tables an 
auto-incrementing field named "id".


[web2py] Re: 2 Questions regarding auth

2012-02-07 Thread Lewis
Where would I add these?

I am really mystified how the auth() class call receives the method as
its argument from these urls assuming that the user action looks like:

def user()
   return dict(form=auth())

How does this instance of the call to auth() get a method call?

I am really mystified about how one can index the request.args using
parens instead of square braces?

as in:

 {{=T( request.args(0).replace('_',' ').capitalize() )}}

or:

 {{if request.args(0)=='login':}}

Request.args is a storage class "list" so it should be indexed as
request.args[0].

These kinds of syntax inconsistencies are sort of bad.

(Another example occurs with the rows object but that is off-topic.
For now I just want to get this auth stuff working.)

On Jan 31, 10:16 pm, Anthony  wrote:
> On Wednesday, February 1, 2012 12:23:54 AM UTC-5, Lewis wrote:
>
> > Thanks.
>
> > So, would I expand the default form to include buttons to access the
> > other methods?  Not sure how to expose those...
>
> You just have to add links pointing to those URLs (e.g., URL('default',
> 'user', args='change_password')). Note, each of those functions is a method
> of the Auth class, so you can also create a special action for any given
> function by directly calling the method. For example:
>
> def register():
>     return dict(form=auth.register())
>
> Guess I am ok on hashing but should probably look at using the key.
>
> Yes, hmac is recommended and will be more secure.
>
> Anthony


[web2py] Re: Just lost all my data

2012-02-07 Thread Lewis
Correction:  only the auth tables were dropped and recreated and the
one table that had a foreign key to auth.  So, it is linked to the
change to auth.  It looks like that instead of just hashing passwords
with a different key (which would have invalidated all the old
passwords, of course--this is what I thought would happen) the auth
tables had to be rebuilt from scratch.

I still have somewhat cold tingles...

On Feb 7, 9:59 pm, Lewis  wrote:
> I switched auth to using the proper key:
>
> originally:  auth = Auth(jodb)
>
> changed to:  auth = Auth(jodb, hmac_key=Auth.get_or_create_key())
>
> The original worked fine.  But, it seemed that using the hmac_key was
> preferred.  So I changed it.
>
> Now, all the data in all tables is gone.  The auth tables are empty.
> The data tables for the application itself are empty.
>
> ???
>
> There is nothing in sql.log.  The last entry was from a week ago
> indicating successful creation of each table.  Nothing since.
>
> In postgresql in the sql for each table it appears that all the tables
> were dropped and created with new constraints.
>
> for example:
>
> -- Table: joke
>
> -- DROP TABLE joke;
>
> CREATE TABLE joke
> (
>   id serial NOT NULL,
>   joketext text,
>   created_on timestamp without time zone,
>   created_by integer,
>   CONSTRAINT joke_pkey PRIMARY KEY (id ),
>   CONSTRAINT joke_created_by_fkey FOREIGN KEY (created_by)
>       REFERENCES auth_user (id) MATCH SIMPLE
>       ON UPDATE NO ACTION ON DELETE CASCADE
> )
> WITH (
>   OIDS=FALSE
> );
> ALTER TABLE joke
>   OWNER TO postgres;
>
> Wow.  Have you seen DAL do this before?
>
> It was just test data in a test app and I have a version from a week
> ago in csv files, but wow.  That's bad.  I didn't change anything else
> in the model.
>
> Here are the table definitions:
>
> jodb.define_table('joke',
>     Field('joketext', 'text',length=2048, requires = IS_NOT_EMPTY()),
>     Field('created_on', 'datetime', default=request.now),
>     Field('created_by', jodb.auth_user))
>
> jodb.define_table('category',
>     Field('name', 'text', requires = IS_NOT_EMPTY()))
>
> jodb.define_table('joke_category',
>     Field('joke', jodb.joke),
>     Field('category', jodb.category),
>     format = '%(name)s')
>
> Is this "by design"?


[web2py] Just lost all my data

2012-02-07 Thread Lewis
I switched auth to using the proper key:

originally:  auth = Auth(jodb)

changed to:  auth = Auth(jodb, hmac_key=Auth.get_or_create_key())

The original worked fine.  But, it seemed that using the hmac_key was
preferred.  So I changed it.

Now, all the data in all tables is gone.  The auth tables are empty.
The data tables for the application itself are empty.

???

There is nothing in sql.log.  The last entry was from a week ago
indicating successful creation of each table.  Nothing since.

In postgresql in the sql for each table it appears that all the tables
were dropped and created with new constraints.

for example:


-- Table: joke

-- DROP TABLE joke;

CREATE TABLE joke
(
  id serial NOT NULL,
  joketext text,
  created_on timestamp without time zone,
  created_by integer,
  CONSTRAINT joke_pkey PRIMARY KEY (id ),
  CONSTRAINT joke_created_by_fkey FOREIGN KEY (created_by)
  REFERENCES auth_user (id) MATCH SIMPLE
  ON UPDATE NO ACTION ON DELETE CASCADE
)
WITH (
  OIDS=FALSE
);
ALTER TABLE joke
  OWNER TO postgres;

Wow.  Have you seen DAL do this before?

It was just test data in a test app and I have a version from a week
ago in csv files, but wow.  That's bad.  I didn't change anything else
in the model.

Here are the table definitions:

jodb.define_table('joke',
Field('joketext', 'text',length=2048, requires = IS_NOT_EMPTY()),
Field('created_on', 'datetime', default=request.now),
Field('created_by', jodb.auth_user))

jodb.define_table('category',
Field('name', 'text', requires = IS_NOT_EMPTY()))

jodb.define_table('joke_category',
Field('joke', jodb.joke),
Field('category', jodb.category),
format = '%(name)s')

Is this "by design"?


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

2012-02-07 Thread Bruce Wade
Well BSD isn't what you want for your goals. BSD allows anyone to download
and sell your code as if it was their own.

If you take QT for example they had a really strict license that stopped a
lot of people interested in commercial use from using it. However when they
changed their license to LGPL a lot more developers and companies started
to use the sdk.

I don't know much about the MIT, I tend to use more software with the BSD
license when my software will be making lots of money, otherwise I prefer
LGPL.

On Tue, Feb 7, 2012 at 6:26 PM, Tito Garrido  wrote:

> Is it using SEO optimizations? Really nice project!
>
> On Tue, Feb 7, 2012 at 10:15 PM, Bruno Rocha wrote:
>
>> I am trying to understand the COns and Pros between BSD, MIT and LGPL
>>
>> So I will choose one of that by the end of the week when beta will be
>> officially released.
>>
>>
>> On Tue, Feb 7, 2012 at 7:30 PM, Ross Peoples wrote:
>>
>>> I'm not sure how much my opinion matters here, but a lot of times, I am
>>> not allowed to touch GPL code, especially AGPL code for a business project.
>>> The legal department avoids (A)GPL like the plague. There are just too many
>>> gotchas with it, whether real or imaginary. They much prefer I use MIT or
>>> BSD, and have started to come around to LGPL. But there is no way they will
>>> let me use anything more restrictive. Our legal department can't be the
>>> only one in the corporate world that feels the same way.
>>>
>>> So if you want real businesses to touch code, it has to be LGPL or
>>> better (less restrictive). I believe this was one of the reasons web2py is
>>> using LGPL now. But this is your project, and a great one at that! So feel
>>> free to license it however you like, just be aware of the adoption issues.
>>>
>>> --
>>> mail from:GoogleGroups "web2py-developers" mailing list
>>> make speech: web2py-develop...@googlegroups.com
>>> unsubscribe: web2py-developers+unsubscr...@googlegroups.com
>>> details : http://groups.google.com/group/web2py-developers
>>> the project: http://code.google.com/p/web2py/
>>> official : http://www.web2py.com/
>>>
>>
>>
>>
>> --
>>
>> Bruno Rocha
>> [http://rochacbruno.com.br]
>>
>>  --
>> Você recebeu essa mensagem por estar inscrito no grupo
>> web2py-users-brazil.
>> Para enviar uma mensagem ao grupo, envie email a:
>> web2py-users-bra...@googlegroups.com
>> Para se desinscrever, envie email a:
>> web2py-users-brazil+unsubscr...@googlegroups.com
>> Para mais opções, visite o site do grupo em:
>> http://groups.google.com/group/web2py-users-brazil?hl=en
>>
>
>
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___
>



-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


Re: [web2py] deletable = auth.has_permission different for grid and smartgrid?

2012-02-07 Thread Adi

Richard,
Thanks for your for response... 

Since I needed to control the "Delete" button of a "child" table, in my 
sample called item, I used a dict on a parent level and all works fine now. 
My mistake. 

smartgrid
...
deletable = dict(purchase_order=auth.has_membership(group_id="admin"), 
item=auth.has_permission('management')), 

Thanks,
Adnan


[web2py] Re: Workflow engine for web2py

2012-02-07 Thread mart
I think features such as those you already implemented in your bug
tracking app hold some importance here as well Ie. the good use of
groups, permissions & ability to modify things like ownership - as an
example, a corporate accounting department should still have the
ability to  reimburse employee expenses even though the said
employee's accounting contact's position has been terminated (maybe
along with 875 other poor employees that same day)... Doh! did I write
that out loud? ;) oh well, it still holds true, the wf should still be
able to handle any kind of changes like work item ownership and re-
route accordingly (this also serves as an example of a good use of
roles in a wf :) )

here is a example of implementation details of a workflow. Granted,
probably a little too large in scale (especially in light of its new
future), but... the idea is there none the less. I think the doc
should also contain a blurb on how it makes use of databases

http://help.adobe.com/en_US/livecycle/9.0/overview.pdf

** for those who followed the thread on the use of the word
"Enterprise", notice the acronym 'ES' in the product's name.

Mart :)

On Feb 8, 3:07 am, Massimo Di Pierro 
wrote:
> That's a finite state machine. It is nice and simple but too simple.
> Anyway, the problem in using that with web2py (or any other web
> framework) it is not designed to maintain its state using the
> database.
>
> Anyway, it should be possible to modify it so that state and rules are
> stored in the database. Do we expect more from a workflow system? I am
> not sure convinced every workflow I need can be modeled finite state
> machine. I will give this some more thought.
>
> massimo
>
> On Feb 7, 4:25 pm, Richard Vézina  wrote:
>
>
>
>
>
>
>
> > There is no ubuntu official package as far as I can see, so you will have
> > to follow the installation information explain into the tar ball available
> > here :http://www.hforge.org/itools/
>
> > Then :
>
> > from itools.workflow import Workflow
>
> > And the rest is explained in the docs :
>
> >http://www.hforge.org/itools/docs/workflow/
>
> > I think you will pretty much have to build your own logic to make use of
> > workflow for given objects (tables and rows)...
>
> > But there is surely a way that this lib could be included into web2py core
> > so we can make use of workflow utility readily.
>
> > Richard
>
> > 2012/2/7 António Ramos 
>
> > > How to use this in web2py ?
> > > dummies tutorial?
>
> > > 2012/2/7 omicron 
>
> > >> This library is small and easy to use:
> > >>http://www.hforge.org/itools/docs/workflow/


[web2py] Re: using radio widget can't receive the empty submit

2012-02-07 Thread Dan
You are right, if I used an non-empty list to submit, both forms work
fine.
so the widget = SQLFORM.widgets.radio.widget did have different
behavior to the form submission.


On Feb 7, 11:08 pm, DenesL  wrote:
> It will work if you have values inside the IS_IN_SET validators in
> your controller, e.g.
>
> IS_IN_SET([1,2,3,4],multiple='multiple')


[web2py] Re: Workflow engine for web2py

2012-02-07 Thread Massimo Di Pierro
That's a finite state machine. It is nice and simple but too simple.
Anyway, the problem in using that with web2py (or any other web
framework) it is not designed to maintain its state using the
database.

Anyway, it should be possible to modify it so that state and rules are
stored in the database. Do we expect more from a workflow system? I am
not sure convinced every workflow I need can be modeled finite state
machine. I will give this some more thought.

massimo


On Feb 7, 4:25 pm, Richard Vézina  wrote:
> There is no ubuntu official package as far as I can see, so you will have
> to follow the installation information explain into the tar ball available
> here :http://www.hforge.org/itools/
>
> Then :
>
> from itools.workflow import Workflow
>
> And the rest is explained in the docs :
>
> http://www.hforge.org/itools/docs/workflow/
>
> I think you will pretty much have to build your own logic to make use of
> workflow for given objects (tables and rows)...
>
> But there is surely a way that this lib could be included into web2py core
> so we can make use of workflow utility readily.
>
> Richard
>
> 2012/2/7 António Ramos 
>
>
>
>
>
>
>
> > How to use this in web2py ?
> > dummies tutorial?
>
> > 2012/2/7 omicron 
>
> >> This library is small and easy to use:
> >>http://www.hforge.org/itools/docs/workflow/


Re: [web2py] Re: auth registration redirect

2012-02-07 Thread Tito Garrido
Same for me..

On Tue, Jan 31, 2012 at 11:16 AM, Web2Py Freak
wrote:

> i added it to the db.py and its not working and i used this one from
> the book and it didnt work two :
>
> auth.settings.register_next = URL('user', args='profile')   
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___


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

2012-02-07 Thread Tito Garrido
Is it using SEO optimizations? Really nice project!

On Tue, Feb 7, 2012 at 10:15 PM, Bruno Rocha  wrote:

> I am trying to understand the COns and Pros between BSD, MIT and LGPL
>
> So I will choose one of that by the end of the week when beta will be
> officially released.
>
>
> On Tue, Feb 7, 2012 at 7:30 PM, Ross Peoples wrote:
>
>> I'm not sure how much my opinion matters here, but a lot of times, I am
>> not allowed to touch GPL code, especially AGPL code for a business project.
>> The legal department avoids (A)GPL like the plague. There are just too many
>> gotchas with it, whether real or imaginary. They much prefer I use MIT or
>> BSD, and have started to come around to LGPL. But there is no way they will
>> let me use anything more restrictive. Our legal department can't be the
>> only one in the corporate world that feels the same way.
>>
>> So if you want real businesses to touch code, it has to be LGPL or better
>> (less restrictive). I believe this was one of the reasons web2py is using
>> LGPL now. But this is your project, and a great one at that! So feel free
>> to license it however you like, just be aware of the adoption issues.
>>
>> --
>> mail from:GoogleGroups "web2py-developers" mailing list
>> make speech: web2py-develop...@googlegroups.com
>> unsubscribe: web2py-developers+unsubscr...@googlegroups.com
>> details : http://groups.google.com/group/web2py-developers
>> the project: http://code.google.com/p/web2py/
>> official : http://www.web2py.com/
>>
>
>
>
> --
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>  --
> Você recebeu essa mensagem por estar inscrito no grupo web2py-users-brazil.
> Para enviar uma mensagem ao grupo, envie email a:
> web2py-users-bra...@googlegroups.com
> Para se desinscrever, envie email a:
> web2py-users-brazil+unsubscr...@googlegroups.com
> Para mais opções, visite o site do grupo em:
> http://groups.google.com/group/web2py-users-brazil?hl=en
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___


[web2py] Re: is_https

2012-02-07 Thread Ross Peoples
Using nginx, you have to have a line somewhere for "fastcgi_pass". If this 
line isn't:

fastcgi_pass http://127.0.0.1:9000

Then you will have problems. When you connect to web2py through nginx, 
web2py only sees nginx. So if nginx is passing fastcgi to another computer 
on the network, then web2py thinks that the nginx server is the client, on 
another machine, not using SSL.

I have had to deal with this issue myself, but maybe for a different reason 
than you. I have one gateway server that my router passes all port 80 and 
443 traffic to. However, I run several different web servers on different 
computers inside the network, so I use the gateway (running nginx) to proxy 
to the inside servers based on domain name. The inside servers are also 
running nginx, and running web2py locally. Therefore, I am using 
fastcgi_pass http://127.0.0.1:9000 and web2py assumes that you are 
accessing it from the local host, allowing admin. My gateway server also 
handles the SSL connections, as there is no need to SSL from one inside 
server to another.


[web2py] Re: Workflow engine for web2py

2012-02-07 Thread mart
Something to think about if effort is put on this (just a suggestion).
You may want to consider the importance of 'roles' in an implemented
wf engine, since user to role interaction should probably be key in a
wf model (or at least as important as having the ability to move work
items around).

Just my 2 cents,
Mart

On Feb 7, 5:35 pm, Richard Vézina  wrote:
> From what I understand you can do just that, but without reinventing the
> wheel by designing and implementing your own solution.
>
> Richard
>
>
>
>
>
>
>
> On Tue, Feb 7, 2012 at 5:27 PM, Ross Peoples  wrote:
> > I don't know workflow engines in the general sense that well. I once
> > created a full documentation management system where each document couple
> > have a workflow assigned to it. The workflow (predefined, or created
> > on-the-fly) would push the document around from person to person, ensuring
> > that each person completed their step in the time allotted, otherwise an
> > email would get sent to their manager.
>
> > Would a workflow engine allow me to do the same thing, or is this a
> > different type of workflow engine?


[web2py] is_https

2012-02-07 Thread Joerg Poeltl
Hello,

I setup a new server with nginx, ssl and scgi today. The crazy thing
is, that the connection is done per SSL, but the admin interface is
still disabled.
I access.py, but everything seem to be ok.

within request 'HTTP_REFERER': 'https://web2py.domain.com/admin/
default/site' seem to be ok, but is_https is still FALSE.

Any idea, what could be wrong?

Best regards,
Joerg



Re: [web2py] Re: DAL Connection String

2012-02-07 Thread Hugh Barker
Excellent, thanks very much. This solved my issue.

2012/2/8 Niphlod :
> PS : final DAL initiation code is
>
> db = DAL('postgres://hello:p%40ssword@localhost:5432/bbb',
> decode_credentials=True)


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

2012-02-07 Thread Bruno Rocha
I am trying to understand the COns and Pros between BSD, MIT and LGPL

So I will choose one of that by the end of the week when beta will be
officially released.


On Tue, Feb 7, 2012 at 7:30 PM, Ross Peoples  wrote:

> I'm not sure how much my opinion matters here, but a lot of times, I am
> not allowed to touch GPL code, especially AGPL code for a business project.
> The legal department avoids (A)GPL like the plague. There are just too many
> gotchas with it, whether real or imaginary. They much prefer I use MIT or
> BSD, and have started to come around to LGPL. But there is no way they will
> let me use anything more restrictive. Our legal department can't be the
> only one in the corporate world that feels the same way.
>
> So if you want real businesses to touch code, it has to be LGPL or better
> (less restrictive). I believe this was one of the reasons web2py is using
> LGPL now. But this is your project, and a great one at that! So feel free
> to license it however you like, just be aware of the adoption issues.
>
> --
> mail from:GoogleGroups "web2py-developers" mailing list
> make speech: web2py-develop...@googlegroups.com
> unsubscribe: web2py-developers+unsubscr...@googlegroups.com
> details : http://groups.google.com/group/web2py-developers
> the project: http://code.google.com/p/web2py/
> official : http://www.web2py.com/
>



-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] Re: a beginner question about queries

2012-02-07 Thread shartha
I don't understand how represent would be of help. Could you show
that?

On Feb 7, 11:43 am, Richard Vézina 
wrote:
> Why not use represent?
>
> http://web2py.com/books/default/chapter/29/6?search=represent#Record-...
>
> Richard
>
>
>
>
>
>
>
> On Tue, Feb 7, 2012 at 12:37 PM, shartha  wrote:
> > Hello.
>
> > I have this model:
> > db = DAL('sqlite://storage.sqlite')
>
> > db.define_table('customers',
> >    Field('name'),
> >    Field('age'),
> >    format = '%(name)s'
> > )
>
> > db.define_table('purchases',
> >    Field('name',db.customers),
> >    Field('cart')
> > )
>
> > db.purchases.name.requires = IS_IN_DB(db,db.customers,'%(name)s')
>
> > The table customers has these values in it:
> > (Jack,17)
> > (John,23)
>
> > The table purchases has these values in it:
> > (Jack, CD)
> > (John, DVD)
>
> > Now in my controller if I use the following query:
> > query = db(db.purchases.id>0).select
> > return (purchases = query)
>
> > Now if in my view, I loop through purchases to type their name
> > property, e.g. purchases[0].name, the id of the person from the
> > customers table will be returned. What should I use alternatively to
> > get the actual name of the person, e.g. Jack, or John? I don't want to
> > have another query for that.


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

2012-02-07 Thread Ricardo Pedroso
On Tue, Feb 7, 2012 at 8:29 PM, Bruno Rocha  wrote:
> That is exactly what I had in mind, now I dont know if I stay with AGPL or
> change to LGPL..
>
> I chosen AGPL because I saw another related projetct using it
> (http://noosfero.org/Site/About)

Hi Bruno,

I'm completely ignorant about this licence deals, but I saw other projects
having a dual licence model.

Probably you should consider it for your Movuca.

And congrats for Movuca,

Um abraço,
Ricardo


[web2py] One issues (I guess) with auth form login+janrain

2012-02-07 Thread Ricardo Pedroso
I'm evaluatind multiple logins using the normal auth form + janrain in
web2py 1.99.4
It's working almost as I was expecting, but when I do the following steps:

1) login with janrain (in my case using google)
2) I'm sucessfully logged in my app.
I go to /myap/default/user/change_password and cannot change my pass
because I don't have one yet to fill the "old password" field.
3) I got to appadmin and setup a pass for my user
4) I logout and login using my email/pass in auth form. It works
5) Now I logout and login using janrain and my previous password was blanked


I try to debug it and found that in step 5 the pass is being blanked
in gluon/tools.py:

def get_or_create_user(self, keys):
(...)
if user:
print table_user, keys
user.update_record(**table_user._filter_fields(keys))
(...)

I added a print statement and it gives me:

auth_user {'first_name': u'Ricardo',
'last_name': u'Pedroso',
'registration_id': u'https://www.google.com/profiles/',
'password': None,
'registration_key': '',
'email': u'em...@example.com'}

Note that the 'registration_id' and 'email' fields are not the ones I
get, I just edit them to post here.

The field that matters for this case is the 'password': None.

Is where my pass is being blanked, right?
Can this be avoid?
Does it makes sense to popup the password field if it's None from the dict?

A more general question, does it make sense to use auth form+janrain?

The code I'm using that is different from the scaffold app:

models/db.py:

()

auth.define_tables()

from gluon.contrib.login_methods.rpx_account import RPXAccount
from gluon.contrib.login_methods.extended_login_form import ExtendedLoginForm

other_form = RPXAccount(request,
api_key='mykey',
domain='mydomain',
url = "http://localhost:8000/%s/default/user/login"; % request.application)

auth.settings.login_form = ExtendedLoginForm(auth, other_form,
signals=['token'])

(...)

---


Regards,
Ricardo


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

2012-02-07 Thread Ross Peoples
Sorry Mariano, I misspelled your name in my last post :)

To give you a better example of what you might want to do here is a more 
advanced module that makes a static class and better resembles the 
singleton pattern:

class Counter(object):
instance = None

@classmethod
def get(cls):
if cls.instance == None:
cls.instance = Counter()

return cls.instance

def __init__(self, message='Hello World!'):
self.message = message
self.count = 0

def get_count(self):
self.count += 1
return self.count

def get_message(self):
return self.message


Then your controller would look something like this now:

from mymodule import Counter
counter = Counter.get()
count = counter.get_count()

return dict(count=count)

By calling Counter.get() instead of Counter(), we ensure that there is only 
ever once instance of the Counter object, and that the object will last for 
the lifetime of the web2py instance.


Re: [web2py] Re: CSV Import/Export from different tables

2012-02-07 Thread Richard Vézina
Your are welcome!

Richard

On Tue, Feb 7, 2012 at 5:46 PM, Omi Chiba  wrote:

> Thank you, Richard !
> I came up the same idea using excutesql and it's done in a seconds !!
>
> db.executesql('INSERT INTO request (subject, result) SELECT subject,
> result FROM result;')
> * my database is db2
>
> > In your case you need input of user so you need to import from CSV...
> But I
> > don't see why it's that long...
> I think there is nothing we can do to improve the speed. As I
> explained, it will generate the number of statement with the same
> number of rows.
>
> My db2 is located in Japan and takes 1 min per 250 records. If I do
> the same for the MS SQL Server located in my office it's about 5
> seconds per 250 records. For my app, it's always around 10 - 20
> records so I can live with this.
>
>
>
>
>
> On Feb 7, 4:32 pm, Richard Vézina  wrote:
> > I was think of something like this...
> >
> > INSERT INTO dict_table (table_name)
> > SELECT relname
> > FROM pg_class
> > WHERE relnamespace='2200' AND relname LIKE 'test_%' AND relname NOT LIKE
> > '%_id_seq'
> >
> > That could be write in raw SQL or with web2py request syntax
> >
> > In your case you need input of user so you need to import from CSV...
> But I
> > don't see why it's that long...
> >
> > Maybe the way you process your CSV file is in cause...
> >
> > Richard
> >
> >
> >
> >
> >
> >
> >
> > On Tue, Feb 7, 2012 at 5:07 PM, Omi Chiba  wrote:
> > > I think my case is the former. Like Sales support team prepare the
> > > reply for the open request at the end of the day and upload. In the
> > > evening, I have scheduled job on my AS400 do the upgrade from result
> > > to request table with other information.
> >
> > > Insert each rows takes long time compared to update or delete. I think
> > > it's slow because simply it will generate the number of statement with
> > > the same number of rows. (500 rows = 500 insert statements) Can we
> > > simply copy the selected rows to another ? I'm not sure.
> >
> > > On Feb 7, 3:19 pm, Richard Vézina  wrote:
> > > > Do you have to let the user do that copy/paste because they add
> result to
> > > > kind of empty CSV/Excel spreadsheet to feed your system or you only
> want
> > > to
> > > > move data around once?
> >
> > > > In later case you can make a request at DB level or in web2py
> shell...
> >
> > > > Richard
> >
> > > > On Tue, Feb 7, 2012 at 3:48 PM, Omi Chiba 
> wrote:
> > > > > For example, I have two tables, "request" and "result". I want
> user to
> > > > > download all open request (status="1") from "request" table and
> upload
> > > > > with the result to "result" table.
> >
> > > > > What's the easy way to do ?
> >
> > > > > db.define_table('request',
> > > > >Field('subject'),
> > > > >Field('status', default="1"),
> > > > >Field('result))
> >
> > > > > db.define_table('result',
> > > > >Field('subject'),
> > > > >Field('result))
> >
> > > > > Only thing I can think of is...
> >
> > > > > 1. delete result table
> > > > > 2. Select request table with (status="1") and insert them to the
> > > > > result table
> >
> > > > > But I'm on AS400 located in Japan and this additional insert
> process
> > > > > takes too much time for me. The best way is download the selected
> data
> > > > > with the header of result table...
>


[web2py] Re: CSV Import/Export from different tables

2012-02-07 Thread Omi Chiba
Thank you, Richard !
I came up the same idea using excutesql and it's done in a seconds !!

db.executesql('INSERT INTO request (subject, result) SELECT subject,
result FROM result;')
* my database is db2

> In your case you need input of user so you need to import from CSV... But I
> don't see why it's that long...
I think there is nothing we can do to improve the speed. As I
explained, it will generate the number of statement with the same
number of rows.

My db2 is located in Japan and takes 1 min per 250 records. If I do
the same for the MS SQL Server located in my office it's about 5
seconds per 250 records. For my app, it's always around 10 - 20
records so I can live with this.





On Feb 7, 4:32 pm, Richard Vézina  wrote:
> I was think of something like this...
>
> INSERT INTO dict_table (table_name)
> SELECT relname
> FROM pg_class
> WHERE relnamespace='2200' AND relname LIKE 'test_%' AND relname NOT LIKE
> '%_id_seq'
>
> That could be write in raw SQL or with web2py request syntax
>
> In your case you need input of user so you need to import from CSV... But I
> don't see why it's that long...
>
> Maybe the way you process your CSV file is in cause...
>
> Richard
>
>
>
>
>
>
>
> On Tue, Feb 7, 2012 at 5:07 PM, Omi Chiba  wrote:
> > I think my case is the former. Like Sales support team prepare the
> > reply for the open request at the end of the day and upload. In the
> > evening, I have scheduled job on my AS400 do the upgrade from result
> > to request table with other information.
>
> > Insert each rows takes long time compared to update or delete. I think
> > it's slow because simply it will generate the number of statement with
> > the same number of rows. (500 rows = 500 insert statements) Can we
> > simply copy the selected rows to another ? I'm not sure.
>
> > On Feb 7, 3:19 pm, Richard Vézina  wrote:
> > > Do you have to let the user do that copy/paste because they add result to
> > > kind of empty CSV/Excel spreadsheet to feed your system or you only want
> > to
> > > move data around once?
>
> > > In later case you can make a request at DB level or in web2py shell...
>
> > > Richard
>
> > > On Tue, Feb 7, 2012 at 3:48 PM, Omi Chiba  wrote:
> > > > For example, I have two tables, "request" and "result". I want user to
> > > > download all open request (status="1") from "request" table and upload
> > > > with the result to "result" table.
>
> > > > What's the easy way to do ?
>
> > > > db.define_table('request',
> > > >    Field('subject'),
> > > >    Field('status', default="1"),
> > > >    Field('result))
>
> > > > db.define_table('result',
> > > >    Field('subject'),
> > > >    Field('result))
>
> > > > Only thing I can think of is...
>
> > > > 1. delete result table
> > > > 2. Select request table with (status="1") and insert them to the
> > > > result table
>
> > > > But I'm on AS400 located in Japan and this additional insert process
> > > > takes too much time for me. The best way is download the selected data
> > > > with the header of result table...


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

2012-02-07 Thread Ross Peoples
Marino is referring to the method I mentioned earlier of using modules and 
the singleton pattern. You could use this in combination with Michele's 
mmap suggestion to hold the data to do what you want.

I've never used mmap before, but I can get you on the right track with 
modules. This is a very (very) simple example, but it works:

Create a module called "mymodule.py" and put the following line in it:

count = 0

Then in your controller, put the following code in:

import mymodule

count = mymodule.count
mymodule.count += 1

return dict(count=count)

Then in your view, put this somewhere:

{{=count}}

Every time you visit that page, the number will increment. The purpose of 
this is to show you that module (not models) stick around once you import 
them. The only way to update the module (like if you changed some code in 
it) is to restart web2py. So once you import this module, it will continue 
to increment the number. The only way to make it "forget" the number is to 
restart web2py.


Re: [web2py] Workflow engine for web2py

2012-02-07 Thread Richard Vézina
>From what I understand you can do just that, but without reinventing the
wheel by designing and implementing your own solution.

Richard

On Tue, Feb 7, 2012 at 5:27 PM, Ross Peoples  wrote:

> I don't know workflow engines in the general sense that well. I once
> created a full documentation management system where each document couple
> have a workflow assigned to it. The workflow (predefined, or created
> on-the-fly) would push the document around from person to person, ensuring
> that each person completed their step in the time allotted, otherwise an
> email would get sent to their manager.
>
> Would a workflow engine allow me to do the same thing, or is this a
> different type of workflow engine?
>


Re: [web2py] Re: CSV Import/Export from different tables

2012-02-07 Thread Richard Vézina
I was think of something like this...

INSERT INTO dict_table (table_name)
SELECT relname
FROM pg_class
WHERE relnamespace='2200' AND relname LIKE 'test_%' AND relname NOT LIKE
'%_id_seq'

That could be write in raw SQL or with web2py request syntax

In your case you need input of user so you need to import from CSV... But I
don't see why it's that long...

Maybe the way you process your CSV file is in cause...

Richard



On Tue, Feb 7, 2012 at 5:07 PM, Omi Chiba  wrote:

> I think my case is the former. Like Sales support team prepare the
> reply for the open request at the end of the day and upload. In the
> evening, I have scheduled job on my AS400 do the upgrade from result
> to request table with other information.
>
> Insert each rows takes long time compared to update or delete. I think
> it's slow because simply it will generate the number of statement with
> the same number of rows. (500 rows = 500 insert statements) Can we
> simply copy the selected rows to another ? I'm not sure.
>
>
> On Feb 7, 3:19 pm, Richard Vézina  wrote:
> > Do you have to let the user do that copy/paste because they add result to
> > kind of empty CSV/Excel spreadsheet to feed your system or you only want
> to
> > move data around once?
> >
> > In later case you can make a request at DB level or in web2py shell...
> >
> > Richard
> >
> >
> >
> >
> >
> >
> >
> > On Tue, Feb 7, 2012 at 3:48 PM, Omi Chiba  wrote:
> > > For example, I have two tables, "request" and "result". I want user to
> > > download all open request (status="1") from "request" table and upload
> > > with the result to "result" table.
> >
> > > What's the easy way to do ?
> >
> > > db.define_table('request',
> > >Field('subject'),
> > >Field('status', default="1"),
> > >Field('result))
> >
> > > db.define_table('result',
> > >Field('subject'),
> > >Field('result))
> >
> > > Only thing I can think of is...
> >
> > > 1. delete result table
> > > 2. Select request table with (status="1") and insert them to the
> > > result table
> >
> > > But I'm on AS400 located in Japan and this additional insert process
> > > takes too much time for me. The best way is download the selected data
> > > with the header of result table...
>


Re: [web2py] web2py long term projects: experiences ?

2012-02-07 Thread Sebastian E. Ovide
Thanks for that Martin, appreciated.

I've read your slides: They are very clear !


On Tue, Feb 7, 2012 at 11:35 AM, Martín Mulone wrote:

> I can tell my experience, I'm working for 2 years with web2py or more I
> think. I work in different projects, one I currently developing I think is
> quite big, work with millons of records, and is very complex and has many
> lines of code and many tables, is an internal application for a national
> company.
>

how many full time dev are working in this team ?

thanks again


Sebastian E. Ovide


Re: [web2py] default layout.html error (or just me)

2012-02-07 Thread Ross Peoples
Glad you figured it out!

Re: [web2py] Workflow engine for web2py

2012-02-07 Thread Ross Peoples
I don't know workflow engines in the general sense that well. I once 
created a full documentation management system where each document couple 
have a workflow assigned to it. The workflow (predefined, or created 
on-the-fly) would push the document around from person to person, ensuring 
that each person completed their step in the time allotted, otherwise an 
email would get sent to their manager.

Would a workflow engine allow me to do the same thing, or is this a 
different type of workflow engine? 


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

2012-02-07 Thread Sebastian E. Ovide
Hi Mariano,

what do you mean by permanently importing the data in a module ?

As far as I know, every request will reload ALL the models and module
again... and again... and again

in the mean time I'm reading about mmap as suggested by Michele... even is
it looks like (I have not studied it yet) it still uses the FS... What I'm
trying to do is to save the LOADING "model + modules" time of every
request... (not sure if WSGI has some limitations here...)

thanks

On Tue, Feb 7, 2012 at 11:03 AM, Mariano Reingart wrote:

> You can use a multi-threaded webserver,  permanently importing the data in
> a module.




-- 
Sebastian E. Ovide


Re: [web2py] Workflow engine for web2py

2012-02-07 Thread Richard Vézina
There is no ubuntu official package as far as I can see, so you will have
to follow the installation information explain into the tar ball available
here : http://www.hforge.org/itools/

Then :

from itools.workflow import Workflow

And the rest is explained in the docs :

http://www.hforge.org/itools/docs/workflow/

I think you will pretty much have to build your own logic to make use of
workflow for given objects (tables and rows)...

But there is surely a way that this lib could be included into web2py core
so we can make use of workflow utility readily.

Richard


2012/2/7 António Ramos 

> How to use this in web2py ?
> dummies tutorial?
>
> 2012/2/7 omicron 
>
>> This library is small and easy to use:
>> http://www.hforge.org/itools/docs/workflow/
>
>
>


Re: [web2py] default layout.html error (or just me)

2012-02-07 Thread Andreas Christoffersen
I was missing a paranthesis... sorry for the confusion - and thanks for the
help... Sometimes taking a walk and comming back to the editor is the best
way to handle errors.

I had:
{{=LI(A(image.title, _href=URL("show", args=image.id))}}$
but should have had:
{{=LI(A(image.title, _href=URL("show", args=image.id)))}}$

Sorry again.


On Tue, Feb 7, 2012 at 8:36 PM, Bruno Rocha  wrote:

> you are missing {{ or }} somewhere in view
>
>
> On Tue, Feb 7, 2012 at 5:26 PM, Andreas Christoffersen <
> achristoffer...@gmail.com> wrote:
>
>>
>> Hi group,
>>
>>
>> I am trying to build the simple image blog from the web2py book chapter 3. 
>> As far as I can see I have reentered the example code to the letter - but 
>> still I get an error (which I think stems from layout.html?) (using latest 
>> web2py on mac)
>>
>>
>>
>> Traceback (most recent call last):
>>
>>
>>
>>
>>
>>   File "gluon/restricted.py", line 203, in restricted
>>
>>
>>
>>
>>
>>   File "gluon/restricted.py", line 189, in compile2
>>
>>
>>
>>
>>
>>   File 
>> "/Users/andreas/web2py/web2py.app/Contents/Resources/applications/images/views/default/index.html",
>>  line 79
>>
>>
>>
>>
>>
>> response.write('\n  ', escape=False)
>>
>>
>>
>>
>>
>>^
>> SyntaxError: invalid syntax
>>
>>
>>
>> TiA.
>>
>>
>> Andreas
>>
>>
>
>
> --
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>


[web2py] Re: CSV Import/Export from different tables

2012-02-07 Thread Omi Chiba
I think my case is the former. Like Sales support team prepare the
reply for the open request at the end of the day and upload. In the
evening, I have scheduled job on my AS400 do the upgrade from result
to request table with other information.

Insert each rows takes long time compared to update or delete. I think
it's slow because simply it will generate the number of statement with
the same number of rows. (500 rows = 500 insert statements) Can we
simply copy the selected rows to another ? I'm not sure.


On Feb 7, 3:19 pm, Richard Vézina  wrote:
> Do you have to let the user do that copy/paste because they add result to
> kind of empty CSV/Excel spreadsheet to feed your system or you only want to
> move data around once?
>
> In later case you can make a request at DB level or in web2py shell...
>
> Richard
>
>
>
>
>
>
>
> On Tue, Feb 7, 2012 at 3:48 PM, Omi Chiba  wrote:
> > For example, I have two tables, "request" and "result". I want user to
> > download all open request (status="1") from "request" table and upload
> > with the result to "result" table.
>
> > What's the easy way to do ?
>
> > db.define_table('request',
> >    Field('subject'),
> >    Field('status', default="1"),
> >    Field('result))
>
> > db.define_table('result',
> >    Field('subject'),
> >    Field('result))
>
> > Only thing I can think of is...
>
> > 1. delete result table
> > 2. Select request table with (status="1") and insert them to the
> > result table
>
> > But I'm on AS400 located in Japan and this additional insert process
> > takes too much time for me. The best way is download the selected data
> > with the header of result table...


Re: [web2py] Workflow engine for web2py

2012-02-07 Thread António Ramos
How to use this in web2py ?
dummies tutorial?

2012/2/7 omicron 

> This library is small and easy to use:
> http://www.hforge.org/itools/docs/workflow/


[web2py] Re: How to make an index table look like SQLFORM.grid?

2012-02-07 Thread Cliff
solved!

TD(blah, _style='text-align:right;')



On Feb 7, 2:06 pm, Cliff  wrote:
> How can I get the buttons to stick to the right side of my index
> table?
>
> My code looks something like this, after a couple of hours of reverse
> engineering.
>
> query = db.tbl.blah
> rows = db(query).select(db.tbl.id, db.tbl.f1, db.tbl.f2)
> thead = THEAD(TR(TH('Col1'), TH('Col2'), TH()))
> tbody = []
> for row in rows:
>   link = A('some action', URL('a_function, args=row.id),
> _class='button')
>   tbody.append(
>     TR(row.f1, row.f2, TD(link, _class='row_buttons'))
>     )
> table = TABLE(thead, tbody)
> div = DIV(table, _class='web2py_table')
> return div
>
> In the resulting table, the TD with the buttons slides to the right,
> just after the last data column.
>
> What am I missing?


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

2012-02-07 Thread Ross Peoples
I'm not sure how much my opinion matters here, but a lot of times, I am not 
allowed to touch GPL code, especially AGPL code for a business project. The 
legal department avoids (A)GPL like the plague. There are just too many 
gotchas with it, whether real or imaginary. They much prefer I use MIT or 
BSD, and have started to come around to LGPL. But there is no way they will 
let me use anything more restrictive. Our legal department can't be the 
only one in the corporate world that feels the same way.

So if you want real businesses to touch code, it has to be LGPL or better 
(less restrictive). I believe this was one of the reasons web2py is using 
LGPL now. But this is your project, and a great one at that! So feel free 
to license it however you like, just be aware of the adoption issues.


Re: [web2py] deletable = auth.has_permission different for grid and smartgrid?

2012-02-07 Thread Richard Vézina
I don't think there should be difference about that... Smartgrid supposed
to be much the same as grid except that it follow link between tables
referenced by the shown table...

Would show more code to help list member to better help you?

Richard

On Tue, Feb 7, 2012 at 4:02 PM, Adi  wrote:

>
> I have following code in grid and smartgrid:
>
> deletable = auth.has_permission('management'),
>
> The button Delete shows in grid, but not in smartgrid. Is there a
> difference between the two, or I should dig deeper in possible permissions
> messup?
>
> Thanks,
> ADnan
>


Re: [web2py] CSV Import/Export from different tables

2012-02-07 Thread Richard Vézina
Do you have to let the user do that copy/paste because they add result to
kind of empty CSV/Excel spreadsheet to feed your system or you only want to
move data around once?

In later case you can make a request at DB level or in web2py shell...

Richard

On Tue, Feb 7, 2012 at 3:48 PM, Omi Chiba  wrote:

> For example, I have two tables, "request" and "result". I want user to
> download all open request (status="1") from "request" table and upload
> with the result to "result" table.
>
> What's the easy way to do ?
>
> db.define_table('request',
>Field('subject'),
>Field('status', default="1"),
>Field('result))
>
> db.define_table('result',
>Field('subject'),
>Field('result))
>
>
> Only thing I can think of is...
>
> 1. delete result table
> 2. Select request table with (status="1") and insert them to the
> result table
>
> But I'm on AS400 located in Japan and this additional insert process
> takes too much time for me. The best way is download the selected data
> with the header of result table...
>
>


[web2py] deletable = auth.has_permission different for grid and smartgrid?

2012-02-07 Thread Adi

I have following code in grid and smartgrid: 

deletable = auth.has_permission('management'),

The button Delete shows in grid, but not in smartgrid. Is there a 
difference between the two, or I should dig deeper in possible permissions 
messup? 

Thanks,
ADnan


[web2py] CSV Import/Export from different tables

2012-02-07 Thread Omi Chiba
For example, I have two tables, "request" and "result". I want user to
download all open request (status="1") from "request" table and upload
with the result to "result" table.

What's the easy way to do ?

db.define_table('request',
Field('subject'),
Field('status', default="1"),
Field('result))

db.define_table('result',
Field('subject'),
Field('result))


Only thing I can think of is...

1. delete result table
2. Select request table with (status="1") and insert them to the
result table

But I'm on AS400 located in Japan and this additional insert process
takes too much time for me. The best way is download the selected data
with the header of result table...



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

2012-02-07 Thread Anthony

>
> Bruno's work is given for free, and if you don't share your changes back, 
> keep it secret behind the server, it doesn't help the Movuca project. So 
> for Bruno the GPL or even AGPL is a good option, as it keeps the code free 
> (as in freedom).
>

Under a more permissive license, a smaller percentage of users will 
contribute changes back to the project, but you will likely get a lot more 
users overall, so you may still get a lot of contributions. With a strong 
copyleft license, like AGPL, everyone contributes changes back, but the 
user base will likely be much smaller. If the goal is getting more 
contributions back to the project, it's not clear which approach will 
prevail.
 

> CMS is very different to a framework like web2py, which is only a base for 
> application development and could be seen as similar to a system library. 
> CMS is an application itself.


In most cases, users would not be deploying Movuca completely unmodified, 
and even if they did, the whole point of the AGPL/GPL license would be 
moot, as there would be no modifications to release. The license issues 
arise exactly in the context of modifying the system.

Also, I don't see any contradiction between GPL or AGPL and "commercial 
> intentions". Your client is paying for a customised solution and is getting 
> one no matter if the license is LGPL, GPL or AGPL.


Under the AGPL, your client is indeed getting a custom solution -- but then 
your client is required to give away that custom solution to their 
competitors for free. Not many commercial enterprises will want to pay for 
the development of a custom solution that they must then give away to the 
public for free.
 

> The only difference here is for Bruno and the community of people working 
> with him on the CMS. They might ask for the source code and benefit from 
> changes made by others. 


Someone might integrate Movuca with their own custom functionality that is 
specifically related to their business, which might not necessarily even be 
of interest to Movuca. Even in that case, though, they would be required to 
release their proprietary code to the public under AGPL.
 

> GPL will prevent anyone from making a proprietary system that includes 
> your code (LGPL allows that). However, it would be still possible to do it 
> without code distribution, for example in a software as service model. Only 
> AGPL will prevent that, as it requires to make the source available 
> whenever the code is deployed on a server.
>

Yes, GPL is probably at least tolerable in many situations, but AGPL is 
likely a deal breaker for most commercial applications.

Anthony

 


[web2py] Re: web2py performance

2012-02-07 Thread VP
Did you remove the line in layout.html that links to an external
FaceBook service?   Things like this take time.



On Feb 7, 1:24 am, LightOfMooN  wrote:
> Hi
> Just download web2py, run it and go to edit welcome app.
>
> in db.py:
> db.define_table('mytable',Field('myfield','string'))
>
> in controllers/default.py:
> def index():
>     if request.vars.add_rows:
>         for i in xrange(10):
>             db.mytable.insert(myfield='')
>     rows = db(db.mytable.id>0).select()
>     response.flash = "Welcome to web2py!"
>     return dict()
>
> in controllers/index.html:
> {{extend 'layout.html'}}
> 
>     
> 
>
> Let's test it.
> Click on "add_rows" button to insert 10 rows in database.
> Then reload page.
> There are just one query, that gets us one set of 100k rows.
> Time to process query is less than 100ms, but page loads 5-6s!
> Nothing passed to the view.
>
> So, my question is:
>
> Is web2py can be used in production for big sites, or just for small-
> home-sites?
> thx


Re: [web2py] Re: Some very basic, but important questions.

2012-02-07 Thread Mariano Reingart
On Tue, Feb 7, 2012 at 4:50 PM, amiroff  wrote:
>
> Thanks Mariano for answers,
>
> On Feb 7, 2:11 pm, Mariano Reingart  wrote:
> >
> > You can have your shared settings in a common python module, and then
> > import it in your model:
> >
> > from shared_settings import DB_URI
> > db=DAL(DBURI)
>
> This is obvious, what I was looking for was a web2py way of doing
> this, ie without imports, using autoload or exec. Isn't a constant
> defined in one of my apps' models available to other apps' models
> thanks to auto execution of models?

No, it isn't. Again, this may be a confusion on terminology.
Having available other app constants/models may be a bad idea
(consider DBURI, it should be unique per app or your tables will
overlap).
Remember, apps are "projects" in web2py. "django apps" are more
similar to "web2py plugins".
web2py let you have several apps in the same site, but they are
separate entities.

You can see the official book for a more deep explanation:

http://www.web2py.com/books/default/chapter/29/12#Component-plugins

Sorry if I'm not clear enough, English is not one of my best skills,
fell free to provide and example and we can analyse it.

>
> > There is not direct support for shared views now, mainly because I think
> > you may be confused about terminology.
> > web2py "applications" are the similar to django "projects", so it would be
> > not required to share views across applications in web2py.
> >
> > Anyway, a more flexible view rendering system should be possible
> > (response.render already receives the template filename, extending this to
> > include a path should not be a major issue, see compileapp.run_view_in)
>
> I'm sure Massimo will take on this one because I've counted many other
> users requesting or asking for project-wide layouts/views. So for now,
> I guess it's not ready yet.
>

Again, maybe you mean site-wide layouts/views.
Project wide layouts are currently available (they are the views in an app).
For example, using the layout plugin you can change the layout of the
entire app:

http://web2py.com/layouts

And yes, site-wide layouts would be helpful but they are not available
yet, I'll write down this in my TODO list ;-)

>
> >
> > > 3. What is the best way to create something like front controller? It
> > > should include common functions for all other controllers in all apps.
> >
> > According the "wikipedia" definition of  front controllers, web2py
> > models/controllers implement that pattern, as they "provides a centralized
> > entry point for handling requests"
> > You can put common application-wide functions in the models, and specific
> > function in the controllers, including caching, redirecting, security, etc.
>
> Umm, no. I am not talking about common app-wide setting, what I meant
> was project wide common controller functions, like requiring login on
> all (but some) controllers. It would consolidate all request handling
> by channeling requests through a single handler which in turn would
> carry out common behavior, which can be modified at runtime.
>

Again, project == app in web2py, so you can implement project wide
functions just putting it in a controller or model, see the following
example to change CRUD settings based on the function called:

http://code.google.com/p/web2conf/source/browse/controllers/activity.py#6

For example, if you want that all the functions in a controller to
require a valid login, just write at the beginning of your controller:

if not auth.is_logged_in():
    raise HTTP(403,"Not authorized")

You also can use routes.py to have a single entry point and then
dispatch each request as you like.

Maybe if you have an example, we could translate it to web2py.

>
> >
> > > 4. What are the alternatives to scopes (Rails) or custom model
> > > managers (Django) and model callbacks/observers (Rails) or signals
> > > (Django)?
> >
> > I do not remember any, but there are some discussions on the developer list
> > to implement some features like signals for data updates.
> > Also, there are some workaround depending in your needs.
>
> These are very essential, I am sure there must be some undocumented
> features for this.

There are some hooks like oncreate/onupdate/ondelete for forms,
update/compute properties for fields, etc.

There may be other methods too, but I'm not aware of them.

> >
> > > 5. What is the best place to define view helpers and how to pass them
> > > to views?
> >
> > View helpers aren't mandatory in web2py (as a python template language is
> > used).
> > But, if you want to have functions to use in the views, you can put then in
> > the models or in modules.
>
> Well, putting view logic in models is a no-no but helper modules would
> be of use. Thanks for the tip!

In the model, you can use represent & widget field properties to do
some basic formatting, like the one done in other frameworks class
model methods.
web2py also comes with handy functions like prettydate in gluon.tools,
but you can define your helpers

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

2012-02-07 Thread Bruno Rocha
That is exactly what I had in mind, now I dont know if I stay with AGPL or
change to LGPL..

I chosen AGPL because I saw another related projetct using it (
http://noosfero.org/Site/About)

On Tue, Feb 7, 2012 at 5:59 PM, Wikus van de Merwe <
dupakrop...@googlemail.com> wrote:

> Bruno's work is given for free, and if you don't share your changes back,
> keep it secret behind the server, it doesn't help the Movuca project. So
> for Bruno the GPL or even AGPL is a good option, as it keeps the code free
> (as in freedom).
>
> CMS is very different to a framework like web2py, which is only a base for
> application development and could be seen as similar to a system library.
> CMS is an application itself. It's not a component used to build bigger
> projects. The FSF discourage use of LGPL in such cases, because they goal
> is to spread and increase adoption of the free software. So they favor a
> scenario in which your software is released under the GPL, as all work
> derived from it would have to become free software too (which is not the
> case for LGPL).
>
> Also, I don't see any contradiction between GPL or AGPL and "commercial
> intentions". Your client is paying for a customised solution and is getting
> one no matter if the license is LGPL, GPL or AGPL. The only difference here
> is for Bruno and the community of people working with him on the CMS. They
> might ask for the source code and benefit from changes made by others. The
> same way as those others benefited in the first place from Bruno's CMS as
> they didn't have to write it from scratch. It's a win win situation. Where
> do you guys see problems with adoption and commercial use?
>
> GPL will prevent anyone from making a proprietary system that includes
> your code (LGPL allows that). However, it would be still possible to do it
> without code distribution, for example in a software as service model. Only
> AGPL will prevent that, as it requires to make the source available
> whenever the code is deployed on a server.
>
>


-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] Re: 1.99.4 Active Directory LDAP Issue

2012-02-07 Thread Omi Chiba
It's known issue and fixed version is in trunk.

http://code.google.com/p/web2py/issues/detail?id=565&can=1&q=ldap

On Feb 7, 12:53 pm, Ialejandro  wrote:
> Hi!! I have a lot of apps running with Windows LDAP and web2py (1.8)
> and everything works just fine. Now I'm trying to build an app from
> scratch using the same auth method with web2py 1.99.4. But it doesn't
> work. When I try to log in (after typing pass and username) I get a
> ticket this is what it says:
>
> Traceback (most recent call last):
>   File "C:\web2py\web2py\gluon\restricted.py", line 204, in restricted
>     exec ccode in environment
>   File "C:/web2py/web2py/applications/fivrgen/controllers/default.py",
> line 61, in 
>   File "C:\web2py\web2py\gluon\globals.py", line 172, in 
>     self._caller = lambda f: f()
>   File "C:/web2py/web2py/applications/fivrgen/controllers/default.py",
> line 22, in user
>     return dict(form=auth())
>   File "C:\web2py\web2py\gluon\tools.py", line 1141, in __call__
>     return getattr(self,args[0])()
>   File "C:\web2py\web2py\gluon\tools.py", line 1744, in login
>     request.vars[passfield]):
>   File "C:\web2py\web2py\gluon\contrib\login_methods\ldap_auth.py",
> line 92, in ldap_auth_aux
>     if not isinstance(result, dict):
> UnboundLocalError: local variable 'result' referenced before
> assignment
>
> And this is how my code looks:
>
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
> auth.settings.login_methods.append(ldap_auth(mode='ad',
>    server='myworkingserver',
>    base_dn='ou=xx,dc=xx,dc=xx,dc=xx,dc=xx'))
>
> auth.settings.actions_disabled=['register','change_password','request_reset 
> _password','retrieve_username','profile']
>
> ## create all tables needed by auth if not custom tables
> auth.define_tables(username = True)
>
> Am I doing something wrong??


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

2012-02-07 Thread Wikus van de Merwe
Bruno's work is given for free, and if you don't share your changes back, 
keep it secret behind the server, it doesn't help the Movuca project. So 
for Bruno the GPL or even AGPL is a good option, as it keeps the code free 
(as in freedom).

CMS is very different to a framework like web2py, which is only a base for 
application development and could be seen as similar to a system library. 
CMS is an application itself. It's not a component used to build bigger 
projects. The FSF discourage use of LGPL in such cases, because they goal 
is to spread and increase adoption of the free software. So they favor a 
scenario in which your software is released under the GPL, as all work 
derived from it would have to become free software too (which is not the 
case for LGPL).

Also, I don't see any contradiction between GPL or AGPL and "commercial 
intentions". Your client is paying for a customised solution and is getting 
one no matter if the license is LGPL, GPL or AGPL. The only difference here 
is for Bruno and the community of people working with him on the CMS. They 
might ask for the source code and benefit from changes made by others. The 
same way as those others benefited in the first place from Bruno's CMS as 
they didn't have to write it from scratch. It's a win win situation. Where 
do you guys see problems with adoption and commercial use?

GPL will prevent anyone from making a proprietary system that includes your 
code (LGPL allows that). However, it would be still possible to do it 
without code distribution, for example in a software as service model. Only 
AGPL will prevent that, as it requires to make the source available 
whenever the code is deployed on a server.



[web2py] Re: Some very basic, but important questions.

2012-02-07 Thread amiroff
Thanks Mariano for answers,

On Feb 7, 2:11 pm, Mariano Reingart  wrote:
>
> You can have your shared settings in a common python module, and then
> import it in your model:
>
> from shared_settings import DB_URI
> db=DAL(DBURI)

This is obvious, what I was looking for was a web2py way of doing
this, ie without imports, using autoload or exec. Isn't a constant
defined in one of my apps' models available to other apps' models
thanks to auto execution of models?

> There is not direct support for shared views now, mainly because I think
> you may be confused about terminology.
> web2py "applications" are the similar to django "projects", so it would be
> not required to share views across applications in web2py.
>
> Anyway, a more flexible view rendering system should be possible
> (response.render already receives the template filename, extending this to
> include a path should not be a major issue, see compileapp.run_view_in)

I'm sure Massimo will take on this one because I've counted many other
users requesting or asking for project-wide layouts/views. So for now,
I guess it's not ready yet.

>
> > 3. What is the best way to create something like front controller? It
> > should include common functions for all other controllers in all apps.
>
> According the "wikipedia" definition of  front controllers, web2py
> models/controllers implement that pattern, as they "provides a centralized
> entry point for handling requests"
> You can put common application-wide functions in the models, and specific
> function in the controllers, including caching, redirecting, security, etc.

Umm, no. I am not talking about common app-wide setting, what I meant
was project wide common controller functions, like requiring login on
all (but some) controllers. It would consolidate all request handling
by channeling requests through a single handler which in turn would
carry out common behavior, which can be modified at runtime.

>
> > 4. What are the alternatives to scopes (Rails) or custom model
> > managers (Django) and model callbacks/observers (Rails) or signals
> > (Django)?
>
> I do not remember any, but there are some discussions on the developer list
> to implement some features like signals for data updates.
> Also, there are some workaround depending in your needs.

These are very essential, I am sure there must be some undocumented
features for this.

>
> > 5. What is the best place to define view helpers and how to pass them
> > to views?
>
> View helpers aren't mandatory in web2py (as a python template language is
> used).
> But, if you want to have functions to use in the views, you can put then in
> the models or in modules.

Well, putting view logic in models is a no-no but helper modules would
be of use. Thanks for the tip!

>
> > And last, is Py3k compatible version under works or planned?
>
> Yes, there are two py3k "unnoficial" versions under development:
>
> a proof of concept running under python 
> 3.2:http://code.google.com/r/reingart-web2py/source/browse/?name=py3k
>
> a manual attempt to make a python 3 alternative 
> codebase:https://github.com/cannatag/web2py-python3

Great to hear that, keep it up please.

Cheers,
Metin.


[web2py] Re: Set username as default

2012-02-07 Thread Omi Chiba
Thank you both !!
It works perfectly.

On Feb 7, 1:36 pm, Massimo Di Pierro 
wrote:
> db.IQWAGFTY.TYUUSR.default=dba.auth_user(auth.user_id).username.upper()
>
> On Feb 7, 1:31 pm, Omi Chiba  wrote:
>
>
>
>
>
>
>
> > I want to set username (Not id) to table when the record is created
> > using "import_from_csv_file".
> > The following model cause error because when you open the website
> > auth.user_id is None.
>
> > Can we set if statement says auth.user_id !=none,
> > dba.auth_user(auth.user_id).username.upper() else "" ?
>
> > Model
> > ---
> > db.define_table('IQWAGFTY',
> >     Field('TYPRCD', length=15),
> >     Field('TYUUSR', length=128,
> > default=dba.auth_user(auth.user_id).username.upper()),
> >     Field('TYUDAT', 'datetime', default=request.now),
> >     primarykey=['TYPRCD'])
>
> > I added the following after the table definition but strangely,
> > "import_from_csv_file" doesn't pick up the default value if it's
> > defined after define_table.
>
> > if (auth.user_id != None):
>
> > db.IQWAGFTY.default=dba.auth_user(auth.user_id).username.upper()


[web2py] Re: Set username as default

2012-02-07 Thread Massimo Di Pierro
db.IQWAGFTY.TYUUSR.default=dba.auth_user(auth.user_id).username.upper()





On Feb 7, 1:31 pm, Omi Chiba  wrote:
> I want to set username (Not id) to table when the record is created
> using "import_from_csv_file".
> The following model cause error because when you open the website
> auth.user_id is None.
>
> Can we set if statement says auth.user_id !=none,
> dba.auth_user(auth.user_id).username.upper() else "" ?
>
> Model
> ---
> db.define_table('IQWAGFTY',
>     Field('TYPRCD', length=15),
>     Field('TYUUSR', length=128,
> default=dba.auth_user(auth.user_id).username.upper()),
>     Field('TYUDAT', 'datetime', default=request.now),
>     primarykey=['TYPRCD'])
>
> I added the following after the table definition but strangely,
> "import_from_csv_file" doesn't pick up the default value if it's
> defined after define_table.
>
> if (auth.user_id != None):
>
> db.IQWAGFTY.default=dba.auth_user(auth.user_id).username.upper()


Re: [web2py] default layout.html error (or just me)

2012-02-07 Thread Bruno Rocha
you are missing {{ or }} somewhere in view

On Tue, Feb 7, 2012 at 5:26 PM, Andreas Christoffersen <
achristoffer...@gmail.com> wrote:

>
> Hi group,
>
>
> I am trying to build the simple image blog from the web2py book chapter 3. As 
> far as I can see I have reentered the example code to the letter - but still 
> I get an error (which I think stems from layout.html?) (using latest web2py 
> on mac)
>
>
>
> Traceback (most recent call last):
>
>
>
>   File "gluon/restricted.py", line 203, in restricted
>
>
>
>   File "gluon/restricted.py", line 189, in compile2
>
>
>
>   File 
> "/Users/andreas/web2py/web2py.app/Contents/Resources/applications/images/views/default/index.html",
>  line 79
>
>
>
> response.write('\n  ', escape=False)
>
>
>
>^
> SyntaxError: invalid syntax
>
>
>
> TiA.
>
>
> Andreas
>
>


-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] Re: Set username as default

2012-02-07 Thread Ross Peoples
I usually do this:

default = auth.user.username.upper() if auth.user else None


[web2py] Re: default layout.html error (or just me)

2012-02-07 Thread Ross Peoples
Sorry, I meant views/default/index.html, not controllers/default/index.html.

[web2py] Re: default layout.html error (or just me)

2012-02-07 Thread Ross Peoples
Can you paste the code in your controllers/default/index.html? Also, you 
should be able to scroll down near the bottom of the ticket to see the line 
of code in the view that triggers the issue.

[web2py] Set username as default

2012-02-07 Thread Omi Chiba
I want to set username (Not id) to table when the record is created
using "import_from_csv_file".
The following model cause error because when you open the website
auth.user_id is None.

Can we set if statement says auth.user_id !=none,
dba.auth_user(auth.user_id).username.upper() else "" ?

Model
---
db.define_table('IQWAGFTY',
Field('TYPRCD', length=15),
Field('TYUUSR', length=128,
default=dba.auth_user(auth.user_id).username.upper()),
Field('TYUDAT', 'datetime', default=request.now),
primarykey=['TYPRCD'])

I added the following after the table definition but strangely,
"import_from_csv_file" doesn't pick up the default value if it's
defined after define_table.

if (auth.user_id != None):
 
db.IQWAGFTY.default=dba.auth_user(auth.user_id).username.upper()







[web2py] default layout.html error (or just me)

2012-02-07 Thread Andreas Christoffersen
Hi group,


I am trying to build the simple image blog from the web2py book
chapter 3. As far as I can see I have reentered the example code to
the letter - but still I get an error (which I think stems from
layout.html?) (using latest web2py on mac)



Traceback (most recent call last):

  File "gluon/restricted.py", line 203, in restricted

  File "gluon/restricted.py", line 189, in compile2

  File 
"/Users/andreas/web2py/web2py.app/Contents/Resources/applications/images/views/default/index.html",
line 79

response.write('\n  ', escape=False)

   ^
SyntaxError: invalid syntax



TiA.


Andreas


[web2py] Re: Postgres: what am i doing wrong ?

2012-02-07 Thread Cliff
What is the problem in your app?

Do you have the same problem if you use SQLite?

On Feb 7, 12:26 pm, Anthony  wrote:
> > Just tried it -> same results.
> > FYI, I'm only using the interactive python shell to illustrate the
> > problem I face I my app...
>
> When you use the -M option to load your models, are you then still doing
> this in your shell session:
>
> >>> db = DAL('postgres://postgres:@localhost/courier')
>
> If so, don't -- the db object will already be defined when your db.py file
> is executed, and the above will end up overwriting it (and therefore losing
> all of its table definitions from db.py). Just do:
>
> python web2py.py -S courier -M -N
>
> >>> db.tables
>
> (Note the -N option -- that prevents cron from starting.)
>
> If you're using the DAL outside of a web2py app, then you'll still need to
> create model definitions (i.e., with db.define_table) in your code -- the
> DAL doesn't know what tables and fields are in your db unless you tell it
> by defining the models. However, if you have already defined the models in
> an app somewhere, you might be able to make use of
> auto_import:http://web2py.com/books/default/chapter/29/6#Using-DAL-without-define
>
> Anthony


[web2py] How to make an index table look like SQLFORM.grid?

2012-02-07 Thread Cliff
How can I get the buttons to stick to the right side of my index
table?

My code looks something like this, after a couple of hours of reverse
engineering.

query = db.tbl.blah
rows = db(query).select(db.tbl.id, db.tbl.f1, db.tbl.f2)
thead = THEAD(TR(TH('Col1'), TH('Col2'), TH()))
tbody = []
for row in rows:
  link = A('some action', URL('a_function, args=row.id),
_class='button')
  tbody.append(
TR(row.f1, row.f2, TD(link, _class='row_buttons'))
)
table = TABLE(thead, tbody)
div = DIV(table, _class='web2py_table')
return div

In the resulting table, the TD with the buttons slides to the right,
just after the last data column.

What am I missing?


[web2py] 1.99.4 Active Directory LDAP Issue

2012-02-07 Thread Ialejandro
Hi!! I have a lot of apps running with Windows LDAP and web2py (1.8)
and everything works just fine. Now I'm trying to build an app from
scratch using the same auth method with web2py 1.99.4. But it doesn't
work. When I try to log in (after typing pass and username) I get a
ticket this is what it says:

Traceback (most recent call last):
  File "C:\web2py\web2py\gluon\restricted.py", line 204, in restricted
exec ccode in environment
  File "C:/web2py/web2py/applications/fivrgen/controllers/default.py",
line 61, in 
  File "C:\web2py\web2py\gluon\globals.py", line 172, in 
self._caller = lambda f: f()
  File "C:/web2py/web2py/applications/fivrgen/controllers/default.py",
line 22, in user
return dict(form=auth())
  File "C:\web2py\web2py\gluon\tools.py", line 1141, in __call__
return getattr(self,args[0])()
  File "C:\web2py\web2py\gluon\tools.py", line 1744, in login
request.vars[passfield]):
  File "C:\web2py\web2py\gluon\contrib\login_methods\ldap_auth.py",
line 92, in ldap_auth_aux
if not isinstance(result, dict):
UnboundLocalError: local variable 'result' referenced before
assignment

And this is how my code looks:


from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods.append(ldap_auth(mode='ad',
   server='myworkingserver',
   base_dn='ou=xx,dc=xx,dc=xx,dc=xx,dc=xx'))

auth.settings.actions_disabled=['register','change_password','request_reset_password','retrieve_username','profile']

## create all tables needed by auth if not custom tables
auth.define_tables(username = True)


Am I doing something wrong??


[web2py] Re: new web2py application

2012-02-07 Thread Cliff
Cool stuff.

I like the thought behind it, too.

On Feb 7, 9:38 am, Massimo Di Pierro 
wrote:
> This made the news it 
> italy:http://www.repubblica.it/tecnologia/2012/02/05/news/hacker_anti_corru...
> Repubblica is the main national newspaper.
>
> Congratulations to the authors!
>
> Massimo
>
> On Feb 6, 11:34 pm, guruyaya  wrote:
>
>
>
>
>
>
>
> > This is beutiful. Just beutiful
>
> > On Feb 6, 8:54 pm, leone  wrote:
>
> > > Fine!http://www.globaleaks.org/


Re: [web2py] How to disable debugging

2012-02-07 Thread Anthony
On Tuesday, February 7, 2012 11:54:59 AM UTC-5, Praveen Bhat wrote:
>
> Hello,
>
> The "form" and "records" words appear even after taking off 
> {{=response.toolbar()}} line from generic.html..
>

Your controller is returning a dict containing "form" and "records" keys -- 
the following generic.html code automatically displays whatever is returned 
by the controller (which is stored in response._vars):

{{=' '.join(x.capitalize() for x in request.function.split('_'))}}
{{if len(response._vars)==1:}}
{{=response._vars.values()[0]}}
{{elif len(response._vars)>1:}}
{{=BEAUTIFY(response._vars)}}
{{pass}}

Note, the above also automatically generates an H2 heading based on the 
function name. You can remove all that, but then there's not much point in 
having a generic.html view at all (what will it display?).

Anthony
 


Re: [web2py] How to disable debugging

2012-02-07 Thread Praveen Bhat
Hello,

The "form" and "records" words appear even after taking off 
{{=response.toolbar()}} line from generic.html..

regards,
Pravene


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

2012-02-07 Thread Anthony

>
> - License changed to AGPL3 (Gnu Afferro GPL)
>>
>>
>> If I understand AGPL3 correctly, if someone deploys Movuca on a server, 
>> they will be required to allow all users of their website to download the 
>> entire source code of the site, including any customizations they make to 
>> the Movuca code in order to accommodate their app. I assume that will 
>> greatly limit its adoption.
>>
>
>  Yes, I wanted a way to keep it OPen Source and allow commercial use at 
> the same time.
>
> I want every one to be able to use it, customize it and deploys, sell 
> support, sell as a service.
>

But as soon as you deploy it, you have to let all of your users download 
the full site code. If someone hires you to build a site for them using 
Movuca, you have to tell them that the site they are paying you to build 
will ultimately be released to the public (in fact, they themselves will be 
responsible for making the source available for download). I'm not sure 
many people will want to try to make a commercial enterprise out of that 
model.
 

> But I want to keep it Open Source (I mean, I dont want someone to take the 
> code and release a tool called "blablabla" which is not open source)
>

If that's the goal, then maybe consider GPL, which allows deployment on a 
server without source code distribution, but does not allow other forms of 
distribution without source code. Even better, maybe LGPL (like web2py), 
which lets you use it in conjunction with closed source code (though since 
Movuca is really an app, it may be difficult to truly separate it from 
closed source code that is part of the same app).
 

> But, I think we can have closed plugins, acting in the same way as web2py 
> plugins. Someone can develop a plugin and release the plugin with any 
> license (not?)
>

I'm not sure about that:
http://www.gnu.org/licenses/gpl-faq.html#MereAggregation
http://www.gnu.org/licenses/gpl-faq.html#NFUseGPLPlugins

Of course, you should choose whatever license you like -- it's your work. 
I'm just pointing out that something like AGPL (and even GPL) will probably 
limit its appeal for users with any kind of commercial intentions.

Anthony




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

2012-02-07 Thread Bruno Rocha
OK, I am going to change it to LGPL3 (the same of web2py)

-- 

Bruno Rocha
[http://rochacbruno.com.br]


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

2012-02-07 Thread Bruce Wade
LGPL would probably be the best choice, meaning they can use the code for
commercial however need to submit/supply source code changes that they make
to the CMS directly, but allows them to keep their own unique code built on
top of the CMS closed if they want.

On Tue, Feb 7, 2012 at 9:29 AM, Mariano Reingart  wrote:

> The magic keyword is "distribute", both the GPL and LGPL would
> prevent proprietary closed forks (binary only releases).
>
> But, if you want that every site that uses your app would have to publish
> the source code, AGPL.
>
> Best regards
>
> Mariano Reingart
> http://www.sistemasagiles.com.ar
> http://reingart.blogspot.com
>
>
>
> On Tue, Feb 7, 2012 at 2:21 PM, Bruno Rocha  wrote:
>
>>
>>
>> On Tue, Feb 7, 2012 at 3:15 PM, Bruce Wade  wrote:
>>
>>> I agree with Anthony, I think this type of license will limit the
>>> adoption greatly. Honestly I probably wont even look at the code now, not
>>> because I wasn't interested. Instead because 99% of my clients require to
>>> keep the code that makes their system unique and profitable.
>>>
>>
>> I am open to change it, but I dont know nothing about licenses.
>>
>> Which license should I use if I want to allow free and commercial use and
>> at the same time avoid someone form using the code base to release a
>> commercial version os the same kinf of app?
>>
>> I mean, everyone should be able to use it to create a Social Network,
>> intranet or website, everyone should be able to sell apps made with it and
>> give commercial support.
>>
>> But no one can release a "CMS or Social network platform" free or
>> commercial without making the source code available.
>>
>> Is there a license?
>>
>>
>> --
>>
>> Bruno Rocha
>> [http://rochacbruno.com.br]
>>
>>
>


-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


Re: [web2py] a beginner question about queries

2012-02-07 Thread Richard Vézina
Why not use represent?

http://web2py.com/books/default/chapter/29/6?search=represent#Record-representation

Richard

On Tue, Feb 7, 2012 at 12:37 PM, shartha  wrote:

> Hello.
>
> I have this model:
> db = DAL('sqlite://storage.sqlite')
>
> db.define_table('customers',
>Field('name'),
>Field('age'),
>format = '%(name)s'
> )
>
> db.define_table('purchases',
>Field('name',db.customers),
>Field('cart')
> )
>
> db.purchases.name.requires = IS_IN_DB(db,db.customers,'%(name)s')
>
> The table customers has these values in it:
> (Jack,17)
> (John,23)
>
> The table purchases has these values in it:
> (Jack, CD)
> (John, DVD)
>
> Now in my controller if I use the following query:
> query = db(db.purchases.id>0).select
> return (purchases = query)
>
> Now if in my view, I loop through purchases to type their name
> property, e.g. purchases[0].name, the id of the person from the
> customers table will be returned. What should I use alternatively to
> get the actual name of the person, e.g. Jack, or John? I don't want to
> have another query for that.


[web2py] a beginner question about queries

2012-02-07 Thread shartha
Hello.

I have this model:
db = DAL('sqlite://storage.sqlite')

db.define_table('customers',
Field('name'),
Field('age'),
format = '%(name)s'
)

db.define_table('purchases',
Field('name',db.customers),
Field('cart')
)

db.purchases.name.requires = IS_IN_DB(db,db.customers,'%(name)s')

The table customers has these values in it:
(Jack,17)
(John,23)

The table purchases has these values in it:
(Jack, CD)
(John, DVD)

Now in my controller if I use the following query:
query = db(db.purchases.id>0).select
return (purchases = query)

Now if in my view, I loop through purchases to type their name
property, e.g. purchases[0].name, the id of the person from the
customers table will be returned. What should I use alternatively to
get the actual name of the person, e.g. Jack, or John? I don't want to
have another query for that.


[web2py] Re: web2py performance

2012-02-07 Thread Anthony
On Tuesday, February 7, 2012 2:36:14 AM UTC-5, LightOfMooN wrote:
>
> I'm using loop for 10 inserts just one time to insert 100k records 
> in database. 
> All next time I just try to get response. 
> And now in our project we have much more than 100k records, that can 
> be filtered and sorted by some dinamic conditions.
>

In order to convert query results into a DAL Rows object, the DAL has to 
loop through all the records and convert each one to a Row object (doing 
some transformations, depending on the field types). This takes a long time 
for tens of thousands of records. The code could probably be made a bit 
more efficient, but some initial attempts resulted in only small 
improvements. I'm not sure it can get dramatically faster. If you really 
need to work with that many records at a time, you're probably better off 
using executesql and working with the raw results rather than converting to 
a DAL Rows object.

Anthony



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

2012-02-07 Thread Mariano Reingart
The magic keyword is "distribute", both the GPL and LGPL would
prevent proprietary closed forks (binary only releases).

But, if you want that every site that uses your app would have to publish
the source code, AGPL.

Best regards

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com


On Tue, Feb 7, 2012 at 2:21 PM, Bruno Rocha  wrote:

>
>
> On Tue, Feb 7, 2012 at 3:15 PM, Bruce Wade  wrote:
>
>> I agree with Anthony, I think this type of license will limit the
>> adoption greatly. Honestly I probably wont even look at the code now, not
>> because I wasn't interested. Instead because 99% of my clients require to
>> keep the code that makes their system unique and profitable.
>>
>
> I am open to change it, but I dont know nothing about licenses.
>
> Which license should I use if I want to allow free and commercial use and
> at the same time avoid someone form using the code base to release a
> commercial version os the same kinf of app?
>
> I mean, everyone should be able to use it to create a Social Network,
> intranet or website, everyone should be able to sell apps made with it and
> give commercial support.
>
> But no one can release a "CMS or Social network platform" free or
> commercial without making the source code available.
>
> Is there a license?
>
>
> --
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>


[web2py] Re: Postgres: what am i doing wrong ?

2012-02-07 Thread Anthony

>
> Just tried it -> same results. 
> FYI, I'm only using the interactive python shell to illustrate the 
> problem I face I my app... 
>

When you use the -M option to load your models, are you then still doing 
this in your shell session:

>>> db = DAL('postgres://postgres:@localhost/courier')  

If so, don't -- the db object will already be defined when your db.py file 
is executed, and the above will end up overwriting it (and therefore losing 
all of its table definitions from db.py). Just do:

python web2py.py -S courier -M -N
>>> db.tables

(Note the -N option -- that prevents cron from starting.)

If you're using the DAL outside of a web2py app, then you'll still need to 
create model definitions (i.e., with db.define_table) in your code -- the 
DAL doesn't know what tables and fields are in your db unless you tell it 
by defining the models. However, if you have already defined the models in 
an app somewhere, you might be able to make use of 
auto_import: 
http://web2py.com/books/default/chapter/29/6#Using-DAL-without-define-tables.

Anthony



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

2012-02-07 Thread Bruno Rocha
On Tue, Feb 7, 2012 at 3:15 PM, Bruce Wade  wrote:

> I agree with Anthony, I think this type of license will limit the adoption
> greatly. Honestly I probably wont even look at the code now, not because I
> wasn't interested. Instead because 99% of my clients require to keep the
> code that makes their system unique and profitable.
>

I am open to change it, but I dont know nothing about licenses.

Which license should I use if I want to allow free and commercial use and
at the same time avoid someone form using the code base to release a
commercial version os the same kinf of app?

I mean, everyone should be able to use it to create a Social Network,
intranet or website, everyone should be able to sell apps made with it and
give commercial support.

But no one can release a "CMS or Social network platform" free or
commercial without making the source code available.

Is there a license?

-- 

Bruno Rocha
[http://rochacbruno.com.br]


Re: [web2py] dataTables with serverside json

2012-02-07 Thread Richard Vézina
Finally got it to work...

There was a problem with the init of DTs particularly this option :

http://datatables.net/release-datatables/extras/FixedColumns/server-side-processing.html

*fnInitComplete*
*
*
*
*
It's not solving my speed problem as I expect it could do... So I will put
it on hold, but I plan to implement a basic server interaction script as
the php DTs example to make it easier deploy DTs with server side
capability...

Richard

On Mon, Feb 6, 2012 at 6:10 PM, Bruno Rocha  wrote:

> Not,
>
> PowerGrid is based in pure Jquery Templates
>
>
> --
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>


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

2012-02-07 Thread Bruce Wade
I agree with Anthony, I think this type of license will limit the adoption
greatly. Honestly I probably wont even look at the code now, not because I
wasn't interested. Instead because 99% of my clients require to keep the
code that makes their system unique and profitable.

--
Regards,
Bruce

On Tue, Feb 7, 2012 at 9:06 AM, Bruno Rocha  wrote:

>
>
> On Tue, Feb 7, 2012 at 2:56 PM, Anthony  wrote:
>
>> - License changed to AGPL3 (Gnu Afferro GPL)
>>
>>
>> If I understand AGPL3 correctly, if someone deploys Movuca on a server,
>> they will be required to allow all users of their website to download the
>> entire source code of the site, including any customizations they make to
>> the Movuca code in order to accommodate their app. I assume that will
>> greatly limit its adoption.
>>
>
>  Yes, I wanted a way to keep it OPen Source and allow commercial use at
> the same time.
>
> I want every one to be able to use it, customize it and deploys, sell
> support, sell as a service. But I want to keep it Open Source (I mean, I
> dont want someone to take the code and release a tool called "blablabla"
> which is not open source)
>
> But, I think we can have closed plugins, acting in the same way as web2py
> plugins. Someone can develop a plugin and release the plugin with any
> license (not?)
>
> So if someone change the core, it will be needed to released the changes
> as open source.
>
> --
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>


-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


Re: [web2py] Re: web2py performance

2012-02-07 Thread Vinicius Assef
Massimo, if this question was to me, I don't face this situation with
web2py yet.

This is my experience, no matter what tools I use.

--
Vinicius Assef



On Tue, Feb 7, 2012 at 12:51 PM, Massimo Di Pierro
 wrote:
> Are you using trunk or stable. I believe there was an optimization in
> trunk in this respect but it was not benchmarks. I would like to know
> if it makes things better or worse in your case.
>
> On Feb 7, 7:54 am, Vinicius Assef  wrote:
>> Yes, David. That's a point.
>>
>> But, I'd like to say if somebody needs to retrieve 100k lines through
>> a single query in an online application, something sounds bad.
>>
>> I'm used to work on tables with millions rows. If you don't elaborate
>> a good queries and indexes to minimize traffic between db server and
>> its client, things go down quickly.
>>
>> So, I don't think this kink of benchmark has some value to real applications.
>>
>> --
>> Vinicius Assef.
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Feb 7, 2012 at 7:56 AM, David Marko  wrote:
>> > Yes its known behaviour because  using standard DAL query the system has to
>> > convert every line into Python object, which is really time consuming for
>> > 100K documents.


Re: [web2py] How to disable debugging

2012-02-07 Thread Anthony
On Tuesday, February 7, 2012 10:31:39 AM UTC-5, Detectedstealth wrote:
>
> Removing {{=response.toolbar()}} just prevents it from showing, or does it 
> actually disable it from being called in the background and assigned to the 
> response object?
>

.toolbar() is a method that is called to generate the toolbar -- if you 
remove {{=response.toolbar()}}, the method never gets called and no toolbar 
is generated. Nothing gets assigned to the response object at all, even 
when the method is called -- the method simply returns the HTML helpers to 
generate the toolbar, which gets serialized to HTML in the view.

Anthony 


Re: [web2py] How to disable debugging

2012-02-07 Thread Anthony
On Tuesday, February 7, 2012 11:32:21 AM UTC-5, Praveen Bhat wrote:
>
> Hello Bruce,
>
> Thanks for your quick reply.
>
> But I do not find any generic.html view file as I am using the Windows 
> Webpy.
>

generic.html should be in /web2py/application/your_app/views (even in the 
Windows distribution). Note, it includes the following code:

{{if request.is_local:}}
{{=response.toolbar()}}
{{pass}}

 So, the toolbar will appear only for local requests (i.e., on your 
development machine), not once the app is deployed to production. In any 
case, as Bruno mentioned, you should ultimately create your own 
action-specific views rather than rely on the generic views (particularly 
for HTML views).

Anthony



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

2012-02-07 Thread Bruno Rocha
On Tue, Feb 7, 2012 at 2:56 PM, Anthony  wrote:

> - License changed to AGPL3 (Gnu Afferro GPL)
>
>
> If I understand AGPL3 correctly, if someone deploys Movuca on a server,
> they will be required to allow all users of their website to download the
> entire source code of the site, including any customizations they make to
> the Movuca code in order to accommodate their app. I assume that will
> greatly limit its adoption.
>

 Yes, I wanted a way to keep it OPen Source and allow commercial use at the
same time.

I want every one to be able to use it, customize it and deploys, sell
support, sell as a service. But I want to keep it Open Source (I mean, I
dont want someone to take the code and release a tool called "blablabla"
which is not open source)

But, I think we can have closed plugins, acting in the same way as web2py
plugins. Someone can develop a plugin and release the plugin with any
license (not?)

So if someone change the core, it will be needed to released the changes as
open source.

-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] 1 Week Left! Web2py Application Exhibition

2012-02-07 Thread NetAdmin

There is only ONE week left for submissions.

If you plan to submit an application for the Web2py Application
Exhibition, please send me an e-mail indicating your interest so I can
have an idea of how many submissions to expect.

Thanks!

Mr.NetAdmn



[web2py] Re: Movuca - Social CMS beta 0.1

2012-02-07 Thread Anthony

>
> - License changed to AGPL3 (Gnu Afferro GPL)


If I understand AGPL3 correctly, if someone deploys Movuca on a server, 
they will be required to allow all users of their website to download the 
entire source code of the site, including any customizations they make to 
the Movuca code in order to accommodate their app. I assume that will 
greatly limit its adoption.

Anthony


Re: [web2py] Workflow engine for web2py

2012-02-07 Thread Richard Vézina
I know it in french, I didn't find it in english :
http://fr.wikipedia.org/wiki/Liste_des_moteurs_de_workflow

And what about XPDL? http://en.wikipedia.org/wiki/XPDL

Richard

On Tue, Feb 7, 2012 at 11:27 AM, omicron  wrote:

> This library is small and easy to use:
> http://www.hforge.org/itools/docs/workflow/


Re: [web2py] How to disable debugging

2012-02-07 Thread Praveen Bhat
Hello Bruce,

Thanks for your quick reply.

But I do not find any generic.html view file as I am using the Windows
Webpy.

Regards,
Praveen

On Tue, Feb 7, 2012 at 9:01 PM, Bruce Wade  wrote:

> Removing {{=response.toolbar()}} just prevents it from showing, or does it
> actually disable it from being called in the background and assigned to the
> response object?
>
>
> On Tue, Feb 7, 2012 at 7:25 AM, Bruno Rocha  wrote:
>
>> You are using generic views.
>>
>> Better to create your own views.
>>
>> But, if you want to disabled that, you need to edit the
>> views/generic.html and remove the {{=response.toolbar()}}
>>
>>
>> On Tue, Feb 7, 2012 at 1:05 PM, Praveen Bhat wrote:
>>
>>> Hello,
>>>
>>> I have attached the screenshot of the page rendered, and there is some
>>> debugging information.
>>>
>>> How can I disable it?
>>>
>>> regards
>>>  Praveen
>>>
>>
>>
>>
>> --
>>
>> Bruno Rocha
>> [http://rochacbruno.com.br]
>>
>>
>
>
> --
> --
> Regards,
> Bruce Wade
> http://ca.linkedin.com/in/brucelwade
> http://www.wadecybertech.com
> http://www.warplydesigned.com
> http://www.fitnessfriendsfinder.com
>


Re: [web2py] Workflow engine for web2py

2012-02-07 Thread omicron
This library is small and easy to use: 
http://www.hforge.org/itools/docs/workflow/

[web2py] Movuca - Social CMS beta 0.1

2012-02-07 Thread Bruno Rocha
Hi, By the end of the week I will release Movuca Social CMS Beta 0.1

(for release I just need to finish installation page, admin dashboard and
web2py scheduler notification worker)

But, I want to hear your feedback about it!

*Main Changes:*
- Now it defaults to bootstrap theme (but basic the is available)
- License changed to AGPL3 (Gnu Afferro GPL)

*Features working*
- Home page with components and timeline
- Featured Articles and members (most likes and users with more
participation)
- Multi content type (you can create your own content types and customize
new/edit/show views)
- Social actions (like, dislike, favorite)
- Social icons (share on facebook, google+, tweet etc)
- Comment system (internal, disqus, intense debate, facebook)
- Code highlighting using google prettify
- HTML Editor using plugin_ckeditor from Ross Peoples (thanks)
- New tags widget (include it in web2py?)
- Person profiles, boards and timelines
- Contacts manager
- Notifications (with configuration options per user)
- Email notifications (with html email templates stored in database)
- Search for articles and members
- privacy options
- Background process notification worker (to send notification emails as a
separate process)

*Todo*
https://github.com/rochacbruno/Movuca/blob/master/TODO

*Screenshots*
http://min.us/mbcVYzyXsh#1

*Live demo:*
http://movu.ca/demo

*Code and issues:*
https://github.com/rochacbruno/Movuca

*Feedback:*
http://movuca.userecho.com/

*Buy me a coffee:*
rochacbr...@gmail.com on PayPal

*Commercial support:*
http://blouweb.com

*It is Open Source,  pull requests are very welcome!*


*FYI.*
web2pyslices will be updated to use Movuca as its base (this week)
blouweb.com will offer "create your own social network" as a service for
companies, groups, clubs and social intranets, also we are going to offer
commercial support and commercial plugins when the app outs of beta.


-- 

Bruno Rocha
[http://rochacbruno.com.br]


Re: [web2py] Re: VPScolo.com Five dolar VPS, anybody knows it?

2012-02-07 Thread Tito Garrido
Excellent piece of information Ross! Thank you very much!

On Tue, Feb 7, 2012 at 11:11 AM, Ross Peoples wrote:

> I haven't heard of them before, but I have learned a quick lesson about
> VPS providers: most of them are one-man operations that only last for a few
> months. I have done a LOT of research on VPS providers over the last couple
> of weeks and the one site I always end up turning to for advice on
> providers is Low End Box: http://www.lowendbox.com/
>
> I did a search for VPScolo on LEB and found an ad from 2010. So the fact
> that they've been around for at least 2 years is a good sign. You don't get
> a whole lot of resource though. So far, I have only found two VPS providers
> that give you the most resources for your money. If you need bandwidth, go
> for RethinkVPS. They offer unlimited transfer. If you need more memory,
> look at ChicagoVPS. I got in on a good deal with them: 2GB of RAM, 2TB of
> transfer for $7/month.
>
> As for the burst, you have 256 MB of RAM. The burst is like swap space. It
> is there for temporary usage only. Many providers provide you with burst
> memory in case your site is listed on Reddit or Slashdot and experiences a
> sudden spike in traffic. If you are eating into burst memory often, your
> provider will make you upgrade to a better plan, or ask you to leave. So
> make sure that 256 MB is more than sufficient for your needs.
>
> As a quick note, I am not associated with VPS providers. I was looking for
> one recently, so I started doing my homework for a provider that met my
> needs. I should also mention that these are cheap plans, and are a step up
> from shared hosting, but they are not going to be as high quality as a
> provider such as VPS.net or Rackspace, etc. So there will be some downtime
> every now and then.
>



-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___


Re: [web2py] Re: Postgres: what am i doing wrong ?

2012-02-07 Thread Richard Vézina
May be web2py need a password to be define to acces model in shell??

So use -a parameter to set a pwd here my start command, notice I am not
sure but have auto after the -M that maybe required?? :

python web2py.py -a '12345' -i 127.0.0.1 -p 8001 -S apllication_name -M
auto'

Richard


On Tue, Feb 7, 2012 at 11:12 AM, Massimiliano  wrote:

> What do you expect to see in db.tables?
>
> Tables defined in model(s) or tables on database?
>
>
>
> On Tue, Feb 7, 2012 at 5:03 PM, Calycé wrote:
>
>> Just tried it -> same results.
>> FYI, I'm only using the interactive python shell to illustrate the
>> problem I face I my app...
>>
>> On Feb 7, 4:56 pm, Michele Comitini 
>> wrote:
>> > python web2py/web2py.py -S courier
>> >
>> > add -M
>> >
>> > python web2py/web2py.py -S courier -M
>> >
>> > mic
>> >
>> > 2012/2/7 Calycé :
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > Hi all,
>> >
>> > > I'm starting a new project in which I'm using Postgresql, but I have
>> > > some problems.
>> > > I have defined a couple of tables in models/db.py. I can see and
>> > > manipulate those tables through web2py's admin interface, but when I
>> > > try to use DAL I'm facing some problems. I can connect without
>> > > problem, but afterwards I can't  see nor access any tables.
>> >
>> > > Here's a copy of a python interactive session:
>> > > (courier)[julie@landing courier]$ python web2py/web2py.py -S courier
>> > > web2py Web Framework
>> > > Created by Massimo Di Pierro, Copyright 2007-2011
>> > > Version 1.99.3 (2011-12-09 16:18:03) stable
>> > > Database drivers available: SQLite3, pymysql, PostgreSQL
>> > > WARNING:web2py:import IPython error; use default python shell
>> > > Python 2.7.2 (default, Jan 31 2012, 13:19:49)
>> > > [GCC 4.6.2 20120120 (prerelease)] on linux2
>> > > Type "help", "copyright", "credits" or "license" for more information.
>> > > (InteractiveConsole)
>> >  db = DAL('postgres://postgres:@localhost/courier')
>> >  print db.tables
>> > > []
>> >
>> > > As you can see, I apparently have no tables in my database but I can
>> > > definitely see them in web2py's admin interface!
>> > > Am I doing something wrong ?
>> >
>> > > Spec:
>> > > Web2py: 1.99.3
>> > > Postgres: 9.1.2
>> > > Psycopg2: 2.4.4
>>
>
>
>
> --
> Massimiliano
>


[web2py] Re: Possible bug when using upload with GAE

2012-02-07 Thread howesc
check the GAE data console (locally for me that is at 
127.0.0.1:8080/_ah/admin/datastore) and see what the datatype of of the 
image is and how much data is stored.  i thought that a blob type could be 
up to 1MB.

for what it's worth, i use blobstore to store my images (does not have the 
1mb limit)

cfh


Re: [web2py] Re: Postgres: what am i doing wrong ?

2012-02-07 Thread Massimiliano
What do you expect to see in db.tables?

Tables defined in model(s) or tables on database?



On Tue, Feb 7, 2012 at 5:03 PM, Calycé wrote:

> Just tried it -> same results.
> FYI, I'm only using the interactive python shell to illustrate the
> problem I face I my app...
>
> On Feb 7, 4:56 pm, Michele Comitini 
> wrote:
> > python web2py/web2py.py -S courier
> >
> > add -M
> >
> > python web2py/web2py.py -S courier -M
> >
> > mic
> >
> > 2012/2/7 Calycé :
> >
> >
> >
> >
> >
> >
> >
> > > Hi all,
> >
> > > I'm starting a new project in which I'm using Postgresql, but I have
> > > some problems.
> > > I have defined a couple of tables in models/db.py. I can see and
> > > manipulate those tables through web2py's admin interface, but when I
> > > try to use DAL I'm facing some problems. I can connect without
> > > problem, but afterwards I can't  see nor access any tables.
> >
> > > Here's a copy of a python interactive session:
> > > (courier)[julie@landing courier]$ python web2py/web2py.py -S courier
> > > web2py Web Framework
> > > Created by Massimo Di Pierro, Copyright 2007-2011
> > > Version 1.99.3 (2011-12-09 16:18:03) stable
> > > Database drivers available: SQLite3, pymysql, PostgreSQL
> > > WARNING:web2py:import IPython error; use default python shell
> > > Python 2.7.2 (default, Jan 31 2012, 13:19:49)
> > > [GCC 4.6.2 20120120 (prerelease)] on linux2
> > > Type "help", "copyright", "credits" or "license" for more information.
> > > (InteractiveConsole)
> >  db = DAL('postgres://postgres:@localhost/courier')
> >  print db.tables
> > > []
> >
> > > As you can see, I apparently have no tables in my database but I can
> > > definitely see them in web2py's admin interface!
> > > Am I doing something wrong ?
> >
> > > Spec:
> > > Web2py: 1.99.3
> > > Postgres: 9.1.2
> > > Psycopg2: 2.4.4
>



-- 
Massimiliano


[web2py] web2py RBAC and "virtual table"

2012-02-07 Thread Richard
Hello,

I would like to know if there is a way in web2py to have "virtual
table" (mean subset of columns from a existing table) access
controlled with the web2py built-in RBAC ??

I mean I have to denormalize to improve speed of an app that use to
have many table that are all using the same pattern. It makes sens to
denormalize since all data contains in these similar tables are
requested all the time with joins. Also, it would make it much easier
to refactor since I will not have to make the same change over 30
similar tables each time I have general modifications (I know about
web2py inheritrance, but I use to sync web2py model and db model by
hand, so I have to generate sql DDL)...

May be I can just define a subset of model on the fly in controller ??

Is there anybody else having the same needs? If so, is there any plan
about virtual table in web2py?

Thanks

Richard


[web2py] Re: Postgres: what am i doing wrong ?

2012-02-07 Thread Calycé
Just tried it -> same results.
FYI, I'm only using the interactive python shell to illustrate the
problem I face I my app...

On Feb 7, 4:56 pm, Michele Comitini 
wrote:
> python web2py/web2py.py -S courier
>
> add -M
>
> python web2py/web2py.py -S courier -M
>
> mic
>
> 2012/2/7 Calycé :
>
>
>
>
>
>
>
> > Hi all,
>
> > I'm starting a new project in which I'm using Postgresql, but I have
> > some problems.
> > I have defined a couple of tables in models/db.py. I can see and
> > manipulate those tables through web2py's admin interface, but when I
> > try to use DAL I'm facing some problems. I can connect without
> > problem, but afterwards I can't  see nor access any tables.
>
> > Here's a copy of a python interactive session:
> > (courier)[julie@landing courier]$ python web2py/web2py.py -S courier
> > web2py Web Framework
> > Created by Massimo Di Pierro, Copyright 2007-2011
> > Version 1.99.3 (2011-12-09 16:18:03) stable
> > Database drivers available: SQLite3, pymysql, PostgreSQL
> > WARNING:web2py:import IPython error; use default python shell
> > Python 2.7.2 (default, Jan 31 2012, 13:19:49)
> > [GCC 4.6.2 20120120 (prerelease)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > (InteractiveConsole)
>  db = DAL('postgres://postgres:@localhost/courier')
>  print db.tables
> > []
>
> > As you can see, I apparently have no tables in my database but I can
> > definitely see them in web2py's admin interface!
> > Am I doing something wrong ?
>
> > Spec:
> > Web2py: 1.99.3
> > Postgres: 9.1.2
> > Psycopg2: 2.4.4


Re: [web2py] Postgres: what am i doing wrong ?

2012-02-07 Thread Michele Comitini
python web2py/web2py.py -S courier

add -M

python web2py/web2py.py -S courier -M



mic

2012/2/7 Calycé :
> Hi all,
>
> I'm starting a new project in which I'm using Postgresql, but I have
> some problems.
> I have defined a couple of tables in models/db.py. I can see and
> manipulate those tables through web2py's admin interface, but when I
> try to use DAL I'm facing some problems. I can connect without
> problem, but afterwards I can't  see nor access any tables.
>
> Here's a copy of a python interactive session:
> (courier)[julie@landing courier]$ python web2py/web2py.py -S courier
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2011
> Version 1.99.3 (2011-12-09 16:18:03) stable
> Database drivers available: SQLite3, pymysql, PostgreSQL
> WARNING:web2py:import IPython error; use default python shell
> Python 2.7.2 (default, Jan 31 2012, 13:19:49)
> [GCC 4.6.2 20120120 (prerelease)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
 db = DAL('postgres://postgres:@localhost/courier')
 print db.tables
> []

>
> As you can see, I apparently have no tables in my database but I can
> definitely see them in web2py's admin interface!
> Am I doing something wrong ?
>
> Spec:
> Web2py: 1.99.3
> Postgres: 9.1.2
> Psycopg2: 2.4.4


[web2py] Postgres: what am i doing wrong ?

2012-02-07 Thread Calycé
Hi all,

I'm starting a new project in which I'm using Postgresql, but I have
some problems.
I have defined a couple of tables in models/db.py. I can see and
manipulate those tables through web2py's admin interface, but when I
try to use DAL I'm facing some problems. I can connect without
problem, but afterwards I can't  see nor access any tables.

Here's a copy of a python interactive session:
(courier)[julie@landing courier]$ python web2py/web2py.py -S courier
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011
Version 1.99.3 (2011-12-09 16:18:03) stable
Database drivers available: SQLite3, pymysql, PostgreSQL
WARNING:web2py:import IPython error; use default python shell
Python 2.7.2 (default, Jan 31 2012, 13:19:49)
[GCC 4.6.2 20120120 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> db = DAL('postgres://postgres:@localhost/courier')
>>> print db.tables
[]
>>>

As you can see, I apparently have no tables in my database but I can
definitely see them in web2py's admin interface!
Am I doing something wrong ?

Spec:
Web2py: 1.99.3
Postgres: 9.1.2
Psycopg2: 2.4.4


[web2py] Re: Adding application specific data to httpserver.log ?

2012-02-07 Thread JC11
Thank you,

Would there be any harm in adding environ['QUERY_STRING'] httpserver.log as 
a change in your main.py source code ?  This would solve my issue and 
perhaps help others by giving a little more detail in the logs which for 
REST type applications will be very useful.

One line added and two lines slightly altered around line 700 of main.py in 
gluon:

line = '%s, %s, %s, %s, %s, %s, %f, %s\n' % (  #JC:  added 
extra ', %s' before the \n
environ['REMOTE_ADDR'],
datetime.datetime.today().strftime('%Y-%m-%d %H:%M:%S'),
environ['REQUEST_METHOD'],
environ['PATH_INFO'].replace(',', '%2C'),
environ['SERVER_PROTOCOL'],
(status_headers[0])[:3],
time.time() - time_in,  # JC: add a comma at the end of 
this line 
environ['QUERY_STRING'] # JC: new line to show query 
parameters

Thanks,

John Cobo


Re: [web2py] How to disable debugging

2012-02-07 Thread Bruce Wade
Removing {{=response.toolbar()}} just prevents it from showing, or does it
actually disable it from being called in the background and assigned to the
response object?

On Tue, Feb 7, 2012 at 7:25 AM, Bruno Rocha  wrote:

> You are using generic views.
>
> Better to create your own views.
>
> But, if you want to disabled that, you need to edit the views/generic.html
> and remove the {{=response.toolbar()}}
>
>
> On Tue, Feb 7, 2012 at 1:05 PM, Praveen Bhat wrote:
>
>> Hello,
>>
>> I have attached the screenshot of the page rendered, and there is some
>> debugging information.
>>
>> How can I disable it?
>>
>> regards
>>  Praveen
>>
>
>
>
> --
>
> Bruno Rocha
> [http://rochacbruno.com.br]
>
>


-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


Re: [web2py] How to disable debugging

2012-02-07 Thread Bruno Rocha
You are using generic views.

Better to create your own views.

But, if you want to disabled that, you need to edit the views/generic.html
and remove the {{=response.toolbar()}}

On Tue, Feb 7, 2012 at 1:05 PM, Praveen Bhat wrote:

> Hello,
>
> I have attached the screenshot of the page rendered, and there is some
> debugging information.
>
> How can I disable it?
>
> regards
> Praveen
>



-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] How to disable debugging

2012-02-07 Thread Praveen Bhat
Hello,

I have attached the screenshot of the page rendered, and there is some 
debugging information.

How can I disable it?

regards
Praveen
<>

[web2py] Re: using radio widget can't receive the empty submit

2012-02-07 Thread DenesL
It will work if you have values inside the IS_IN_SET validators in
your controller, e.g.

IS_IN_SET([1,2,3,4],multiple='multiple')


Re: [web2py] Workflow engine for web2py

2012-02-07 Thread Bruno Rocha
+1 I would like to have it, lets start coding?

http://zerp.ly/rochacbruno
Em 18/01/2012 22:02, "António Ramos"  escreveu:

> is it dificult to do something like this in web2py?
>
>
> http://blog.aizatto.com/2009/12/07/ruby-on-rails-finite-state-machine-plugin-workflow/
>


Re: [web2py] Re: Workflow engine for web2py

2012-02-07 Thread Richard Vézina
Interrested too!

Richard

On Tue, Feb 7, 2012 at 9:38 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> I need this too.
>
> On Feb 7, 2:56 am, Ashraf Mansour  wrote:
> > I am having the same interest...
> >
> > On Jan 19, 3:02 am, António Ramos  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > is it dificult to do something like this in web2py?
> >
> > >http://blog.aizatto.com/2009/12/07/ruby-on-rails-finite-state-machine.
> ..
>


  1   2   >