[web2py] my super heroic idea of the next scheduler

2014-06-05 Thread António Ramos
Just kiding 

is this simpler ?

@task(* * * * *)
def myfunc():
bla bla bla
.

It would be easier to detect a function under a schedule

also can i stark the -K for the scheduler in the same command line as the
initial load of the web2py ?

Regards
António

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Need help with a query

2014-06-05 Thread Ruud Schroen
Hi there,

In my app there is the possibility to become friends. This is my model:

db.define_table('friendship',
Field('source_user', 'reference auth_user'),
Field('target_user', 'reference auth_user'),
Field('accepted', 'boolean', default=False)
)

Now, if I want to fetch all friends of a given user, how would I do this?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py CMS

2014-06-05 Thread Ruud Schroen
Web2Py Pages CMS 


This is a basic CMS. You can create pages, add all sorts of page items, 
have SEO friendly URLs and more.

You should check it out.


>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py function import not working well

2014-06-05 Thread Maurice Waka
Thanks team!! That gives me an idea of how to program. Mush appreciated!


On Thu, Jun 5, 2014 at 2:20 AM, Derek  wrote:

> you running it from the shell gives you the REPL which you don't have when
> you run it through web2py. repl will print out if you just give it a class
> it will tell you what instance of class you have. if you want to print like
> it does in the repl, you need to 'print repr(x)' where x is the class or
> whatever you want.
>
>
> On Tuesday, June 3, 2014 12:30:02 PM UTC-7, Maurice Waka wrote:
>
>>
>> When I work with the same module on python shell, its perfectly printing
>> out. I dont know why it does not print on web2py. Basically I imported it
>> without editing from python shell. Anyway since am new to web2py and
>> python, you could help out
>> On Tuesday, June 3, 2014, Derek  wrote:
>> > Sorry, but it looks like it's doing what you are asking of it. Perhaps
>> you should comment your code to make sure it's doing what you are thinking
>> it's doing.
>> > you are instantiating a new filters class, giving it the name 'o', then
>> you get a list of the contents of that class, run them if possible, and
>> then you are instantiating a new filters class, naming it 'result', kinda
>> like 'o' was and then you are returning it. Why? What's the point of
>> doing all that if 'o' is never going to be used? you might as well take
>> that out since you are just returning a new class instance anyway.
>> >
>> >
>> > On Tuesday, June 3, 2014 2:50:48 AM UTC-7, Maurice Waka wrote:
>> >>
>> >> from applications.Folders1.modules.myfolder1.main import main
>> >> from applications.Folders1.modules.myfolder1.list1 import GAMES0
>> >> code.
>> >> if id == name3:
>> >> result = location
>> >> return result
>> >>
>> >> else:
>> >> while True:
>> >> class Filters(object):
>> >> def Filter_cause(self):
>> >> for item in name3.split():
>> >> b = False
>> >> for c in FILTERTYPE:
>> >> b = b | (item.find(c) != -1)
>> >> if b:
>> >> for (func) in GAMES0:
>> >> func()
>> >> o = Filters()
>> >> for stuff in dir(o):
>> >> if 'Filter' in stuff:
>> >> getattr(o, stuff)()
>> >>
>> >> result = Filters()
>> >> return result
>> >>
>> >> GAMES0 contains several python modules being imported. My loop works
>> well up to the return location, section but on looping over the 'def class
>> Filters', I get this message:
>> >>
>> >> > 0x06D689F0>
>> >>
>> >> How can I make it to print out my message from any of the modules
>> >
>> > --
>> > Resources:
>> > - http://web2py.com
>> > - http://web2py.com/book (Documentation)
>> > - http://github.com/web2py/web2py (Source code)
>> > - https://code.google.com/p/web2py/issues/list (Report Issues)
>> > ---
>> > You received this message because you are subscribed to a topic in the
>> Google Groups "web2py-users" group.
>> > To unsubscribe from this topic, visit https://groups.google.com/d/
>> topic/web2py/JsESNTvfrHQ/unsubscribe.
>> > To unsubscribe from this group and all its topics, send an email to
>> web2py+un...@googlegroups.com.
>>
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>> --
>> Dr Maurice Waka, MBCHB.
>> Nairobi
>>
>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/JsESNTvfrHQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Dr Maurice Waka, MBCHB.
Nairobi

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: issue with multi-select widget

2014-06-05 Thread Mandar Vaze

On Wednesday, November 21, 2012 12:38:36 AM UTC+5:30, SamD wrote: 

> Would'nt it be more convenient to force whatever is passed to behave as a 
> list (of strings) ?


Came across response from Massimo about this here : 
https://groups.google.com/d/msg/web2py/Je-joYm3ob4/yrhE5r09vI4J

TL:DR : Yes, it would. the current behaviour is a compromise/design 
decision.

-Mandar 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py CMS

2014-06-05 Thread Loïc
Hi Andrey,

I can not tell you what would be the *best* cms : I developped tiny_website 
and my opinion would be biaised :-)

You are the only one that knows if you need only basic features, or more 
bell and whistles.
Test each one during 5 minutes, and choose the one that fits your needs if 
you are comfortable with.

Regards

Le dimanche 1 juin 2014 11:43:52 UTC+2, Andrey K a écrit :
>
> Thanks Yamandu and Massimo,
> I will check it out. I have found several others:
> https://github.com/espern/tiny_website
> https://github.com/mdipierro/w2cms
> Fabiano, I need it for my application, so content manager or designer 
> could edit at least text and change colors without keep asking developer 
> (me) to do it:)
>
>
>
> On Saturday, May 31, 2014 9:32:08 AM UTC+3, Massimo Di Pierro wrote:
>>
>> kpax is so old I would recommend it any more.
>>
>> On Friday, 30 May 2014 16:28:04 UTC-5, yamandu wrote:
>>>
>>> We have some options as I know.
>>>
>>> Kpax from Massimo
>>> http://vimeo.com/1098656
>>> https://github.com/mdipierro/web2py-appliances/tree/master/KPax2
>>>
>>>
>>> Quoca and Movuca (more lika a social app) from Bruno Rocha
>>> http://quokkaproject.org/
>>> https://github.com/rochacbruno/Movuca
>>>
>>> https://code.google.com/p/instant-press/
>>>
>>>
>>> 2014-05-30 17:52 GMT-03:00 Fabiano Almeida :
>>>
 Hi Andrey,

 Do you need a blog?


 2014-05-30 11:21 GMT-03:00 Andrey K :

 I am interested to add in CMS system for our web2py application.
>  Quick search does not give me any solutions. Is there any CMS plugin 
> already or any recipes on it?
> Any thoughts, suggestions, links and comments would be very 
> appreciated.
> Thank you in advance!
>
>  -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google 
> Groups "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to web2py+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

  -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to the Google 
 Groups "web2py-users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> -- 
>>> Att.
>>>
>>> Carlos J. Costa
>>> Cientista da Computação
>>> Esp. Gestão em Telecom
>>>
>>> EL MELECH NEEMAN!
>>> אָמֵן
>>>
>>> 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Need help with a query

2014-06-05 Thread Leonel Câmara
You sort of provide your own answer (OR). In web2py's DAL you OR queries 
using the binary OR operator.

For instance, this is the solution for the logged in user:

my_friends = db((db.friendship.accepted == True) & 
((db.friendship.source_user == auth.user_id) | (db.friendship.target_user 
== auth.user_id))).select()

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Need help with a query

2014-06-05 Thread Leonel Câmara


Quinta-feira, 5 de Junho de 2014 11:33:43 UTC+1, Ruud Schroen escreveu:
>
> Hi there,
>
> In my app there is the possibility to become friends. This is my model:
>
> db.define_table('friendship',
> Field('source_user', 'reference auth_user'),
> Field('target_user', 'reference auth_user'),
> Field('accepted', 'boolean', default=False)
> )
>
> Now, if I want to fetch all friends of a given user, how would I do this?
>
> The problem is that the given user ID can be in the source_user OR 
> target_user, so I need an easy way to fetch the OTHER id.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Need help with a query

2014-06-05 Thread Ruud Schroen
Thanks for your answer.

I know about the OR operators. The "problem" is that it now fetches the 
entire friendships records.

I need a list with ID's other then the user's own ID. For example when I 
fetch a friendship record, the ID of the friend can either be the 
source_user or the target_user. 

Is it possible that if the source_user matches the auth.user_id, take the 
target_user instead? And vice versa.
I would go for a for loop, but maybe there is an easier and faster way.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Need help with a query

2014-06-05 Thread Leonel Câmara
my_friends = db((db.friendship.accepted == True) & 
((db.friendship.source_user == auth.user_id) | (db.friendship.target_user 
== auth.user_id))).select()

my_friends_ids = [friendship.source_user if friendship.source_user != 
auth.user_id else friendship.target_user for friendship in my_friends]


I would cache this denormalized result, probably in the user table.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Need help with a query

2014-06-05 Thread Ruud Schroen
That's exactly what I was looking for. Thanks!
Op 5-jun.-2014 15:42 schreef "Leonel Câmara" :

> my_friends = db((db.friendship.accepted == True) &
> ((db.friendship.source_user == auth.user_id) | (db.friendship.target_user
> == auth.user_id))).select()
>
> my_friends_ids = [friendship.source_user if friendship.source_user !=
> auth.user_id else friendship.target_user for friendship in my_friends]
>
>
> I would cache this denormalized result, probably in the user table.
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/mtW2NvGlKYY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Autocomplete widget on SQLFORM.grid search?

2014-06-05 Thread Jim S
I don't use the built-in search capabilities of the grid.  I like to code 
my own as shown here: 
 https://groups.google.com/forum/#!topic/web2py/61R9vqCO_Xo

Once this is done I can then use the jqueryui autocomplete widget to do the 
autocomplete for me.  Takes a bit of coding, but works really well.

-Jim


On Wednesday, June 4, 2014 10:15:20 PM UTC-5, JoeCodeswell wrote:
>
> Alec Taylor said: "I know, but it could also help suggest possible values 
> to search for 
> details on in the grid ."
>
> I agree, Alec. +1
>
> Love and peace,
>
> Joe
>
>
> On Monday, May 27, 2013 8:36:25 PM UTC-7, Alec Taylor wrote:
>>
>> I know, but it could also help suggest possible values to search for 
>> details on in the grid 
>>
>> On Tue, May 28, 2013 at 1:03 PM, Anthony  wrote: 
>> > The autocomplete widget is for when a field appears in a create or 
>> update 
>> > form -- it is used to help you fill in a value for the field. 
>> > 
>> > Anthony 
>> > 
>> > 
>> > On Monday, May 27, 2013 10:43:11 PM UTC-4, Alec Taylor wrote: 
>> >> 
>> >> I haven't been able to get this to work: 
>> >> 
>> >> # Models 
>> >> db.define_table('category',Field('name')) 
>> >> db.define_table('product',Field('name'),Field('category')) 
>> >> db.product.category.widget = SQLFORM.widgets.autocomplete(request, 
>> >> db.category.name, limitby=(0,10), min_length=2) 
>> >> 
>> >> # View 
>> >> {{= SQLFORM.grid(db.product) }} 
>> >> 
>> >>  
>> >> 
>> >> How do I bind the search input box to the autocomplete widget? 
>> >> 
>> >> Thanks for all suggestions, 
>> >> 
>> >> Alec Taylor 
>> > 
>> > -- 
>> > 
>> > --- 
>> > You received this message because you are subscribed to the Google 
>> Groups 
>> > "web2py-users" group. 
>> > To unsubscribe from this group and stop receiving emails from it, send 
>> an 
>> > email to web2py+un...@googlegroups.com. 
>> > For more options, visit https://groups.google.com/groups/opt_out. 
>> > 
>> > 
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Scheduler

2014-06-05 Thread Tom Russell
Well that will work as I already have some stuff running in their schedule 
tab anyways.

On Wednesday, June 4, 2014 9:24:22 PM UTC-4, Michael Beller wrote:
>
> You can't use the web2py scheduler but you can create your own simple 
> version.
>
> Here is more information from the python anywhere forum:
>
> https://www.pythonanywhere.com/forums/topic/179/
>
> Basically you can launch web2py periodically, e.g., once an hour or once 
> per day, and execute a module that can perform anything you want.  You 
> could also process the tasks in the task table and their associated actions.
>
> On Wednesday, June 4, 2014 11:00:06 AM UTC-4, Tom Russell wrote:
>>
>> I have implemented the scheduler per the info and examples in Chapter 4 
>> of the book. I am trying to start the workers but my problem is I am not 
>> sure how to since my app is hosted on pythonanywhere and according to the 
>> book I need to do it from the interface from where you set the ip and port.
>>
>> Is there another way to do this?
>>
>> Thanks.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] layout

2014-06-05 Thread Tom Russell
I want to use a few parts from a layout for web2py 
here 
http://www.web2py.com/layouts/static/plugin_layouts/layouts/CorporateOffice/index.html

Mainly I just want the  for my layout.html. I tried 
adding this but it does not seem to work. Is there an easy way to do this?

Thanks.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] layout

2014-06-05 Thread Marco Mansilla
El Thu, 5 Jun 2014 09:21:32 -0700 (PDT)
Tom Russell  escribió:

> I want to use a few parts from a layout for web2py 
> here
> http://www.web2py.com/layouts/static/plugin_layouts/layouts/CorporateOffice/index.html
> 
> Mainly I just want the  for my layout.html. I tried 
> adding this but it does not seem to work. Is there an easy way to do
> this?
> 
> Thanks.
> 

You must remember that "wrapper" is generic and from the current layout
it behaves based on the current CSS, so maybe woulbe be a good idea to
change the name and import the CSS from the layout you want to use.

Marco

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: 1054, "Unknown column in 'field list'... Help me

2014-06-05 Thread Mark Li
I've had this happen several times, and the solution provided in this link 
have worked for me.

http://comments.gmane.org/gmane.comp.python.web2py/42344

On Sunday, March 9, 2014 11:58:29 PM UTC-7, sujin...@gmail.com wrote:
>
> I had made MXPDEVICE table, and I added MXPPCPLATFORM table yesterday.
> Then definition of MXPDEVICE changed as below (Red color part).
>
> -
> db.define_table('MXPDEVICE',
> Field('NAME','string', notnull=True, label='Device'),
> Field('MODEL_NO','string', required=True),
> Field('PLATFORM_ID', db.MXPPLATFORM, ondelete='NO ACTION', 
> required=True, label='Platform'),
> Field('PLATFORM_VERSION',required=True),
> Field('PC_PLATFORM_ID', db.MXPPCPLATFORM, ondelete='NO ACTION', 
> required=True, label='PC Platform'),
> Field('PC_PLATFORM_VERSION',required=True),
> Field('DEVICE_INFO', 'text', required=True),
> Field('DEFAULT_TESTER_ID', db.MXPTESTER, required=True, ondelete='NO 
> ACTION', label = 'Tester'),
> Field('DEFAULT_TEST_DEVICE_YN', 'boolean', default=True),
> Field('USE_YN', 'boolean', default=True, writable=False, readable = 
> False ),
> Field('CREATED_ON',  'datetime', default=request.now,  writable=False 
> ),
> Field('UPDATED_ON',  'datetime', update=request.now,  writable=False 
>  ))
>
> -
>
> and then I got Error..
> ===
> Database db select
> Traceback
> Traceback (most recent call last):
>   File 
> "/home/mxptest/web2py/applications/mxpTest/controllers/appadmin.py", line 
> 270, in select
> *fields, limitby=(start, stop))
>   File "/home/mxptest/web2py/gluon/dal.py", line 10335, in select
> return adapter.select(self.query,fields,attributes)
>   File "/home/mxptest/web2py/gluon/dal.py", line 1831, in select
> return self._select_aux(sql,fields,attributes)
>   File "/home/mxptest/web2py/gluon/dal.py", line 1796, in _select_aux
> self.execute(sql)
>   File "/home/mxptest/web2py/gluon/dal.py", line 1916, in execute
> return self.log_execute(*a, **b)
>   File "/home/mxptest/web2py/gluon/dal.py", line 1910, in log_execute
> ret = self.cursor.execute(command, *a[1:], **b)
>   File "/usr/lib/pymodules/python2.7/MySQLdb/cursors.py", line 166, in 
> execute
> self.errorhandler(self, exc, value)
>   File "/usr/lib/pymodules/python2.7/MySQLdb/connections.py", line 35, in 
> defaulterrorhandler
> raise errorclass, errorvalue
> OperationalError: (1054, "Unknown column 'MXPDEVICE.PC_PLATFORM_ID' in 
> 'field list'")
> ===
> I thought it's because of migration.
> but even though I changed the option, It wasn't solved.
>
> Thank you for your answer!!
>
>
> -
>
>
> Hi.
> I tried adding new columns, but I got that error 1054, "Unknown column in 
> 'field list'.
> As web2py document
> (set fake_migrate=True and after the metadata has been rebuilt, set
> fake_migrate=False and migrate the table again).--- I'm using MySQL), I 
> did it but the problem was not solved.
> I searched and tried many things... change migration option, delete .table 
> file etc...  But It didn't work.
>
> Is anybody who knows solution? Help m
>
> Thank you so much!!! :)
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] routing problem

2014-06-05 Thread Júlia Rizza
Hello everybody,
 
I have an app with app specific routes and I have a function that allows 
any user to see a project by passing the project's owner username and the 
project's slug as args. I want the user to access the project just by 
www.domain.com/username/slug, not showing the function name, but it returns 
an 'invalid request' error when the slug contains hyphens.

*web2py/routes.py*



*#coding: utf-8routes_app = ((r'/(?Padmin)\b.*', r'\g'),  
(r'/(.*)', r'myapp'),  (r'/?(.*)', 
r'myapp'))myapp/routes.py*
#coding: utf-8

BASE = ''
routes_in = (
(BASE + '/', BASE + '/myapp/panel/index'),
(BASE + '/$username/$slug', BASE + 
'/myapp/panel/project/$username/$slug'),
)

routes_out = [(x, y) for (y, x) in routes_in]

For instance, if I have a project called 'Test', it's slug is 'test' and 
it's URL is www.domain.com/julia/test. And this works! But if I have a 
project called 'My Test', it's slug is 'my-test' and it's URL is 
www.domain.com/julia/my-test, returning an invalid request.

Is there a way to solve this?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py CMS

2014-06-05 Thread Derek
looks neat, your demo login and password is hidden though

On Thursday, June 5, 2014 5:47:48 AM UTC-7, Loïc wrote:
>
> Hi Andrey,
>
> I can not tell you what would be the *best* cms : I developped 
> tiny_website and my opinion would be biaised :-)
>
> You are the only one that knows if you need only basic features, or more 
> bell and whistles.
> Test each one during 5 minutes, and choose the one that fits your needs if 
> you are comfortable with.
>
> Regards
>
> Le dimanche 1 juin 2014 11:43:52 UTC+2, Andrey K a écrit :
>>
>> Thanks Yamandu and Massimo,
>> I will check it out. I have found several others:
>> https://github.com/espern/tiny_website
>> https://github.com/mdipierro/w2cms
>> Fabiano, I need it for my application, so content manager or designer 
>> could edit at least text and change colors without keep asking developer 
>> (me) to do it:)
>>
>>
>>
>> On Saturday, May 31, 2014 9:32:08 AM UTC+3, Massimo Di Pierro wrote:
>>>
>>> kpax is so old I would recommend it any more.
>>>
>>> On Friday, 30 May 2014 16:28:04 UTC-5, yamandu wrote:

 We have some options as I know.

 Kpax from Massimo
 http://vimeo.com/1098656
 https://github.com/mdipierro/web2py-appliances/tree/master/KPax2


 Quoca and Movuca (more lika a social app) from Bruno Rocha
 http://quokkaproject.org/
 https://github.com/rochacbruno/Movuca

 https://code.google.com/p/instant-press/


 2014-05-30 17:52 GMT-03:00 Fabiano Almeida :

> Hi Andrey,
>
> Do you need a blog?
>
>
> 2014-05-30 11:21 GMT-03:00 Andrey K :
>
> I am interested to add in CMS system for our web2py application.
>>  Quick search does not give me any solutions. Is there any CMS plugin 
>> already or any recipes on it?
>> Any thoughts, suggestions, links and comments would be very 
>> appreciated.
>> Thank you in advance!
>>
>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google 
>> Groups "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to web2py+un...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google 
> Groups "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to web2py+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



 -- 
 Att.

 Carlos J. Costa
 Cientista da Computação
 Esp. Gestão em Telecom

 EL MELECH NEEMAN!
 אָמֵן

 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] how can I insert a list db.table.insert -- It currently shows blank in SQLFORM

2014-06-05 Thread LoveWeb2py
I am assigning another tables id's to a list so I can reference them in my 
SQLFORM and allow users to click a link that will show them associated 
records.

I have a list with the other tables record ids such as: [1,6]

other_tables_id = [1,6]

I want to db.current_table.insert(other_tables_id=other_tables_id)

This works great with regular strings, but the list return blank values in 
SQLFORM and in the DB

How can I correctly populate the database?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how can I insert a list db.table.insert -- It currently shows blank in SQLFORM

2014-06-05 Thread LoveWeb2py
Please disregard the problem was I'm an idiot. Thank you.

On Thursday, June 5, 2014 6:34:36 PM UTC-4, LoveWeb2py wrote:
>
> I am assigning another tables id's to a list so I can reference them in my 
> SQLFORM and allow users to click a link that will show them associated 
> records.
>
> I have a list with the other tables record ids such as: [1,6]
>
> other_tables_id = [1,6]
>
> I want to db.current_table.insert(other_tables_id=other_tables_id)
>
> This works great with regular strings, but the list return blank values in 
> SQLFORM and in the DB
>
> How can I correctly populate the database?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] create a link SQLFORM to another table with id.belongs

2014-06-05 Thread LoveWeb2py
I have two tables: 

table1 & table 2

I compare table 2 events against table 1 and if it matches I insert it into 
table 2's field called "table2.table1_id"

table2.table1_id has thousands of rows that have the row id of table 1 in 
it in the form of a list.

Normally I could use the belongs feature, but I'm having a hard time 
getting it to work in the form of a link. Any thoughts on how I could do 
this?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-05 Thread Fabiano Almeida
I use this:

grid for table1
def index():
return dict(grid=SQLFORM.grid(Almoxarifado, links = [lambda row:
A('Listar Objetos',_href=URL('objeto','index',args=[row.id]))],
user_signature=False, csv=False))

grid for table2
def index():
if (not request.args)  and (not request.vars):
redirect(URL('almoxarifado','index'))
alm = None
if request.args: alm = request.args(0)
try:
if alm:
alm = int(alm)
session.almoxarifado=alm
session.nomealmox = Almoxarifado[alm].nome
except ValueError:
pass
Objeto.almoxarifado_id.default = session.almoxarifado
form = SQLFORM.grid(Objeto.almoxarifado_id == session.almoxarifado,
fields=[Objeto.nome, Objeto.quantidade, Objeto.localizacao],
user_signature=False, csv=False)
return dict(form=form, nome=session.nomealmox)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Uploading with SQLFORM.factory: specifying tablename component of filename

2014-06-05 Thread Spokes
When you upload a file with SQLFORM factory, the file is assigned a name 
along the lines of "no_table.[something1].[something2]...". If you've 
manually written the form validation/accept code, you can change the file 
name that is stored in the table by changing the form.vars.[name_of_field] 
variable corresponding to the file. I'm changing the "no_table" prefix of 
the filename to the name of the corresponding table, for example. This 
changes the table entry for the file name, but does not modify the name of 
the uploaded file itself. 

How does one modify the name of the file that is uploaded without using 
SQLFORM.factory's tablename argument? Thank you.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] create a link SQLFORM to another table with id.belongs

2014-06-05 Thread LoveWeb2py
This doesn't seem to work for me Fabiano,

When I click the button it just keeps table1 on the screen.  There has got 
to be an easier way (I hope)

On Thursday, June 5, 2014 7:41:51 PM UTC-4, Fabiano Almeida wrote:
>
> I use this:
>
> grid for table1
> def index():
> return dict(grid=SQLFORM.grid(Almoxarifado, links = [lambda row: 
> A('Listar Objetos',_href=URL('objeto','index',args=[row.id]))], 
> user_signature=False, csv=False))
>
> grid for table2
> def index():
> if (not request.args)  and (not request.vars): 
> redirect(URL('almoxarifado','index'))
> alm = None
> if request.args: alm = request.args(0)
> try:
> if alm:
> alm = int(alm)
> session.almoxarifado=alm
> session.nomealmox = Almoxarifado[alm].nome
> except ValueError:
> pass
> Objeto.almoxarifado_id.default = session.almoxarifado
> form = SQLFORM.grid(Objeto.almoxarifado_id == session.almoxarifado, 
> fields=[Objeto.nome, Objeto.quantidade, Objeto.localizacao], 
> user_signature=False, csv=False)
> return dict(form=form, nome=session.nomealmox)
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Uploading with SQLFORM.factory: specifying tablename component of filename

2014-06-05 Thread Michael Beller
web2py renames the file as a security measure to prevent directory 
traversal attacks.  You can read more about it here ...
http://www.web2py.com/books/default/search/29?search=traversal
and here ...
http://en.wikipedia.org/wiki/Directory_traversal_attack

As you point out, web2py stores the new file name in the upload field (that 
field initially contains the cgi.FieldStorage() object for the file itself 
and then it's replaced with the new file name).  Rather than store the 
original file name in that field, you may want to consider storing the 
original file name in a separate field.  You can do this using a compute 
field.

Field('original_file_name', compute=doc_filename)

and then ...

def doc_filename(row):
if request.vars.upload_field_name != None and not isinstance(request.
vars.upload_field_name, str):
return request.vars.upload_field_name.filename

Note that because request.vars. upload_field_name initially contains a 
cgi.FieldStorage() object you can't just use 
"if request.vars. upload_field_name" and since it is then replaced with the 
filename you need to test for the filename string for edits/updates.

Also note that I found the instructions in the book to store the original 
filename
(
http://www.web2py.com/books/default/chapter/29/07/forms-and-validators?search=original+filename#Storing-the-original-filename
)
was not sufficient to update the original filename for edit/update forms.

I also was able to also store the file size and file type using compute 
fields and these statements:

def doc_filetype(row):
if request.vars.upload_field_name != None and not isinstance(request.
vars.upload_field_name, str):
return request.vars.upload_field_name.filename.split('.')[-1]

def doc_filesize(row):
if request.vars.upload_field_name != None and not isinstance(request.
vars.upload_field_name, str):
return request.env.content_length


On Thursday, June 5, 2014 7:46:32 PM UTC-4, Spokes wrote:
>
> When you upload a file with SQLFORM factory, the file is assigned a name 
> along the lines of "no_table.[something1].[something2]...". If you've 
> manually written the form validation/accept code, you can change the file 
> name that is stored in the table by changing the form.vars.[name_of_field] 
> variable corresponding to the file. I'm changing the "no_table" prefix of 
> the filename to the name of the corresponding table, for example. This 
> changes the table entry for the file name, but does not modify the name of 
> the uploaded file itself. 
>
> How does one modify the name of the file that is uploaded without using 
> SQLFORM.factory's tablename argument? Thank you.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Formatting GRID rows data based on the field value in database

2014-06-05 Thread Sarbjit
Hi,

I am using GRID in my application, my requirement is that I want to display 
the field value in different color (RED/GREEN) OR I want to display the 
images (Tick Mark Image/Cross Mark Image) based upon the data in the field.

e.g. (Sample example)

Product_ID  Product_TitleProduct_SignOff
1   XZ   Yes
2   AV   Yes
3   AD   NO

I want it to be viewed in gird as :

Product_ID  Product_TitleProduct_SignOff
1   XZ   Yes
2   AV   Yes
3   AD   NO

OR
 any other additional indicator could be added such that the rows with 
Signoff value as NO could be easily identified (or highlighted). I was 
wondering, if I could use some images there (Green color Tick mark or Red 
color Cross mark) in the grid.

Since, I am not having much experience using web2py, can someone please 
help me to achieve this.

Thanks
Sarbjit




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py CMS

2014-06-05 Thread Loïc
hidden for security purpose...
BTW you can fork the repository in Web2py's "applications" forlder and give 
a try to the latest version in a few minutes

Le vendredi 6 juin 2014 00:33:22 UTC+2, Derek a écrit :
>
> looks neat, your demo login and password is hidden though
>
> On Thursday, June 5, 2014 5:47:48 AM UTC-7, Loïc wrote:
>>
>> Hi Andrey,
>>
>> I can not tell you what would be the *best* cms : I developped 
>> tiny_website and my opinion would be biaised :-)
>>
>> You are the only one that knows if you need only basic features, or more 
>> bell and whistles.
>> Test each one during 5 minutes, and choose the one that fits your needs 
>> if you are comfortable with.
>>
>> Regards
>>
>> Le dimanche 1 juin 2014 11:43:52 UTC+2, Andrey K a écrit :
>>>
>>> Thanks Yamandu and Massimo,
>>> I will check it out. I have found several others:
>>> https://github.com/espern/tiny_website
>>> https://github.com/mdipierro/w2cms
>>> Fabiano, I need it for my application, so content manager or designer 
>>> could edit at least text and change colors without keep asking developer 
>>> (me) to do it:)
>>>
>>>
>>>
>>> On Saturday, May 31, 2014 9:32:08 AM UTC+3, Massimo Di Pierro wrote:

 kpax is so old I would recommend it any more.

 On Friday, 30 May 2014 16:28:04 UTC-5, yamandu wrote:
>
> We have some options as I know.
>
> Kpax from Massimo
> http://vimeo.com/1098656
> https://github.com/mdipierro/web2py-appliances/tree/master/KPax2
>
>
> Quoca and Movuca (more lika a social app) from Bruno Rocha
> http://quokkaproject.org/
> https://github.com/rochacbruno/Movuca
>
> https://code.google.com/p/instant-press/
>
>
> 2014-05-30 17:52 GMT-03:00 Fabiano Almeida :
>
>> Hi Andrey,
>>
>> Do you need a blog?
>>
>>
>> 2014-05-30 11:21 GMT-03:00 Andrey K :
>>
>> I am interested to add in CMS system for our web2py application.
>>>  Quick search does not give me any solutions. Is there any CMS 
>>> plugin already or any recipes on it?
>>> Any thoughts, suggestions, links and comments would be very 
>>> appreciated.
>>> Thank you in advance!
>>>
>>>  -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, 
>>> send an email to web2py+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google 
>> Groups "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to web2py+un...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Att.
>
> Carlos J. Costa
> Cientista da Computação
> Esp. Gestão em Telecom
>
> EL MELECH NEEMAN!
> אָמֵן
>
> 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.