[web2py] Re: Application logging

2010-04-27 Thread omicron
In 'models' folder, i create the file named '0.py' like this :

def _init_log():
import os, logging, logging.handlers
logger = logging.getLogger(request.application)
logger.setLevel(logging.DEBUG)
handler =
logging.handlers.RotatingFileHandler(os.path.join(request.folder,'static','applog.txt'),'a',
1024*1024,1)
handler.setLevel(logging.DEBUG)
handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %
(filename)s:%(lineno)d %(funcName)s: %(message)s"))
logger.addHandler(handler)
return logger

app_logging = cache.ram('app_wide_log', lambda:_init_log(),
time_expire=None)

and now in my application, i can write this :

app_logging.info("My message")
or
app_logging.debug("x = %d" % myvar)

Et voilà !


On 27 avr, 18:31, knitatoms  wrote:
> I'd be interested in a step by step guide to setting up this kind of
> logging. I'm new to web2py and python and I think it would help my
> learning.
>
> I already get some good info by monitoring the http log file with the
> free Kiwi log viewer (on Windows) which tails the file.
>
> Could someone explain step by step how to set up the Python logging
> module to write to a file from a web2py application.  Thanks!
>
> On Apr 17, 8:37 pm, Keith Edmunds  wrote:
>
>
>
> > What are others doing for application logging? I'm not referring to the
> > HTTP logs, but program-generated logs.
>
> > I've recently been looking at the Python 'logging' module, which I've not
> > used before. I initiate logging from a file in the 'modules' directory
> > which does this:
>
> > --- 
> > -
> > import logging
> > from logging.handlers import SysLogHandler
>
> > logger = logging.getLogger("MyApp")
> > logger.setLevel(logging.DEBUG)
> > hdlr = SysLogHandler(address='/dev/log')
> > formatter = logging.Formatter('tigerpy[%(process)d]: %(levelname)s:
> > %(filename)s at line %(lineno)d: %(message)s') hdlr.setFormatter(formatter)
> > logger.addHandler(hdlr)
> > --- 
> > -
>
> > Then each file that I want to log from does this:
>
> > --- 
> > -
> > import logging
>
> > logger = logging.getLogger("MyApp")
> > .
> > .
> > logger.info("Something interesting happened")
> > --- 
> > -
>
> > This logs to syslog: the only problem is that each logging message is
> > written to syslog many (20-40) times(!). This isn't just in one place in
> > my code, but throughout. I don't think the code is being executed multiple
> > times, so I'm not sure why I'm getting so many log entries.
>
> > So, I'm interested in what others do to log application events.
>
> > --
> > Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en


[web2py:33442] A bug in version 1.68

2009-10-22 Thread omicron

I think a bug was inserted in version with the DAL insert procedure.
With version 1.67 and a Postgresql database encoded in UTF8, i can
insert french characters with accents without any conversion. But with
version 1.68.1 and 1.68.2 it's not possible. But i can update records
with french accents ! Very strange.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33448] Re: A bug in version 1.68

2009-10-22 Thread omicron

I don't use validators. Are sure nothing changed between 1.67 and
1.8 ?
I see in procedure "_insert" :
in version 1.67
try:
vs.append(sql_represent(value.id, ft, fd))
except:
vs.append(sql_represent(value, ft, fd))
and in version 1.68
if hasattr(value,'id'):
value = value.id
elif ft == 'string' and isinstance(value,
(str,unicode)):
value = str(value)[:field.length]
vs.append(sql_represent(value, ft, fd))


On 22 oct, 20:32, mdipierro  wrote:
> I am sure nothing changed in this respect. Are you using IS_UPPER,
> IS_LOWER validators? Other validators?
> What kind of errors do you get?
>
> On Oct 22, 1:16 pm, omicron  wrote:
>
> > I think a bug was inserted in version with the DAL insert procedure.
> > With version 1.67 and a Postgresql database encoded in UTF8, i can
> > insert french characters with accents without any conversion. But with
> > version 1.68.1 and 1.68.2 it's not possible. But i can update records
> > with french accents ! Very strange.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33493] Re: A bug in version 1.68

2009-10-22 Thread omicron

Yes, you are right. It's ok now with this patch.
Many thanks.

On 22 oct, 22:31, mdipierro  wrote:
> g you are right. Can you run a test for me? replace the code above
> with:
>
>                 if hasattr(value,'id'):
>                     value = value.id
>                 elif ft == 'string' and isinstance(value,
> (str,unicode)):
>                     value = value[:field.length]
>                 vs.append(sql_represent(value, ft, fd))
>
> Massimo
>
> On Oct 22, 1:57 pm, omicron  wrote:
>
> > I don't use validators. Are sure nothing changed between 1.67 and
> > 1.8 ?
> > I see in procedure "_insert" :
> > in version 1.67
> >                 try:
> >                     vs.append(sql_represent(value.id, ft, fd))
> >                 except:
> >                     vs.append(sql_represent(value, ft, fd))
> > and in version 1.68
> >                 if hasattr(value,'id'):
> >                     value = value.id
> >                 elif ft == 'string' and isinstance(value,
> > (str,unicode)):
> >                     value = str(value)[:field.length]
> >                 vs.append(sql_represent(value, ft, fd))
>
> > On 22 oct, 20:32, mdipierro  wrote:
>
> > > I am sure nothing changed in this respect. Are you using IS_UPPER,
> > > IS_LOWER validators? Other validators?
> > > What kind of errors do you get?
>
> > > On Oct 22, 1:16 pm, omicron  wrote:
>
> > > > I think a bug was inserted in version with the DAL insert procedure.
> > > > With version 1.67 and a Postgresql database encoded in UTF8, i can
> > > > insert french characters with accents without any conversion. But with
> > > > version 1.68.1 and 1.68.2 it's not possible. But i can update records
> > > > with french accents ! Very strange.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:33509] Re: cross doman json-rpc

2009-10-23 Thread omicron

I'm using QooxDoo / Web2Py with JSonRpc in several applications and
don't need special features in Web2py. If you want crossdomain feature
in QooxDoo you must set the crossDomain property to true:
var rpc = new qx.io.remote.Rpc("http://targetdomain.com/appname/
function/call/jsonrpc");
rpc.setCrossDomain(true);

On 23 oct, 16:01, Don Lee  wrote:
> I do not need cross domain call blocking.  But I guess it would be a
> good feature to have.  I am experiencing a problem with qooxdoo's
> cross domain call setup, and I wanted to make sure there wasn't
> something within web2py that I should configure as well.  Now I have
> to go and gather some data so that I can bug the qooxdoo mailing list
> .  Thanks for the help.
>
> On Fri, Oct 23, 2009 at 9:48 AM, mdipierro  wrote:
>
> > There is nothing in the JSONRPC to do it but you can block those calls
> > from outside using routes. It is not that user friendly. Let me think
> > about this. If poeple have any idea let me know.
>
> > On Oct 23, 8:24 am, Don Lee  wrote:
> >> Is there anything within web2py's json-rpc implementation that would
> >> prevent cross domain calls?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34604] Maintain backward compatibility, but ...

2009-11-04 Thread omicron

With version 1.71.1 I have two problems:
 * Rows object has no longer attribute "response" ? Before
Rows.response was what I want to send to QooxDoo to populate table
models. Now I must construct my list with iterator ?
 * I have a pb with json_rpc : Example I call a function with
parameters, for example "insert(name)"; with 1.69.0 it's Ok but with
1.71.1 the code for inserting record is executed, but the result can't
be returned to QooxDoo without error. The error is : "'NoneType'
object is not callable".
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:34619] Re: Maintain backward compatibility, but ...

2009-11-04 Thread omicron



On 4 nov, 19:28, mdipierro  wrote:
> On Nov 4, 12:22 pm, omicron  wrote:
>
> > With version 1.71.1 I have two problems:
> >  * Rows object has no longer attribute "response" ? Before
> > Rows.response was what I want to send to QooxDoo to populate table
> > models. Now I must construct my list with iterator ?
>
> Rows.response was an internal thing. Technically by removing it we did
> not break backward compatibility. Moreover it contained data in a back-
> end dependent representation.
>
> You should use:
>
> Rows.as_list() and/or Rows.as_list(compact=False)


With priors versions, and with PostgreSQL, Rows.response return a list
of lists.
Now Rows.as_list return a list of dicts or a list of rows. For
QooxDoo, table
model is populated with a list of lists. I'll construct by hand !


>
> >  * I have a pb with json_rpc : Example I call a function with
> > parameters, for example "insert(name)"; with 1.69.0 it's Ok but with
> > 1.71.1 the code for inserting record is executed, but the result can't
> > be returned to QooxDoo without error. The error is : "'NoneType'
> > object is not callable".
>
> Can you provide an example?
>
> Can you try int(insert()) would it fix the problem?


Yeah ! With 1.71.1 DAL method insert return a 'gluon.sql.Reference'
object,
not an 'int'. The problem is fixed with "return int(id)" to QooxDoo. I
think
simplejson can't serialize a 'gluon.sql.Reference' object ?


>
> Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:36808] Re: testing web2py's jsonrpc service using the python interactive shell

2009-12-08 Thread omicron
Two things to verifiy :
1/ Try this : s = jsonrpclib.ServerProxy("http://localhost:8000/
pledgedrives/default/call/jsonrpc",verbose=1)
2/ The "call" function is defined ?
def call():
session.forget()
return service()


On 8 déc, 19:58, johntynan  wrote:
> I am looking in the admin and do not see any tickets for the error.
> So, web2py is not getting the request.
>
> On Dec 8, 11:19 am, mdipierro  wrote:
>
> > check the tickets in admin and see if web2py is getting the request
> > and what is the error
>
> > On Dec 8, 10:10 am, johntynan  wrote:
>
> > > One note.  I also receive the same error when using this url:
>
> > > s = jsonrpclib.ServerProxy("http://localhost:8000/pledgedrives/default/
> > > service/",verbose=1)
>
> > > On Dec 8, 9:07 am, johntynan  wrote:
>
> > > > I have a question about testing web2py's jsonrpc service using the
> > > > python interactive shell.
>
> > > > In looking at the web2py pyjamas todo application as a starting point,
> > > > and noticed the following code in the tests folder:
>
> > > > import jsonrpclib
>
> > > > s = jsonrpclib.ServerProxy("http://localhost:8000/todo/default/
> > > > service",
> > > >                           verbose=1)
> > > > reply = s.getTasks()
> > > > print reply
>
> > > > I found that I needed to download Matt Harrison's jsonrpclib 
> > > > fromhttp://lkcl.net/jsonrpclib.tgzandplacethejsonrpclib.py file
> > > > somewhere within my python path
>
> > > > After that, I decorated a class in my web2py app with
> > > > @service.jsonrpc:
>
> > > >http://code.google.com/p/pledgedrivetracker/source/browse/pledgedrive...
>
> > > > Then, I tried to connect to the web2py jsonrpc service from within the
> > > > python shell using this script:
>
> > > > >>> s = 
> > > > >>> jsonrpclib.ServerProxy("http://localhost:8000/pledgedrives/default/call/",verbose=1)
> > > > >>> reply = s.service_pledgedrive_pledges('1')
>
> > > > Only I receive the following error:
>
> > > > connect: (localhost, 8000)
> > > > send: 'POST /pledgedrives/default/call/ HTTP/1.0\r\nHost: localhost:
> > > > 8000\r\nUser-Agent: jsonlib.py/0.0.1 (by matt harrison)\r\nContent-
> > > > Type: text/xml\r\nContent-Length: 67\r\n\r\n'
> > > > send: '{"params": ["1"], "method": "service_pledgedrive_pledges",
> > > > "id": 6}'
> > > > reply: 'HTTP/1.1 400 BAD REQUEST\r\n'
> > > > header: Set-Cookie:
> > > > session_id_pledgedrives=127-0-0-1-1bb105e6-9359-4a9e-
> > > > a776-6915963c26ed; Path=/
> > > > header: Content-Length: 534
> > > > header: Content-Type: text/html; charset=UTF-8
> > > > header: Date: Tue, 08 Dec 2009 14:54:13 GMT
> > > > header: Server: CherryPy/3.2.0beta WSGI Server
> > > > Traceback (most recent call last):
> > > >   File "", line 1, in 
> > > >   File "jsonrpclib.py", line 136, in __call__
> > > >     return self.__send(self.__name, args)
> > > >   File "jsonrpclib.py", line 382, in __request
> > > >     verbose=self.__verbose
> > > >   File "jsonrpclib.py", line 179, in request
> > > >     response
> > > > jsonrpclib.ProtocolError:  > > > pledgedrives/default/call/: 400 BAD REQUEST>
>
> > > > Is it possible to tell if I am using the wrong syntax when calling
> > > > jsonrpclib.ServerProxy or else where in my script?

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.




[web2py] Cannot import module 'lpod'

2012-11-13 Thread omicron
With web2py 1.99.7 this import was Ok :
import lpod.document as oodoc

But with version 2.2.1, I have this error :
  File "/home/myhome/Applications/web2py/gluon/custom_import.py", line 77, 
in custom_importer
raise ImportError, 'Cannot import module %s' % str(e)
  ImportError: Cannot import module 'lpod'

But if I replace with this:
  import lpod
It's ok !!!

And, of course, in a python shell it's ok.

Thanks

-- 





[web2py] Re: Cannot import module 'lpod'

2012-11-15 Thread omicron
I use an Ubuntu 12.04LTS, python 2.7 and web2py 2.2.1
lpod is installed in /usr/local/lib/python2.7/dist-packages, and it's an egg

import lpod.document as oodoc -> import error
import lpod.document -> import error
import ldoc -> no import error, but error document isn't found in lpod 
module

And, I repeat, with python shell and web2py 1.99.7 it's ok (i make a new 
test this morning)

And now, if i copy the lpod folder from the egg to :

   - web2py/site-packages folder -> import error
   - web2py/applications/myapp/modules -> it's ok !!!
   
So i have a solution, but it's strange. 
Perhaps the lpod library is particular, because this code is ok inweb2py 
2.2.1 : import dateutil.relativedelta as rd


Le mercredi 14 novembre 2012 15:26:28 UTC+1, Massimo Di Pierro a écrit :
>
> Moreover. Where is lpod? How was it installed?
>
> On Wednesday, 14 November 2012 08:26:09 UTC-6, Massimo Di Pierro wrote:
>>
>> Does it work if you simply do:  import lpod.document  ?
>>
>>
>> On Tuesday, 13 November 2012 04:37:43 UTC-6, omicron wrote:
>>>
>>> With web2py 1.99.7 this import was Ok :
>>> import lpod.document as oodoc
>>>
>>> But with version 2.2.1, I have this error :
>>>   File "/home/myhome/Applications/web2py/gluon/custom_import.py", line 
>>> 77, in custom_importer
>>> raise ImportError, 'Cannot import module %s' % str(e)
>>>   ImportError: Cannot import module 'lpod'
>>>
>>> But if I replace with this:
>>>   import lpod
>>> It's ok !!!
>>>
>>> And, of course, in a python shell it's ok.
>>>
>>> Thanks
>>>
>>>

-- 





[web2py] Re: Cannot import module 'lpod'

2012-11-27 Thread omicron
And with CentOS 6.3 and his Python 2.6, this problem doesn't exist !!!

Le jeudi 15 novembre 2012 12:24:16 UTC+1, omicron a écrit :
>
> I use an Ubuntu 12.04LTS, python 2.7 and web2py 2.2.1
> lpod is installed in /usr/local/lib/python2.7/dist-packages, and it's an 
> egg
>
> import lpod.document as oodoc -> import error
> import lpod.document -> import error
> import ldoc -> no import error, but error document isn't found in lpod 
> module
>
> And, I repeat, with python shell and web2py 1.99.7 it's ok (i make a new 
> test this morning)
>
> And now, if i copy the lpod folder from the egg to :
>
>- web2py/site-packages folder -> import error
>- web2py/applications/myapp/modules -> it's ok !!!
>
> So i have a solution, but it's strange. 
> Perhaps the lpod library is particular, because this code is ok inweb2py 
> 2.2.1 : import dateutil.relativedelta as rd
>
>
> Le mercredi 14 novembre 2012 15:26:28 UTC+1, Massimo Di Pierro a écrit :
>>
>> Moreover. Where is lpod? How was it installed?
>>
>> On Wednesday, 14 November 2012 08:26:09 UTC-6, Massimo Di Pierro wrote:
>>>
>>> Does it work if you simply do:  import lpod.document  ?
>>>
>>>
>>> On Tuesday, 13 November 2012 04:37:43 UTC-6, omicron wrote:
>>>>
>>>> With web2py 1.99.7 this import was Ok :
>>>> import lpod.document as oodoc
>>>>
>>>> But with version 2.2.1, I have this error :
>>>>   File "/home/myhome/Applications/web2py/gluon/custom_import.py", line 
>>>> 77, in custom_importer
>>>> raise ImportError, 'Cannot import module %s' % str(e)
>>>>   ImportError: Cannot import module 'lpod'
>>>>
>>>> But if I replace with this:
>>>>   import lpod
>>>> It's ok !!!
>>>>
>>>> And, of course, in a python shell it's ok.
>>>>
>>>> Thanks
>>>>
>>>>

-- 





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] Re: Modules: how to access db

2012-02-09 Thread omicron
With the last version, you can do this :

from gluon import current

dba = current.globalenv['db']



[web2py] Re: Web2py MVC and Qooxdoo

2011-10-19 Thread omicron
Why not jsonrpc ?

In web2py, i use decorator like this :
@service.jsonrpc
def insert(code, libelle, cours=1.0):
try:
id = dba.devise.insert(code=code, libelle=libelle)
except:
dba.rollback()
raise Exception(sys.exc_info()[1])
else:
dba.commit()
return int(id)

And with QooxDoo :
var rpc = new qx.io.remote.Rpc('/myapp/devise/call/jsonrpc');
rpc.addListener('completed', function(e) {
var id = e.getData().result;
...
this.close();
}, this);
rpc.addListener('failed', function(e) {
alert("Erreur RPC: " + e.getData().message);
});
rpc.callAsyncListeners(true, 'insert', this.code.getValue(),
this.libelle.getValue());



On 20 oct, 00:16, Phyo Arkar  wrote:
> Here it is.
>
> Check it out.
>
> http://code.google.com/p/herspos
>
> :)
>
> On 10/20/11, Phyo Arkar  wrote:
>
>
>
>
>
>
>
> > Yes,
>
> > I was writing a POS application for my wife's sushi shop as a practice
> > . I am enjoyingQooXDooA Lot now.
>
> > Its unfinished but already usable for adding Items and record. You
> > will get whole idea.
>
> > Now i am going to Release it as Opensource, so Everyone can use and
> > contribute too.
>
> > I am uploading to googlecode now.
>
> > Thanks
>
> > Phyo.
>
> > On 10/18/11, wwwgong  wrote:
> >> Hi Phyo,
> >> I have exactly the same question as yours when you first started this
> >> thread 1 month ago.
> >> can you share your working sample withqooxdooand web2py integration?
> >> I am interested in usingQooxdoofor custom UI in front of web2py.
> >> Thanks,
> >> Wen
>
> >> my email=wen.g.g...@gmail.com
>
> >> On Sep 19, 3:31 pm, Phyo Arkar  wrote:
> >>> yeah , how abt retrofittingQooxdoointo pyjamas? it should work. It
> >>> will be easier. Then introduce it into web2py how thats soudns? I only
> >>> tested pyjamas a bit.
>
> >>> after coding mnore and more inQooxdoo,I realize jquery-UI main
> >>> weakness is making user depending on html and css , and selectors.
> >>> Actually that wont work for application style UIs.
>
> >>> why i like about  qooxdoois i never (really never) have to look back
> >>> at html and CSS at all. another main point is as i am a java hater ,
> >>> even thoqooxdoocode is much like java its still in javascript so its
> >>> a lot easier.And not like GWT it dont need java to do anything at all
> >>> just python to generate and compile code :) .
>
> >>> On 9/20/11, Ross Peoples  wrote:
>
> >>> > I have been looking atqooxdooas a replacement for jQuery UI for quite
> >>> > a
> >>> > while, since they seem to have a nice set of widgets. I don't know why
> >>> > it
> >>> > takes the jQuery UI team over a year to make a menubar widget (that's
> >>> > still
> >>> > not finished), when you could probably write your own high-quality
> >>> > version
> >>> > in a couple of days. That is the one thing that really bugs me about
> >>> > jQuery
> >>> > UI: the seemingly stagnent development pace. I understand that things
> >>> > like
> >>> > accessibility take a little more time, but other frameworks (and even
> >>> > individuals) can crank out new widgets in no time that are sometimes
> >>> > higher
> >>> > quality than the jQuery UI ones. (end rant)
>
> >>> > Anyways, as you mentioned, web2py is focused more on traditional HTML.
> >>> >Qooxdooseems to generate its own HTML based on the JavaScript code you
> >>> > enter (like with desktop programming). It seems more like an AJAX
> >>> > application builder rather than an HTML additive, like jQuery. Before
> >>> > coming
> >>> > to web2py, I evaluated Vaadin, which is a Java server/client
> >>> > integrated
> >>> > framework that is built on Google Web Toolkit (like pyjamas is). Only
> >>> > you
> >>> > program everything in Java. It's pretty powerful and the widgets were
> >>> > the
> >>> > best I've ever seen (quite a lot of them too). The only problem with
> >>> > it
> >>> > though is that trying to do something that would be simple with HTML
> >>> > and
> >>> > JavaScript would require you to make your own widget and recompile the
> >>> > entire widget set. It was great for working inside the box, but way
> >>> > too
> >>> > difficult if you wanted to step outside the box.
>
> >>> > Enough with the babbling: what we would need to do is make
> >>> > aqooxdoohelper
> >>> > that can generate JS code for the widgets. However, it might just be
> >>> > easier
> >>> > for everyone to write their own JavaScript, since it's well documented
> >>> > on
> >>> > theqooxdoosite. As for the AJAX communications, according to
> >>> > theqooxdoo
> >>> > site:http://manual.qooxdoo.org/1.4.x/pages/communication/rpc.htmlthey
> >>> > use
> >>> > JSON-RPC, which web2py already supports. They also have a Python RPC
> >>> > server
> >>> > (for an older version of
> >>> >qooxdoo):http://qooxdoo.org/contrib/project/rpcpythonsothat could
> >>> > probably integrated into a web2py plugin or contrib module. Source
> >>> > link:
> >>> >https://qooxdoo-contrib.svn.sourceforge.net/svnroot/qooxdoo-contrib/t...
>
> >>>

[web2py] Re: Error: Start as Windows Service

2011-10-20 Thread omicron
And if you change ip = '0.0.0.0' and comment the line 'interfaces' ?

On 20 oct, 08:36, toan75  wrote:
> Yes, i renamed options_std.py to options.py.
>
> import socket
> import os
>
> ip = '192.168.0.1'
> port = 80
> interfaces=[('0.0.0.0',80),('0.0.0.0',443,'ssl_private_key.pem','ssl_certif 
> icate.pem')]
> password = ''  # ##  means use the previous password
> pid_filename = 'httpserver.pid'
> log_filename = 'httpserver.log'
> profiler_filename = None
> #ssl_certificate = 'ssl_certificate.pem'  # ## path to certificate file
> #ssl_private_key = 'ssl_private_key.pem'  # ## path to private key file
> #numthreads = 50 # ## deprecated; remove
> minthreads = None
> maxthreads = None
> server_name = socket.gethostname()
> request_queue_size = 5
> timeout = 30
> shutdown_timeout = 5
> folder = os.getcwd()
> extcron = None
> nocron = None


[web2py] Re: Web2py MVC and Qooxdoo

2011-10-20 Thread omicron
Wikipedia is you friend http://en.wikipedia.org/wiki/JSON-RPC
and read this http://manual.qooxdoo.org/1.5.x/pages/communication/rpc.html

On 20 oct, 09:47, Phyo Arkar  wrote:
> I have not dig into JSON RPC of web2py and qooxdoo yet ,
>
> Thank you soo much for giving me.
>
> I will try to replace with JSON RPC.
>
> Can you also list me advantages?
>
> Thanks.
>
> Phyo.
>
> On 10/20/11, omicron  wrote:
>
>
>
>
>
>
>
> > Why not jsonrpc ?
>
> > In web2py, i use decorator like this :
> > @service.jsonrpc
> > def insert(code, libelle, cours=1.0):
> >     try:
> >         id = dba.devise.insert(code=code, libelle=libelle)
> >     except:
> >         dba.rollback()
> >         raise Exception(sys.exc_info()[1])
> >     else:
> >         dba.commit()
> >         return int(id)
>
> > And with QooxDoo :
> > var rpc = new qx.io.remote.Rpc('/myapp/devise/call/jsonrpc');
> > rpc.addListener('completed', function(e) {
> >     var id = e.getData().result;
> >    ...
> >     this.close();
> > }, this);
> > rpc.addListener('failed', function(e) {
> >     alert("Erreur RPC: " + e.getData().message);
> > });
> > rpc.callAsyncListeners(true, 'insert', this.code.getValue(),
> > this.libelle.getValue());
>
> > On 20 oct, 00:16, Phyo Arkar  wrote:
> >> Here it is.
>
> >> Check it out.
>
> >>http://code.google.com/p/herspos
>
> >> :)
>
> >> On 10/20/11, Phyo Arkar  wrote:
>
> >> > Yes,
>
> >> > I was writing a POS application for my wife's sushi shop as a practice
> >> > . I am enjoyingQooXDooA Lot now.
>
> >> > Its unfinished but already usable for adding Items and record. You
> >> > will get whole idea.
>
> >> > Now i am going to Release it as Opensource, so Everyone can use and
> >> > contribute too.
>
> >> > I am uploading to googlecode now.
>
> >> > Thanks
>
> >> > Phyo.
>
> >> > On 10/18/11, wwwgong  wrote:
> >> >> Hi Phyo,
> >> >> I have exactly the same question as yours when you first started this
> >> >> thread 1 month ago.
> >> >> can you share your working sample withqooxdooand web2py integration?
> >> >> I am interested in usingQooxdoofor custom UI in front of web2py.
> >> >> Thanks,
> >> >> Wen
>
> >> >> my email=wen.g.g...@gmail.com
>
> >> >> On Sep 19, 3:31 pm, Phyo Arkar  wrote:
> >> >>> yeah , how abt retrofittingQooxdoointo pyjamas? it should work. It
> >> >>> will be easier. Then introduce it into web2py how thats soudns? I only
> >> >>> tested pyjamas a bit.
>
> >> >>> after coding mnore and more inQooxdoo,I realize jquery-UI main
> >> >>> weakness is making user depending on html and css , and selectors.
> >> >>> Actually that wont work for application style UIs.
>
> >> >>> why i like about  qooxdoois i never (really never) have to look back
> >> >>> at html and CSS at all. another main point is as i am a java hater ,
> >> >>> even thoqooxdoocode is much like java its still in javascript so its
> >> >>> a lot easier.And not like GWT it dont need java to do anything at all
> >> >>> just python to generate and compile code :) .
>
> >> >>> On 9/20/11, Ross Peoples  wrote:
>
> >> >>> > I have been looking atqooxdooas a replacement for jQuery UI for
> >> >>> > quite
> >> >>> > a
> >> >>> > while, since they seem to have a nice set of widgets. I don't know
> >> >>> > why
> >> >>> > it
> >> >>> > takes the jQuery UI team over a year to make a menubar widget
> >> >>> > (that's
> >> >>> > still
> >> >>> > not finished), when you could probably write your own high-quality
> >> >>> > version
> >> >>> > in a couple of days. That is the one thing that really bugs me about
> >> >>> > jQuery
> >> >>> > UI: the seemingly stagnent development pace. I understand that
> >> >>> > things
> >> >>> > like
> >> >>> > accessibility take a little more time, but other frameworks (and
> >> >>> > even
> >

[web2py] Gluon contrib json encoder

2011-05-06 Thread omicron
Before, the encoder have :

"""Implementation of JSONEncoder
Modified by Massimo Di Pierro to handle datetime
"""

and now it's not the case in the last stable version ?


[web2py] Re: Gluon contrib json encoder

2011-05-06 Thread omicron
Yes. But my problem is with jsonrpc service. There is a bug in
tools.py, line 3554 :
replace "return simplejson.dumps(..."
by "return serializers.json(..."


On 6 mai, 18:49, Mathew Grabau  wrote:
> For me to overcome the issues specified by this I switched to using:
>
> return response.json(...stuff to return...)
>
> The datetime encoder is not in there anymore and it was causing me
> trouble. This corrected the issue.
>
> On May 6, 8:20 am, omicron  wrote:
>
>
>
> > Before, the encoder have :
>
> > """Implementation of JSONEncoder
> > Modified by Massimo Di Pierro to handle datetime
> > """
>
> > and now it's not the case in the last stable version ?


[web2py] Modification in version 2.14.6 not documented ?

2016-06-03 Thread omicron
I have just seen this modification for parameter 'exportclasses' in grids. 
The manual say "If you pass a dict like 
dict(xml=False, html=False)

you will disable the xml and html export formats", but with the last 
version you must change you code to pass a dict like this 
dict(tablename = dict(xml=False, html=False))


And it's the same for other dicts options like "maxtextlength" for example.


-- 
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: Modification in version 2.14.6 not documented ?

2016-06-03 Thread omicron
It's on smartgrid for my application

Le vendredi 3 juin 2016 20:24:41 UTC+2, Niphlod a écrit :
>
> is this on grid or smartgrid ?
>
> On Friday, June 3, 2016 at 7:15:33 PM UTC+2, omicron wrote:
>>
>> I have just seen this modification for parameter 'exportclasses' in 
>> grids. The manual say "If you pass a dict like 
>> dict(xml=False, html=False)
>>
>> you will disable the xml and html export formats", but with the last 
>> version you must change you code to pass a dict like this 
>> dict(tablename = dict(xml=False, html=False))
>>
>>
>> And it's the same for other dicts options like "maxtextlength" for 
>> example.
>>
>>
>>

-- 
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: Modification in version 2.14.6 not documented ?

2016-06-06 Thread omicron
I want to believe you, but in version 2.13.4 the code for smatgrid is 
# filter out data info for displayed table
if table._tablename in constraints:
query = query & constraints[table._tablename]
if isinstance(links, dict):
links = links.get(table._tablename, [])
for key in 
'columns,orderby,searchable,sortable,paginate,deletable,editable,details,selectable,create,fields'
.split(','):
if isinstance(kwargs.get(key, None), dict):
if table._tablename in kwargs[key]:
kwargs[key] = kwargs[key][table._tablename]
else:
del kwargs[key]
check = {}

and in 2.14.6 I see :
# filter out data info for displayed table
if table._tablename in constraints:
query = query & constraints[table._tablename]
if isinstance(links, dict):
links = links.get(table._tablename, [])
for key in ('fields', 'field_id', 'left', 'headers', 'orderby', 
'groupby', 'searchable',
'sortable', 'paginate', 'deletable', 'editable', 
'details', 'selectable',
'create', 'csv', 'links', 'links_in_grid', 'upload', 
'maxtextlengths',
'maxtextlength', 'onvalidation', 'onfailure', 'oncreate'
, 'onupdate',
'ondelete', 'sorter_icons', 'ui', 'showbuttontext', 
'_class', 'formname',
'search_widget', 'advanced_search', 'ignore_rw', 
'formstyle', 'exportclasses',
'formargs', 'createargs', 'editargs', 'viewargs', 
'selectable_submit_button',
'buttons_placement', 'links_placement', 'noconfirm', 
'cache_count', 'client_side_delete',
'ignore_common_filters', 'auto_pagination', 'use_cursor'
   ):
if isinstance(kwargs.get(key, None), dict):
if table._tablename in kwargs[key]:
kwargs[key] = kwargs[key][table._tablename]
else:
        del kwargs[key]
check = {}

So, to hide the export buttons I must adapt my controller between this 2 
versions. If not, where i am wrong ?

Le vendredi 3 juin 2016 22:11:46 UTC+2, Anthony a écrit :
>
> The documentation you quote is for SQLFORM.grid, but you are using 
> SQLFORM.smartgrid, which lets you use most of the grid parameters, but 
> within a dictionary keyed for each table of the smartgrid. Nothing has 
> changed.
>
> Anthony
>
> On Friday, June 3, 2016 at 3:33:36 PM UTC-4, omicron wrote:
>>
>> It's on smartgrid for my application
>>
>> Le vendredi 3 juin 2016 20:24:41 UTC+2, Niphlod a écrit :
>>>
>>> is this on grid or smartgrid ?
>>>
>>> On Friday, June 3, 2016 at 7:15:33 PM UTC+2, omicron wrote:
>>>>
>>>> I have just seen this modification for parameter 'exportclasses' in 
>>>> grids. The manual say "If you pass a dict like 
>>>> dict(xml=False, html=False)
>>>>
>>>> you will disable the xml and html export formats", but with the last 
>>>> version you must change you code to pass a dict like this 
>>>> dict(tablename = dict(xml=False, html=False))
>>>>
>>>>
>>>> And it's the same for other dicts options like "maxtextlength" for 
>>>> example.
>>>>
>>>>
>>>>

-- 
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] Connect to MSSQL with FreeTDS - [FreeTDS][SQL Server]Incorrect syntax near ';'. (102) (SQLExecDirect

2016-12-31 Thread Omicron VT
I an trying to connect to MSSQL DB.

Cannot connect using this string :
DB1 = DAL('mssql://user:pass@server/schema')

so i have found this string to work:
DB1 = DAL('mssql://user:pass@server/schema?DRIVER={FreeTDS}')

but reading records from a table get me this error :

[FreeTDS][SQL Server]Incorrect syntax near ';'. (102) (SQLExecDirectW)

Any ideas ? 

-- 
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] websocket_messaging.py error on multiple connections

2017-01-23 Thread Omicron VT
Following the example in websocket_messaging.py i have this config:

A tv.html view that refresh its content when an event on client.html sends 
a message to group1

All of this works fine if tv.html is opened only 1 time. 

When i open tv.html more than one time when first message is sended, 
tv.html begins an infinite loop refreshing for ever.

Any ideas ?  

-- 
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] SQLFORM.grid orderby by links

2016-02-17 Thread Omicron VT
In SQLFORM.grid is possible to order the results by a links field ?

Example :

links = [{'header':'ValueX2', 'body' : lambda row : row.value*2}]
orderby = HERE IS WHERE MY QUESTION GOES
grid = SQLFORM.grid(db.mydb , links=links,orderby=orderby)

-- 
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] DAL query CONVERT field

2018-03-12 Thread Omicron VT
Is possible to create a query in DAL to obtain this ?

SELECT * FROM table1 WHERE CONVERT(VARCHAR, field1) LIKE '%somestring%' 

where field1 is an INT type field ?

Thanks 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Can start cron in 2.17.1

2018-08-14 Thread Omicron VT
Trying to start the cron with -Y option gives me an error:

" TypeError: argument of type 'NoneType' is not iterable "

Any ideas. 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] Pyfpdf - Split multicell from DB template

2017-06-15 Thread Omicron VT
Is it possible to use the split_multicell option to show a text field from 
a template stored in the DB ? 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] ERROR : ImportError: No module named gluon.utils in websocket_messaging.py after upgrade to 2.15.4

2017-11-01 Thread Omicron VT
I have been using websocket_messaging.py without problems in version 
2.14.6. After upgrading to 2.15.4 i can not start websocket_messaging 
anymore, iget this error :
ImportError: No module named gluon.utils

Any help ? 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] Re: ERROR : ImportError: No module named gluon.utils in websocket_messaging.py after upgrade to 2.15.4

2017-11-01 Thread Omicron VT


El miércoles, 1 de noviembre de 2017, 9:17:45 (UTC-3), Omicron VT escribió:
>
> I have been using websocket_messaging.py without problems in version 
> 2.14.6. After upgrading to 2.15.4 i can not start websocket_messaging 
> anymore, iget this error :
> ImportError: No module named gluon.utils
>
> Any help ? Thanks
>

Yes, but no solution.

I think this lines(96-97) in messaging_websocket.py are the problem :
import gluon.utils
from gluon._compat import to_native, to_bytes, urlencode, urlopen

and if i try to import /gluon/utils.py from python console i get a similar 
error:
  File "utils.py", line 30, in 
from gluon._compat import basestring, pickle, PY2, xrange, to_bytes, 
to_native
ImportError: No module named gluon._compat


-- 
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: websockets with web2py

2017-11-03 Thread Omicron VT
I think you have problem1 of this issue: 
https://github.com/web2py/web2py/issues/1696

El domingo, 25 de septiembre de 2016, 17:46:02 (UTC-3), José Borba escribió:
>
> Hello, there,
>
> I'm using web2py on Cloud9[1], and web2py works well. I'm working on an 
> app that need websockets, following a Bruno Rocha video [2]. So, when I 
> start the websockets module, python returns an error:  
>
>
> Traceback (most recent call last):
>   File "gluon/contrib/websocket_messaging.py", line 96, in 
> import gluon.utils
> ImportError: No module named gluon.utils
>
>
> The module is in the correct directory (web2py was installed with git 
> clone), and I can't understand where is the error. Maybe this is so basic 
> that I'm over there and can't see.
>
> Thanks for any help,
>
> [1] - https://c9.io
> [2] - 
> http://brunorocha.org/python/web2py/websockets-com-tornado-web2py-python-jquery.html
>
> -- 
> José Ricardo Borba
>
>

-- 
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: ERROR : ImportError: No module named gluon.utils in websocket_messaging.py after upgrade to 2.15.4

2017-11-03 Thread Omicron VT
Answer to myself:

Maybe solution to problem1 of this issue is the key : 
https://github.com/web2py/web2py/issues/1696

El miércoles, 1 de noviembre de 2017, 9:17:45 (UTC-3), Omicron VT escribió:
>
> I have been using websocket_messaging.py without problems in version 
> 2.14.6. After upgrading to 2.15.4 i can not start websocket_messaging 
> anymore, iget this error :
> ImportError: No module named gluon.utils
>
> Any help ? 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] SQLFORM - update record, save datetime to table field

2018-02-02 Thread Omicron VT
I have a db table with a datetime field to save last update/creation date.

Field('fecha_update', 'datetime', default=request.now)

My question is : How i can save the update time of a record when i do it 
through sqlform.grid ?


-- 
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] Include javascript file in layout.html

2019-05-29 Thread Omicron VT
I am trying to include Tabulator JS in layout.html but i can not make it 
work.

If I include the files in the head section of view it works OK. 

But if I include them on the head section of layout.html and then in view i 
use extend 'layout.html' it can not find it.

In sure is me, but i can not figure out.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b7d60f99-a1a0-4a3d-8fcb-12a6654bf83c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.