Re: [web2py] How to update web app on server without change the data already in database

2013-01-21 Thread selecta
as Johann already mentioned overwriting all your .py files will not change 
you database so you should be fine doing that
if you do not wan to do this manually you can e.g. 

use a version control system and exclude the content of the databases 
directory 
then on the client side all you have to do is svn up or hg pull; hg update
I have worked with that for a couple of years and it works fine, but there 
are some small issues that you have to take into account.

similar should works with sync tools if they work with ignore patterns

or create you own update mechanism. this is what i ended up doing since i 
do not want extra software on the locations where my client apps run. so I 
created plugin_release for pyMantis 
https://sourceforge.net/scm/?type=hg&group_id=304012&source=navbar which is 
similar to the web2py packaging mechanism (I copied some code) but it does 
not include the contents of the databases, sessions, and erros directories. 
Next to the packaging mechanism it also has mechanisms to download and 
install (unpack, overwrite) these packages based on version numbers. I have 
used the plugin in several projects over the last year and found it to be 
quite stable.


On Monday, January 21, 2013 10:24:19 AM UTC+1, Johann Spies wrote:
>
> On 21 January 2013 04:46, animnook >wrote:
>
>> I have a web app on server and I use web2py web interface to update the 
>> project file.
>> But the users wants to add data in db while I am still working on other 
>> part of the app.
>> as right now I just copy and paste everything in controller file local to 
>> server.
>> and upload whatever new pages I create.
>>
>> Is there a easy way to update everything and not change the data inside 
>> the database?? 
>>
>>
> Uploading a new controller or views will in itself not change anything in 
> the database.  It is the use of the controller functions that may do that. 
>
> Changes to model files (table definitions) will change the database when 
> you upload them into the server.
>
> Regards
> Johann
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>

-- 





[web2py] scientific reference for migrations

2013-01-21 Thread selecta
As I am currently writing my phD thesis i wonder if there is a proper 
reference to the migrations technique used in web2py.

I cannot even find a proper Wikipedia article for that (not that this would 
be a reference I would like to use).

the closest I found so far is http://guides.rubyonrails.org/migrations.html

anyone anything better?

-- 





[web2py] conditional models requires check if table already exists for db admin to work

2012-07-03 Thread selecta
In my project I use conditional models since I have a lot of tables. 
However I have a problem since one of the database tables (defined in a 
conditional model) has to be defined in another conditional model
here an example
/models/plugin_restapidoc/plugin_restapidoc.py
/models/wizard/wizard.py
/models/wizard/plugin_restapidoc.py

plugin_restapidoc.py contains the same table definition, 
the table is used in the wizard and in the plugin_restapidoc controller
this works fine, but fails when i call the db appadmin

my workaround so far is
models/db.py:
PLUGIN_RESTAPIDOC_DEFINED = False
/models/plugin_restapidoc/plugin_restapidoc.py:
PLUGIN_RESTAPIDOC_DEFINED = True
/models/wizard/plugin_restapidoc.py:
if PLUGIN_RESTAPIDOC_DEFINED:
  define table ...
 
I wonder if there is a better solution, e.g. one without 
the PLUGIN_RESTAPIDOC_DEFINED variable
e.g. 
if db.tables.has_key('plugin_restapidoc_table'):
  define table ...
or even better a fix in the appadmin


[web2py] Re: Errors creating/reading tickets

2012-04-20 Thread selecta
yes I know this problem for a long time, would be nice if this would be 
fixed. I guess right now the problem is that the whole ticket display fails 
if one ticket is corrupted. I think this could be quickfixed by a simple 
try catch block around the deserialization of each ticket pickle file.

On Sunday, March 11, 2012 3:48:04 AM UTC+1, Brian M wrote:
>
> This has actually been plaguing me for a while but finally annoyed me 
> enough to ask.  I have several web2py (1.99.4) apps running under 
> Apache/2.2.17 (Win32) , mod_wsgi/3.3 and Python/2.6.4.  More often than 
> not when an error happens and a ticket is generated, the ticket seems to be 
> corrupt.  Attempting to view the ticket creates another error for which the 
> ticket says something like:
>
>  Version  web2py™ (1, 99, 4, 
> datetime.datetime(2011, 12, 22, 11, 20, 45), 'stable')  Python Python 
> 2.6.4: C:\vantage_dashboard\xampp\apache\bin\httpd.exe  Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
>
> Traceback (most recent call last):
>   File "C:\vantage_dashboard\xampp\web2py\gluon\restricted.py", line 204, in 
> restricted
> exec ccode in environment
>   File 
> "C:/vantage_dashboard/xampp/web2py/applications/admin/controllers/default.py" 
> , line 
> 1341, in 
>   File "C:\vantage_dashboard\xampp\web2py\gluon\globals.py", line 172, in 
> 
> self._caller = lambda f: f()
>   File 
> "C:/vantage_dashboard/xampp/web2py/applications/admin/controllers/default.py" 
> , line 
> 1082, in errors
> error = pickle.load(fullpath_file)
>   File "C:\Python26\Lib\pickle.py", line 1370, in load
> return Unpickler(file).load()
>   File "C:\Python26\Lib\pickle.py", line 858, in load
> dispatch[key](self)
>   File "C:\Python26\Lib\pickle.py", line 880, in load_eof
> raise EOFError
> EOFError
>
>
> Which means that I have to attempt to read the original error ticket in a 
> text editor which is just slightly less than idea.  Any ideas what might be 
> happening? This problem doesn't seem to happen in my dev environment (also 
> Windows but just using rocket instead of apache/mod_wsgi).
>
> Thanks,
> Brian
>


[web2py] return json with generic.json that is not an object/dictionary

2012-04-13 Thread selecta
is it possible to do something similar to
def test():
  response.generic_patterns = ['json']
  return [1,2,3,4]




[web2py] how to make basic auth work?

2012-04-13 Thread selecta
I enable basic auth with
auth.settings.allow_basic_login = True
I tried 
wget --user=u...@bla.de --password=xxx http:
//127.0.0.1:8000/pyMantis/tlc/records.json/Strain
curl --head -u u...@bla.de:xxx http:
//127.0.0.1:8000/pyMantis/tlc/records.json/Strain

and the python code
 import urllib2
 import base64
 url = 'http://127.0.0.1:8000/pyMantis/tlc/records.json/Strain'
 username, password = 'u...@bla.de:xxx'.split(':')

 request = urllib2.Request(url)
 base64string = base64.encodestring('%s:%s' % (username, password)).replace(
'\n', '')
 request.add_header("Authorization", "Basic %s" % base64string)
 fp = urllib2.urlopen(request)
...

But nothing seems to work? Am I  missing something?


Re: [web2py] Re: 10.24$ reward for a recipe logging a user

2012-04-02 Thread selecta
I am not able to find out how to email you in private o_O

On Tuesday, March 27, 2012 12:06:43 AM UTC+2, bussiere adrien wrote:
>
> It work 
>
> Thanks
> Just mail me in private where to give
> Bussiere
>
> Le lundi 26 mars 2012 20:23:06 UTC+2, selecta a écrit :
>>
>> if it works please donate to the web2py project
>>
>>
>>

[web2py] Re: web2py icon/logo?

2012-03-30 Thread selecta
thanks, this is better, even though the quality of the rectangular logo is 
still a bit crappy, a svg version would be much better (for all the logos)

On Thursday, March 29, 2012 5:51:44 PM UTC+2, Anthony wrote:
>
> On Thursday, March 29, 2012 10:56:47 AM UTC-4, selecta wrote:
>>
>> thanks i thought so, I like the fav icon because of its compact format, 
>> unfortunately my poster will be in A0 so it will probably not be my choice, 
>> it would be nice if there would be a SVG version of the fac icon for these 
>> kind of purposes. I could do it, all I would need to know for that is the 
>> font that was used :D
>>
>
> The original PNG is in here: 
> http://www.web2py.com/examples/static/artwork.tar.gz 
>


[web2py] Re: web2py icon/logo?

2012-03-29 Thread selecta
thanks i thought so, I like the fav icon because of its compact format, 
unfortunately my poster will be in A0 so it will probably not be my choice, 
it would be nice if there would be a SVG version of the fac icon for these 
kind of purposes. I could do it, all I would need to know for that is the 
font that was used :D

On Thursday, March 29, 2012 2:57:09 PM UTC+2, Anthony wrote:
>
> No, that's the old logo, which was replaced over a year ago -- don't use 
> that one. The logos are at the bottom of the downloads page: 
> http://www.web2py.com/examples/default/download. You might also consider 
> using the web2py.com favicon, which you can find in the /static folder of 
> the "examples" app that comes with web2py (see 
> https://github.com/web2py/web2py/blob/master/applications/examples/static/favicon.ico
> ).
>
> Anthony
>
> On Thursday, March 29, 2012 7:13:10 AM UTC-4, selecta wrote:
>>
>> I want to put an icon of web2py on a poster that I am going to present. 
>> Is this icon the right choice? 
>> http://s3.amazonaws.com/uploads.uservoice.com/logo/design_setting/60411/original/web2py_icon_4162_0.png?1322778787
>> I dont want to use the strechted logo (
>> http://web2py.com/examples/static/images/logo_lb.png) since it takes to 
>> much space, but I would use it if this is the official "web2py icon"
>>
>

[web2py] web2py icon/logo?

2012-03-29 Thread selecta
I want to put an icon of web2py on a poster that I am going to present. Is 
this icon the right choice? 
http://s3.amazonaws.com/uploads.uservoice.com/logo/design_setting/60411/original/web2py_icon_4162_0.png?1322778787
I dont want to use the strechted logo 
(http://web2py.com/examples/static/images/logo_lb.png) since it takes to 
much space, but I would use it if this is the official "web2py icon"


Re: [web2py] Re: 10.24$ reward for a recipe logging a user

2012-03-26 Thread selecta
if it works please donate to the web2py project




[web2py] Re: 10.24$ reward for a recipe logging a user

2012-03-26 Thread selecta
password="toto"
my_crypt = CRYPT(key=auth.settings.hmac_key)
crypt_pass = my_crypt(password)[0] 
  user = 
db.auth_user.insert(Surnom="Surnom",email="email5@toto",username="titi",password=crypt_pass,)
   from gluon.storage import Storage
session.auth = 
Storage(user=user,expiration=auth.settings.expiration,hma​c​_​​key=str(uuid4()))
   auth.user = Storage(auth.settings.table_user._filter_fields(user, 
id=True))
  auth.environment.session.auth = Storage(user=user, 
last_visit=request.now,expiration=auth.settings.expiration)
redirect(URL('inscriptioninvit'))  

   On Monday, March 26, 2012 11:53:28 AM UTC+2, selecta wrote:
>
> did you see this slice
>
> http://www.web2pyslices.com/​slice/show/1443/auto-login-​when-you-come-from-localhost<http://www.web2pyslices.com/slice/show/1443/auto-login-when-you-come-from-localhost>
> it logs you in when you come from localhost, just exchange the if an there 
> you go :D
>
> On Monday, March 26, 2012 2:11:29 AM UTC+2, bussiere adrien wrote:
>>
>> it's more a logical problem than your framework.
>>
>> I just want to know how to log a user.
>>
>> Bussiere
>>
>> Le lundi 26 mars 2012 01:35:04 UTC+2, Massimo Di Pierro a écrit :
>>>
>>> I have been on the road and hard to keep up up with posts. If this issue 
>>> is still open please open a ticket so it can be tracked.
>>>
>>> On Sunday, 25 March 2012 11:57:20 UTC-5, bussiere adrien wrote:
>>>>
>>>> I want to create myself a user then log him.
>>>> This for an open source project : 
>>>> https://github.com/bussiere/jackpoint<https://github.com/bussiere/jackpoint>
>>>>   
>>>> I've been on it for 3 days now.
>>>>
>>>> I want to create a user then loggin him and auth him.
>>>> If you find it just give me your paypal in private buy you a drink.
>>>>
>>>> Here is my code :
>>>> def test():
>>>>
>>>>   password="toto"
>>>> my_crypt = CRYPT(key=auth.settings.hmac_key)
>>>> crypt_pass = my_crypt(password)[0]
>>>> user = db.auth_user.insert(
>>>>Surnom="Surnom",
>>>>email="email5@toto",
>>>>username="titi",
>>>>password=crypt_pass,
>>>>)
>>>> db.commit()
>>>> 
>>>> user = auth.login_bare("titi",password)
>>>> session.auth = 
>>>> Storage(user=user,expiration=auth.settings.expiration,hma​c​_​​key=str(uuid4()))
>>>> redirect(URL('inscriptioninvit'))
>>>>
>>>> @auth.requires_login()
>>>> def inscriptioninvit():
>>>>  return "hello"
>>>>
>>>>

[web2py] Re: 10.24$ reward for a recipe logging a user

2012-03-26 Thread selecta
did you see this slice
http://www.web2pyslices.com/slice/show/1443/auto-login-when-you-come-from-localhost
it logs you in when you come from localhost, just exchange the if an there 
you go :D

On Monday, March 26, 2012 2:11:29 AM UTC+2, bussiere adrien wrote:
>
> it's more a logical problem than your framework.
>
> I just want to know how to log a user.
>
> Bussiere
>
> Le lundi 26 mars 2012 01:35:04 UTC+2, Massimo Di Pierro a écrit :
>>
>> I have been on the road and hard to keep up up with posts. If this issue 
>> is still open please open a ticket so it can be tracked.
>>
>> On Sunday, 25 March 2012 11:57:20 UTC-5, bussiere adrien wrote:
>>>
>>> I want to create myself a user then log him.
>>> This for an open source project : 
>>> https://github.com/bussiere/​​​jackpoint
>>>   
>>> I've been on it for 3 days now.
>>>
>>> I want to create a user then loggin him and auth him.
>>> If you find it just give me your paypal in private buy you a drink.
>>>
>>> Here is my code :
>>> def test():
>>>
>>>   password="toto"
>>> my_crypt = CRYPT(key=auth.settings.hmac_​​​key)
>>> crypt_pass = my_crypt(password)[0]
>>> user = db.auth_user.insert(
>>>Surnom="Surnom",
>>>email="email5@toto"​​​,
>>>username="titi",
>>>password=crypt_pass​​​,
>>>)
>>> db.commit()
>>> 
>>> user = auth.login_bare("titi",passwor​​​d)
>>> session.auth = 
>>> Storage(user=user,expiration=a​​​uth.settings.expiration,hmac​_​​key=str(uuid4()))
>>> redirect(URL('​​​inscriptioninvit'))
>>>
>>> @auth.requires_login()
>>> def inscriptioninvit():
>>>  return "hello"
>>>
>>>

[web2py] Re: featured web2py apps

2012-03-22 Thread selecta
I know pyMantis would need some clean up but it has some really nice an 
unique features 
http://pymantis.org/
source: https://sourceforge.net/scm/?type=hg&group_id=304012

On Thursday, September 22, 2011 8:52:05 PM UTC+2, Massimo Di Pierro wrote:
>
> I think we should make a list of featured web2py apps. Please post 
> links below. 
>
> - it does matter if you wrote or just saw it, just post below 
> - the app must be open source 
> - the app must be under version control and available 
> - the app must use Auth 
> - avoid duplicates, but if you saw in a previous thread, please post 
> it here again 
>
> List: 
> - app name 
> - app author 
> - app description 
> - where to get it 
> - possibly a link to a screenshot 
> - whether you think it is stable or not (why not?) 
>
> Massimo



[web2py] date(time) picker not working with multiple ajax loaded forms

2011-12-08 Thread selecta
If I load multiple forms as web2py components the date(time) picker only 
works in the first form. Can somebody verify that or is it just a bug in my 
code?


[web2py] Re: openid server

2011-10-06 Thread selecta
i'm on it so far the only implementation i have seen is 
https://bitbucket.org/bottiger/web2py-openid/overview but we cannot get it 
get it working :( 
tell me if you were more successful with something


[web2py] Re: URL function in external js and css files

2011-09-28 Thread selecta
you can if you put your js and css files in the view folder e.g.

controllers/default.py
def myscript():
  return dict()

def index():
  response.files.append(URL('myscript.js'))

views/default/myscript.js
jQuery(document).ready(function() {
  alert('this is an alert with a web2py url {{=URL('index')}}')
});


[web2py] Re: top 5

2011-09-27 Thread selecta


db.define_table('person',Field('name'),Field('description','text'),Field('sex'))
 


records = db(...).select(..., limitby=(0, 5))
for r in records:
r.description = '%s%s'%(r.description[:10],'...' if 
len(r.description)>10 else '')


[web2py] Re: Import error !!!

2011-09-27 Thread selecta
oh an here the css code to make it work inline (remove scrollbars, infobox, 
linenumbers and excessive spacing)
.syntaxhighlighter { 
padding-bottom: 1px; 
margin: 0px !important;
} 

PRE('[(str, int)]', _class='brush: py; gutter: false; toolbar: false;')


[web2py] Re: Import error !!!

2011-09-27 Thread selecta
yes i had the same problem, but since i had some other issues i abandoned 
this
see here 
https://groups.google.com/forum/#!searchin/web2py/pygments|sort:date/web2py/9EyKOZ-bHHM/1myqDA9qMv0J
since this is still not working I changed to 
http://alexgorbatchev.com/SyntaxHighlighter/
here is an example:
controller
def index():
response.files.append( URL(request.application, 
'static/plugin_restapidoc/syntaxhighlighter', 'scripts/shCore.js') )
response.files.append( URL(request.application, 
'static/plugin_restapidoc/syntaxhighlighter', 'scripts/shBrushPython.js') )
response.files.append( URL(request.application, 
'static/plugin_restapidoc/syntaxhighlighter', 'scripts/.js') )
response.files.append( URL(request.application, 
'static/plugin_restapidoc/syntaxhighlighter', 'styles/shCore.css') )
response.files.append( URL(request.application, 
'static/plugin_restapidoc/syntaxhighlighter', 'styles/shThemeDefault.css') )
#this must be last to be able to overwrite syntaxhighlighter styles
response.files.append(URL(request.application,'static/plugin_restapidoc','base.css'))

view index.html

function methodDetails(action){
$.ajax({
url: action,
success: function( data ) {
$('#method_details').hide().html(data).fadeIn();
  SyntaxHighlighter.highlight();// must call hightlight if you use ajax 
otherwise use all()
}
});
}



[web2py] Re: How to Model an 'upload' field to permit more than one attachment?

2011-07-29 Thread selecta
oh yes
Field("foobar", "list:upload")
would be very nice
check google, some people already talked about it

On Jul 29, 1:21 pm, António Ramos  wrote:
> How to Model an 'upload' field to permit more than one attachment?
> thank you
>
> António


[web2py] Re: export data to OOO and Excel

2011-07-25 Thread selecta
Have a look at
http://tlc2.hg.sourceforge.net/hgweb/tlc2/tlc2/file/d68f1405e1c5/views/generic.xls
http://tlc2.hg.sourceforge.net/hgweb/tlc2/tlc2/file/d68f1405e1c5/views/generic.xlsx

they use tablib (which includes xlwt, ...)
http://docs.tablib.org/en/latest/index.html


[web2py] Re: plugins

2011-06-20 Thread selecta
> If I find any bug, would you like me to send it to you
yes :D please post them here 
http://pymantis.org/pymantis_server/plugin_issue/index


[web2py] Re: How to create web2py-based desktop app?

2011-06-20 Thread selecta
check out the plugin_release from pyMantis
it will automatically build win linux mac and w2p package releases of
your app
it also has an update mechanism that allows the download and
installation of updated versions
the plugin is not perfect yet and it would be cool to have more
testers/developers
ironically the download at pymantis.org is currently broken for some
clients (some weird server issue stalling the dl at 99%)
so if that does not work for you you can also get the code from
http://sourceforge.net/projects/tlc2/

On Jun 20, 11:05 pm, Vinhthuy  wrote:
> Hello everyone,
>
> We have used web2py to create server-based application.  With minimal
> change, e would like to make it so that it can be used as stand-alone
> desktop applications on both Windows and Mac.   If possible, I would
> it to contain everything, including Python so that users simply
> download our app, click on it and run it on their personal computers.
>
> At web2py.com, I noticed that web2py itself can be downloaded and used
> as stand-alone applications for both Windows and Mac (web2py.exe and
> web2py.app, respectively).
>
> Any clues on how to do this is greatly appreciated.
>
> Thanks,
>
> Vinhthuy Phan


[web2py] Re: import error

2011-06-20 Thread selecta
maybe it is better so switch to some javascript syntax highlighter?
any recommendations ...


[web2py] Re: import error

2011-06-20 Thread selecta

> try to replace:
>
> oldmod = sys.modules['pygments.lexers']
>
> with:
>
> import pygments.lexers as oldmod

hagrr why must pygements be so ...

i tried that but i got
File "applications/pygments_test/modules/pygments/lexers/__init__.py",
line 223, in 
import pygments.lexers as oldmod
AttributeError: 'module' object has no attribute 'lexers'

so i though i try to remove the whole oldmod stuff
#import pygments.lexers as oldmod
newmod = _automodule('pygments.lexers')
#newmod.__dict__.update(oldmod.__dict__)
sys.modules['pygments.lexers'] = newmod
#del newmod.newmod, newmod.oldmod, newmod.sys, newmod.types

but unfortunately this does not help in the end because when i want to
use pygemtns to render some html i get

Traceback (most recent call last):
  File "/home/fkrause/Dev/web2py/gluon/restricted.py", line 192, in
restricted
exec ccode in environment
  File "/home/fkrause/Dev/web2py/applications/pyMantis/views/
plugin_restapidoc/method.html", line 26, in 

  File "/home/fkrause/Dev/web2py/applications/pyMantis/models/
plugin_restapidoc.py", line 54, in code_highlight
lexer = pygments.lexers.get_lexer_by_name(language.lower(),
stripall=True)
  File "applications/pyMantis/modules/pygments/lexers/__init__.py",
line 74, in get_lexer_by_name
_load_lexers(module_name)
  File "applications/pyMantis/modules/pygments/lexers/__init__.py",
line 32, in _load_lexers
mod = __import__(module_name, None, None, ['__all__'])
  File "/home/fkrause/Dev/web2py/gluon/custom_import.py", line 283, in
__call__
fromlist, level)
  File "/home/fkrause/Dev/web2py/gluon/custom_import.py", line 75, in
__call__
level)
ImportError: No module named agile


[web2py] Re: plugins

2011-06-20 Thread selecta


On Jun 20, 8:32 am, José L.  wrote:
> selecta, the downloads 
> fromhttp://pymantis.org/pymantis_server/plugin_release/downloaddon't work in
> any of its versions.
i know but the strange thing is that i works from some locations (all
that i have access to :( ) and others not (download stalls at 99%)
it is extremely difficult to debug this since i do not have access to
a location where this happens

> Do you have some control version system where I could take a look to these
> plugins?
>
> Thanks.
here you go
https://sourceforge.net/projects/tlc2/
i know i really need to clean up the project and make it nice and
available, but unfortunatly this is beyond my time constraints right
now

there are two more plugins now in pyMantis

plugin_issue
create, edit and comment issue tickets, attach w2p error tickets to
issues (so you can see the stack traces), automatically show and
create issue tickets and status if a w2p error ticket is created (need
redirect on yourapp/500), server client issue tracking with the
ability to send issue tickets to a main server (aka do you want to
send your bug report to ...), rating of issues, tagging of
issues, 
most of the nice features are hard to demo since I do not want to
expose the w2p error tickets

plugin_wishlist
a rather project specific plugin to track wishes assign them to people
and comment them. if the wish is fulfilled you can mark it as closed.
It is similar to the issue tracker but alot more simple since it is
not made for IT stuff.


[web2py] Re: import error

2011-06-20 Thread selecta



> > but the pygments error still exists
> >  oldmod = sys.modules['pygments.lexers']
> >  KeyError: 'pygments.lexers'
> > any clue about this one?
> > --
>
> Hello,
>
> The importer will import the module as something like
> applications.appname.modules.pygments (this the name used for sys.modules)
> if the module to import is in the directory "modules". This enables to have
> different versions of the same module for different applications.
>
> Since pygments is accessing a module with sys.modules, you cannot use
> pygments in the "modules" directory. You can put pygments in site-packages
> instead. Or you can modify pygments for working with web2py (more difficult
> I guess).
>
> This is feature. It is not a bug.

oh :P

>
> I guess I can improve the design by replacing sys.modules by a class that
> will do the lockup in applications.appname if it fails like in this example.
> How can I access appname from the code? I guess this is the new thread
> variable thing implemented recently.

not sure i can follow you here, do you mean request.application?? no i
guess i'm lost
>
> How much do you need this extra feature?

well, what i want to do is to create an application that i can
distribute easily (pyMantis, ...) for this i need to be able to add
new modules in future distributions and remove them again if they are
not needed, so far I have written a plugin for creating releases (win
linux mac and web2py app packages) and updating running releases
(using the web2py app packages). The plugin currently looks into the
site packages folder and adds all site packages from a local myapp/
site-packages directory. This i not so nice i think and also a bit
error-prone. So it would be nice to create web2py app packages that
just work without any further setup steps (just like web2pys
philosophy: batteries included)


[web2py] Re: import error

2011-06-20 Thread selecta
the open id error is gone now
(globals = None -> AttributeError: 'NoneType' object has no attribute
'get')
but the pygments error still exists
 oldmod = sys.modules['pygments.lexers']
 KeyError: 'pygments.lexers'
any clue about this one?

On Jun 18, 1:39 am, Pierre Thibault 
wrote:
> 2011/6/17 selecta 
>
> > I also have problems importing pygments from the modules directory
> >http://jaguar.biologie.hu-berlin.de/~fkrause/web2py.app.pygments_test...
>
> > i downloaded pygments fromhttp://pypi.python.org/pypi/Pygments
>
> Do you still have problems with you are using the last version of trunk?
>
> --
>
> A+
>
> -
> Pierre
> My blog and profile
> (http://pierrethibault.posterous.com)<http://pierrethibault.posterous.com>
> YouTube page 
> (http://www.youtube.com/user/tubetib)<http://www.youtube.com/user/tubetib>
> Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2>


[web2py] Re: import error

2011-06-19 Thread selecta
thanks sounds great, i will try first thing tomorrow morning at work,
things are kind of messed up at home right now ...

On Jun 18, 1:39 am, Pierre Thibault 
wrote:
> 2011/6/17 selecta 
>
> > I also have problems importing pygments from the modules directory
> >http://jaguar.biologie.hu-berlin.de/~fkrause/web2py.app.pygments_test...
>
> > i downloaded pygments fromhttp://pypi.python.org/pypi/Pygments
>
> Do you still have problems with you are using the last version of trunk?
>
> --
>
> A+
>
> -
> Pierre
> My blog and profile
> (http://pierrethibault.posterous.com)<http://pierrethibault.posterous.com>
> YouTube page 
> (http://www.youtube.com/user/tubetib)<http://www.youtube.com/user/tubetib>
> Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2>


[web2py] Re: Linking directly to an uploaded image

2011-06-17 Thread selecta
btw if you have different image type you can get the extension with
os.path.splitext(path)

On Jun 17, 11:41 am, selecta  wrote:
> The problem is that download creates a http response with attachment
> you should be able to write a function that just returns the content
> of the image
> def show()
>   import gluon.contenttype
>   response.headers['Content-Type'] =
> gluon.contenttype.contenttype('.jpg')
>   filename, file =
> db.myimages.img_upload.retrieve( db.myimages[1].img_upload)
>   return file.read()
>
> On Jun 16, 11:09 am, Vinicius Assef  wrote:
>
>
>
> > Hi guys.
>
> > I have a table (called anuncio) with an upload field (called foto), so
> > anuncio.foto is my upload field.
>
> > I'm showing and linking it with this piece of code in my view :
> >     {{url = URL(c='anuncios',f='download', args=['uploads', anuncio.foto])}}
> >     {{=A(IMG(_src=url), _href=url)}}
>
> > My /contollers/anuncios.py/download() function is the default, as seen 
> > below:
> > def download():
> >     return response.download(request,db)
>
> > When user clicks on this image, browser shows the download dialog,
> > asking him/her where to save the image.
> > But I'd like to simply show the image, not present the download
> > dialog. All these images will be public.
>
> > How I solved it:
> > 1) I entered in /myapp/static/images and created a symbolic link
> > called 'uploads' pointing to /myapp/uploads.
> > 2) In my view, I changed the: {{url = URL(...}} stuff by this: {{url =
> > URL(c='static', f='images', args=['uploads', anuncio.foto])}}
>
> > I think this isn't the best choice because I'm pointing URL() to a
> > fake controller and function, and I'm counting on an external
> > resource: a symbolic link in my filesystem.
>
> > How would be the "web2pythonic" way to do this?
>
> > --
> > Vinicius Assef.


[web2py] Re: Linking directly to an uploaded image

2011-06-17 Thread selecta
The problem is that download creates a http response with attachment
you should be able to write a function that just returns the content
of the image
def show()
  import gluon.contenttype
  response.headers['Content-Type'] =
gluon.contenttype.contenttype('.jpg')
  filename, file =
db.myimages.img_upload.retrieve( db.myimages[1].img_upload)
  return file.read()

On Jun 16, 11:09 am, Vinicius Assef  wrote:
> Hi guys.
>
> I have a table (called anuncio) with an upload field (called foto), so
> anuncio.foto is my upload field.
>
> I'm showing and linking it with this piece of code in my view :
>     {{url = URL(c='anuncios',f='download', args=['uploads', anuncio.foto])}}
>     {{=A(IMG(_src=url), _href=url)}}
>
> My /contollers/anuncios.py/download() function is the default, as seen below:
> def download():
>     return response.download(request,db)
>
> When user clicks on this image, browser shows the download dialog,
> asking him/her where to save the image.
> But I'd like to simply show the image, not present the download
> dialog. All these images will be public.
>
> How I solved it:
> 1) I entered in /myapp/static/images and created a symbolic link
> called 'uploads' pointing to /myapp/uploads.
> 2) In my view, I changed the: {{url = URL(...}} stuff by this: {{url =
> URL(c='static', f='images', args=['uploads', anuncio.foto])}}
>
> I think this isn't the best choice because I'm pointing URL() to a
> fake controller and function, and I'm counting on an external
> resource: a symbolic link in my filesystem.
>
> How would be the "web2pythonic" way to do this?
>
> --
> Vinicius Assef.


[web2py] Re: import error

2011-06-17 Thread selecta
I also have problems importing pygments from the modules directory
http://jaguar.biologie.hu-berlin.de/~fkrause/web2py.app.pygments_test.w2p

i downloaded pygments from http://pypi.python.org/pypi/Pygments

and wrote in db.py
from pygments import highlight
from pygments.formatters import HtmlFormatter
import pygments.lexers


Traceback (most recent call last):
  File "/home/fkrause/Downloads/tmp/web2py/gluon/restricted.py", line
192, in restricted
exec ccode in environment
  File "/home/fkrause/Downloads/tmp/web2py/applications/pygments_test/
models/db.py", line 10, in 
import pygments.lexers
  File "/home/fkrause/Downloads/tmp/web2py/gluon/custom_import.py",
line 271, in __call__
globals, locals, fromlist, level)
  File "/home/fkrause/Downloads/tmp/web2py/gluon/custom_import.py",
line 299, in __import__dot
locals, [name], level)
  File "/home/fkrause/Downloads/tmp/web2py/gluon/custom_import.py",
line 75, in __call__
level)
  File "applications/pygments_test/modules/pygments/lexers/
__init__.py", line 222, in 
oldmod = sys.modules['pygments.lexers']
KeyError: 'pygments.lexers'

On Jun 17, 10:57 am, selecta  wrote:
> I send you a test app that reproduces the error
> in case somebody else wants to test/debug you can download it 
> fromhttp://jaguar.biologie.hu-berlin.de/~fkrause/web2py.app.w2popenid_tes...
>
> On Jun 17, 4:32 am, Pierre Thibault 
> wrote:
>
>
>
> > 2011/6/15 Massimo Di Pierro 
>
> > > looking into this...
>
> > Still no news. Should we forget this issue? I really would like to debug but
> > I don't have enough information. It seems the bug is very rare.
>
> > > On Jun 15, 8:12 am, "mb_...@yahoo.fr"  wrote:
> > > > I wanted to use the w2popenid example application from bitbucket
> > > > website :https://bitbucket.org/bottiger/web2py-openid/overview
> > > >  I have downloaded and placed the code in the applications directory.
> > > > I have changed in the models folder the file db.py: this line "from
> > > > applications.cas.modules.w2popenid import OpenIDLogin" is replaced
> > > > with this one "from w2popenid import OpenIDLogin" or this "from
> > > > applications.w2popenid.modules.import OpenIDLogin". But it don't
> > > > worked. I get to follow this trace
> > > > Traceback (most recent call last):
> > > >   File "/home/mamadou/Desktop/web2py/gluon/restricted.py", line 192,
> > > > in restricted
> > > >     exec ccode in environment
> > > >   File "/home/mamadou/Desktop/web2py/applications/w2popenid/models/
> > > > db.py", line 42, in 
> > > >     from testing import lala
> > > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > > 280, in __call__
> > > >     fromlist, level)
> > > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > > in __call__
> > > >     level)
> > > >   File "/home/mamadou/Desktop/web2py/applications/w2popenid/modules/
> > > > testing.py", line 7, in 
> > > >     import openid.consumer.consumer
> > > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > > 280, in __call__
> > > >     fromlist, level)
> > > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > > in __call__
> > > >     level)
> > > >   File "/usr/lib/pymodules/python2.7/openid/consumer/consumer.py",
> > > > line 197, in 
> > > >     from openid.consumer.discover import discover,
> > > > OpenIDServiceEndpoint, \
> > > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > > 280, in __call__
> > > >     fromlist, level)
> > > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > > in __call__
> > > >     level)
> > > >   File "/usr/lib/pymodules/python2.7/openid/consumer/discover.py",
> > > > line 21, in 
> > > >     from openid.yadis.etxrd import nsTag, XRDSError, XRD_NS_2_0
> > > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > > 280, in __call__
> > > >     fromlist, level)
> > > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > > in __call__
> > > >     level)
> >

[web2py] Re: import error

2011-06-17 Thread selecta
I send you a test app that reproduces the error
in case somebody else wants to test/debug you can download it from
http://jaguar.biologie.hu-berlin.de/~fkrause/web2py.app.w2popenid_test.w2p

On Jun 17, 4:32 am, Pierre Thibault 
wrote:
> 2011/6/15 Massimo Di Pierro 
>
> > looking into this...
>
> Still no news. Should we forget this issue? I really would like to debug but
> I don't have enough information. It seems the bug is very rare.
>
>
>
>
>
>
>
> > On Jun 15, 8:12 am, "mb_...@yahoo.fr"  wrote:
> > > I wanted to use the w2popenid example application from bitbucket
> > > website :https://bitbucket.org/bottiger/web2py-openid/overview
> > >  I have downloaded and placed the code in the applications directory.
> > > I have changed in the models folder the file db.py: this line "from
> > > applications.cas.modules.w2popenid import OpenIDLogin" is replaced
> > > with this one "from w2popenid import OpenIDLogin" or this "from
> > > applications.w2popenid.modules.import OpenIDLogin". But it don't
> > > worked. I get to follow this trace
> > > Traceback (most recent call last):
> > >   File "/home/mamadou/Desktop/web2py/gluon/restricted.py", line 192,
> > > in restricted
> > >     exec ccode in environment
> > >   File "/home/mamadou/Desktop/web2py/applications/w2popenid/models/
> > > db.py", line 42, in 
> > >     from testing import lala
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > 280, in __call__
> > >     fromlist, level)
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > in __call__
> > >     level)
> > >   File "/home/mamadou/Desktop/web2py/applications/w2popenid/modules/
> > > testing.py", line 7, in 
> > >     import openid.consumer.consumer
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > 280, in __call__
> > >     fromlist, level)
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > in __call__
> > >     level)
> > >   File "/usr/lib/pymodules/python2.7/openid/consumer/consumer.py",
> > > line 197, in 
> > >     from openid.consumer.discover import discover,
> > > OpenIDServiceEndpoint, \
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > 280, in __call__
> > >     fromlist, level)
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > in __call__
> > >     level)
> > >   File "/usr/lib/pymodules/python2.7/openid/consumer/discover.py",
> > > line 21, in 
> > >     from openid.yadis.etxrd import nsTag, XRDSError, XRD_NS_2_0
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > 280, in __call__
> > >     fromlist, level)
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > in __call__
> > >     level)
> > >   File "/usr/lib/pymodules/python2.7/openid/yadis/etxrd.py", line 28,
> > > in 
> > >     ElementTree = importElementTree()
> > >   File "/usr/lib/pymodules/python2.7/openid/oidutil.py", line 58, in
> > > importElementTree
> > >     ElementTree = __import__(mod_name, None, None, ['unused'])
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > 258, in __call__
> > >     globals.get("__file__", ""))
> > > AttributeError: 'NoneType' object has no attribute 'get'
>
> > > to fix i must modify the module custom_import in the web2py/gluon
> > > folder.
> > > starting line 256
>
> > > try:
> > >     caller_file_name = os.path.join(self.web2py_path,
> > > \globals.get("__file__", ""))
> > > except AttributeError:
> > > caller_file_name = ""
>
> --
>
> A+
>
> -
> Pierre
> My blog and profile
> (http://pierrethibault.posterous.com)
> YouTube page 
> (http://www.youtube.com/user/tubetib)
> Twitter (http://twitter.com/pierreth2) 


[web2py] Re: import error

2011-06-17 Thread selecta
hi there i work with mamadou on this so i try to get some code working
for you to test this

On Jun 17, 4:32 am, Pierre Thibault 
wrote:
> 2011/6/15 Massimo Di Pierro 
>
> > looking into this...
>
> Still no news. Should we forget this issue? I really would like to debug but
> I don't have enough information. It seems the bug is very rare.
>
>
>
>
>
>
>
> > On Jun 15, 8:12 am, "mb_...@yahoo.fr"  wrote:
> > > I wanted to use the w2popenid example application from bitbucket
> > > website :https://bitbucket.org/bottiger/web2py-openid/overview
> > >  I have downloaded and placed the code in the applications directory.
> > > I have changed in the models folder the file db.py: this line "from
> > > applications.cas.modules.w2popenid import OpenIDLogin" is replaced
> > > with this one "from w2popenid import OpenIDLogin" or this "from
> > > applications.w2popenid.modules.import OpenIDLogin". But it don't
> > > worked. I get to follow this trace
> > > Traceback (most recent call last):
> > >   File "/home/mamadou/Desktop/web2py/gluon/restricted.py", line 192,
> > > in restricted
> > >     exec ccode in environment
> > >   File "/home/mamadou/Desktop/web2py/applications/w2popenid/models/
> > > db.py", line 42, in 
> > >     from testing import lala
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > 280, in __call__
> > >     fromlist, level)
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > in __call__
> > >     level)
> > >   File "/home/mamadou/Desktop/web2py/applications/w2popenid/modules/
> > > testing.py", line 7, in 
> > >     import openid.consumer.consumer
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > 280, in __call__
> > >     fromlist, level)
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > in __call__
> > >     level)
> > >   File "/usr/lib/pymodules/python2.7/openid/consumer/consumer.py",
> > > line 197, in 
> > >     from openid.consumer.discover import discover,
> > > OpenIDServiceEndpoint, \
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > 280, in __call__
> > >     fromlist, level)
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > in __call__
> > >     level)
> > >   File "/usr/lib/pymodules/python2.7/openid/consumer/discover.py",
> > > line 21, in 
> > >     from openid.yadis.etxrd import nsTag, XRDSError, XRD_NS_2_0
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > 280, in __call__
> > >     fromlist, level)
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line 75,
> > > in __call__
> > >     level)
> > >   File "/usr/lib/pymodules/python2.7/openid/yadis/etxrd.py", line 28,
> > > in 
> > >     ElementTree = importElementTree()
> > >   File "/usr/lib/pymodules/python2.7/openid/oidutil.py", line 58, in
> > > importElementTree
> > >     ElementTree = __import__(mod_name, None, None, ['unused'])
> > >   File "/home/mamadou/Desktop/web2py/gluon/custom_import.py", line
> > > 258, in __call__
> > >     globals.get("__file__", ""))
> > > AttributeError: 'NoneType' object has no attribute 'get'
>
> > > to fix i must modify the module custom_import in the web2py/gluon
> > > folder.
> > > starting line 256
>
> > > try:
> > >     caller_file_name = os.path.join(self.web2py_path,
> > > \globals.get("__file__", ""))
> > > except AttributeError:
> > > caller_file_name = ""
>
> --
>
> A+
>
> -
> Pierre
> My blog and profile
> (http://pierrethibault.posterous.com)
> YouTube page 
> (http://www.youtube.com/user/tubetib)
> Twitter (http://twitter.com/pierreth2) 


[web2py] Re: SQLFORM layout - very frustrating

2011-06-15 Thread selecta
> you can customize select / option tags layout with CSS
that is what i usually do
go with you mouse and rightclik on the element and select inspect
element (ff+firebug, chrom or opera)
now you can see the id of the element
in you css you can now write something like
#mytable_body{
width: 790px;
height: 50px;
}

you could also change the width of all form elements from the table
mytable with
input[id^='mytalbe_'] {
   width: 100px;
}


[web2py] Re: BUG causes all error tickets to be unknown

2011-06-10 Thread selecta
I created a bug report, would be good if someone could confirm this
bug
http://code.google.com/p/web2py/issues/detail?id=301


[web2py] Re: IS_IN_SET validator not working as expected

2011-06-10 Thread selecta


On Jun 10, 2:21 pm, Ross Peoples  wrote:
> I'm sure you've already considered this, but maybe use a checkbox instead,
yes but this is a question of style an readability, radioboxes with
text are just far more descriptive an a single small checkbox
> as it's specifically designed to handle true/false. The SELECT widget and
> associated IS_IN_SET is designed to return a string value. So If you really
> want to use a select box for this instead of a checkbox, then you need to do
>  the boolean parsing yourself.
:(
> Also, depending on the database you are
> using, you may be able to substitute 'True' and 'False' with 1 and 0, which
> the database may automatically parse to a boolean on insert/update.
i use sqlight, what would you recommend

i will try using 0 and 1 to see if maybe 0 is detected as False


[web2py] IS_IN_SET validator not working as expected

2011-06-10 Thread selecta
i have the model

db.define_table( 'foobar',
Field('open', 'boolean', requires = IS_IN_SET([(True, 'open'),
(False, 'closed')], zero = None), default = True,
widget=SQLFORM.widgets.radio.widget),
)

and the controller

def edit():
  return crud.update(db.foobar, request.args(0), deletable = False)

but it does not work since open is always True because "False" gets
interpreted as string with content and not as boolean
so i have to fix it like this

def edit():
  def on_accept(form):
open = False if request.vars.open == 'False' else True
if form.vars.id and db.foobar[form.vars.id]:
db.foobar[form.vars.id].update_record(open = open)
  return crud.update(db.foobar, onaccept = on_accept, request.args(0),
deletable = False)

are there alternatives to creating radioboxes for True False
selections? Of course custom validator, but is there something already
built in?


[web2py] Re: BUG causes all error tickets to be unknown

2011-06-09 Thread selecta
replacing TAG[''] with DIV solved the problem, but still it would be
nice to find out why this causes web2py to act this way


[web2py] Re: BUG causes all error tickets to be unknown

2011-06-09 Thread selecta
On Jun 9, 12:37 pm, Daniel Gonzalez  wrote:
> Im not working with the latest version, but sometimesn it happens to me,
> and is because there's not write permissions on the /errors folder, or
> because the  /errors folder does not exists.
no this is not the case for me, you can help by following my
instructions and reproducing this error
> I hope this help to you.
nop


[web2py] BUG causes all error tickets to be unknown

2011-06-09 Thread selecta
I check out the latest web2py version from the hg
I created a "New simple application"

I modified the first menu item in models/menu.py
response.menu = [
(TAG['']('Index'), False,
URL(request.application,'default','index'), [])
]

this does not make sense, and is just for testing, actualy I want to
do something like
(TAG[''](IMG( _src = URL(request.application, 'static/ico','bug.png'),
_alt='bug'),'Issues'), False, issueurl , []),

now i created a bug by adding random characters in a controller ...
any bug will do

def index():
asdf
return dict()

this will cause all error tickets to appear like
Internal error
Ticket issued: unknown
the error will be displayed in the shell though

What is wrong? This used to work. How do i get the images back into
the menu?


[web2py] Re: BUG?: Funny Bug with LOAD;

2011-06-07 Thread selecta
if this is fixed properly it could also fix 
http://code.google.com/p/web2py/issues/detail?id=271
:D

On Jun 4, 2:19 am, "Sebastian E. Ovide" 
wrote:
> tracked inhttp://code.google.com/p/web2py/issues/detail?id=285
>
> On Sat, Jun 4, 2011 at 12:53 AM, Massimo Di Pierro <
>
>
>
>
>
> massimo.dipie...@gmail.com> wrote:
> > please open an issue on google code
>
> > On Jun 3, 1:53 pm, "Sebastian E. Ovide" 
> > wrote:
> > > you are right, with ajax=True it doesn't work
>
> > > On Fri, Jun 3, 2011 at 7:35 PM, David J.  wrote:
> > > >  Let me see are you using ajax=True or False?
>
> > > > Because I am using ajax; and login page loaded in the content panel.
>
> > > > I will update my trunk now and test agian.
>
> > > > On 6/3/11 2:29 PM, Sebastian E. Ovide wrote:
>
> > > > it works for me (1.96.2)... I can see the login page in the whole
> > page
>
> > > > On Fri, Jun 3, 2011 at 4:09 PM, David J.  wrote:
>
> > > >> Maybe its not a bug;
>
> > > >> But I found a strange behavior;
>
> > > >> I am using LOAD to load some views; I also use @auth.requires_login()
>
> > > >> I just saw that If I try to reload the component after the session
> > expires
> > > >> the component loads the login page where the component should go;
>
> > > >> Perhaps once the session expires; we should force the whole page to be
> > > >> redirected?
>
> > > >> Any thoughts?
>
> > > >> Thanks.
>
> > > > --
> > > > Sebastian E. Ovide
>
> > > --
> > > Sebastian E. Ovide
>
> --
> Sebastian E. Ovide


[web2py] Re: How to start web2py server permanently

2011-06-07 Thread selecta
if you want to make sure that web2py starts again shortly after a
crash you can use this script
http://www.web2pyslices.com/main/slices/take_slice/97

On Jun 6, 6:47 pm, Pradeesh  wrote:
> I have installed web2py on a remote opensuse server 10.3 and I am
> using a Putty to start the web2py server. But when i am closing the
> Putty session in my machine, the web2py server is also closing. How do
> I start web2py server permanantly.


[web2py] Re: error on crud.update delete

2011-06-01 Thread selecta
just upgraded to 1.96.1 and the error is gone, the code was not
special, but too complicated to post
thanks for fixing this :D

On Jun 1, 6:11 pm, Massimo Di Pierro 
wrote:
> BTW... are you running stable. Can you try trunk. I remeber fixing
> something related to this.
>
> On May 31, 3:46 pm, selecta  wrote:
>
>
>
> > ERROR:web2py:Traceback (most recent call last):
> >   File "/home/select/Dev/web2py/gluon/restricted.py", line 181, in
> > restricted
> >     exec ccode in environment
> >   File "/home/select/Dev/web2py/applications/pyMantis/controllers/
> > plugin_whishlist.py", line 118, in 
> >   File "/home/select/Dev/web2py/gluon/globals.py", line 133, in
> > 
> >     self._caller = lambda f: f()
> >   File "/home/select/Dev/web2py/gluon/tools.py", line 2335, in f
> >     return action(*a, **b)
> >   File "/home/select/Dev/web2py/applications/pyMantis/controllers/
> > plugin_whishlist.py", line 68, in edit
> >     if form.accepts(request.vars, session):
> >   File "/home/select/Dev/web2py/gluon/sqlhtml.py", line 1200, in
> > accepts
> >     self.table._db(self.table.id == self.record.id).update(**fields)
> >   File "/home/select/Dev/web2py/gluon/dal.py", line 5173, in update
> >     fields = self.db[tablename]._listify(update_fields,update=True)
> >   File "/home/select/Dev/web2py/gluon/dal.py", line 4464, in _listify
> >     raise SyntaxError, 'Field %s does not belong to the table' % name
> > SyntaxError: Field delete_this_record does not belong to the table
>
> > is this somehow my fault? not sure how to debug


[web2py] running python on client side browser

2011-05-31 Thread selecta
in case you do no know this yet
http://syntensity.com/static/python.html


[web2py] crud onaccept vs form.accepts - is this expected

2011-05-31 Thread selecta
def edit():
record_id = request.args(0)
def on_accept(form):
print 'in on accept'
response.headers['web2py-component-command'] =
XML("web2py_component('%s','list')"%URL('list'))
if not record_id:
db.plugin_whishlist.open.readable,
db.plugin_whishlist.open.writable = False, False
form = crud.create(db.plugin_whishlist, onaccept = on_accept)
else:
form = crud.update(db.plugin_whishlist, record_id,
onaccept = on_accept)
if form.accepts(request.vars, session):
print 'in this on accept ', form.vars.id
response.headers['web2py-component-command'] =
XML("web2py_component('%s','list')"%URL('list'))
return ''
return form

if the form is accepted it will print
"in this on accept" that means it uses form.accepts instead of the
function that is passed.
is this behavior expected? it confused me a bit


[web2py] error on crud.update delete

2011-05-31 Thread selecta
ERROR:web2py:Traceback (most recent call last):
  File "/home/select/Dev/web2py/gluon/restricted.py", line 181, in
restricted
exec ccode in environment
  File "/home/select/Dev/web2py/applications/pyMantis/controllers/
plugin_whishlist.py", line 118, in 
  File "/home/select/Dev/web2py/gluon/globals.py", line 133, in

self._caller = lambda f: f()
  File "/home/select/Dev/web2py/gluon/tools.py", line 2335, in f
return action(*a, **b)
  File "/home/select/Dev/web2py/applications/pyMantis/controllers/
plugin_whishlist.py", line 68, in edit
if form.accepts(request.vars, session):
  File "/home/select/Dev/web2py/gluon/sqlhtml.py", line 1200, in
accepts
self.table._db(self.table.id == self.record.id).update(**fields)
  File "/home/select/Dev/web2py/gluon/dal.py", line 5173, in update
fields = self.db[tablename]._listify(update_fields,update=True)
  File "/home/select/Dev/web2py/gluon/dal.py", line 4464, in _listify
raise SyntaxError, 'Field %s does not belong to the table' % name
SyntaxError: Field delete_this_record does not belong to the table

is this somehow my fault? not sure how to debug


[web2py] Re: TABLIB - Would be a nice tool to integrate with DAL

2011-05-13 Thread selecta
very nice, just what i need, does it import xls too? xlsx even?

On May 13, 9:24 am, Bruno Rocha  wrote:
>  docshttp://docs.tablib.org/en/latest/index.html
> --
> Bruno Rocha
> [ About me:http://zerp.ly/rochacbruno]
>
>
>
> On Fri, May 13, 2011 at 4:13 AM, Bruno Rocha  wrote:
> >https://github.com/kennethreitz/tablib
>
> > Tablib: format-agnostic tabular dataset library
>
> > headers = ('first_name', 'last_name')
>
> > data = [
> >     ('John', 'Adams'),
> >     ('George', 'Washington')
> > ]
>
> > data = tablib.Dataset(*data, headers=headers)
>
> > Exports
>
> > Drumroll please...
> > JSON!
>
> > >>> print data.json
> > [
> >   {
> >     "last_name": "Adams",
> >     "age": 90,
> >     "first_name": "John"
> >   },
> >   {
> >     "last_name": "Ford",
> >     "age": 83,
> >     "first_name": "Henry"
> >   }
> > ]
>
> > YAML!
>
> > >>> print data.yaml
> > - {age: 90, first_name: John, last_name: Adams}
> > - {age: 83, first_name: Henry, last_name: Ford}
>
> > CSV...
>
> > >>> print data.csv
> > first_name,last_name,age
> > John,Adams,90
> > Henry,Ford,83
>
> > EXCEL!
>
> > >>> open('people.xls', 'wb').write(data.xls)
>
> > It's that easy.
>
> > *I am wondering something like*
>
> > data = tablib.Dataset(db(db.table.select().as_dict(), headers=headers)
>
> > Then we can have DAL Rows written in to Excel, YAML and JSON.
>
> > --
> > Bruno Rocha
> > [ About me:http://zerp.ly/rochacbruno]


[web2py] Re: login fails for ajax components

2011-05-13 Thread selecta
so what about fixing this issue?
should i create a issue on gcode?


[web2py] Re: login fails for ajax components

2011-05-12 Thread selecta


On May 11, 7:07 pm, pbreit  wrote:
> Hmmm...I haven't seen that pattern. I always put the LOAD() in a view. And
> decorate the calling controller. I don't see why or when you'd ever want to
> protect an individual component.
because you cannot grantee that the component cannot be guessed
image somebody had access before, and now he is rejected access but
sill has a record of the component urls
i generally protect all components that are used in protected
controller function

and yes i agree that this happens mostly due to weak design (links to
components are not hidden if user is not logged in) but sometimes it
is nice to show that a function is available, but you need to log in
first
image this
-download -> links download component, which is available
-update -> links upload component, only available to logged in user

now i could generate a different menu for logged in and not logged in
users, but why the hassle if this is not needed


[web2py] Re: login fails for ajax components

2011-05-11 Thread selecta
ok maybe a bit more info
if you have a component that has a @auth.requires_login() decorator
the login form shows if you are not logged in, however the login
fails,
this is i think due to trap_form of the component
and could be prevented if the login form gets a no_trap class

On May 11, 12:46 pm, selecta  wrote:
> i have never botherd with this bug very much, but i think this could
> be solved by giving the login form a proper action and the class
> no_trap


[web2py] login fails for ajax components

2011-05-11 Thread selecta
i have never botherd with this bug very much, but i think this could
be solved by giving the login form a proper action and the class
no_trap


[web2py] Re: Seperating HTML from JavaScript (while preserving templating with {{= }} in JS ) ... BUG

2011-05-05 Thread selecta
> the DIV is rendered fine in my tests, no need to add any prefix such
> as '.html' or '.load' for it to work.
hmm ok, i have to try some more, maybe i can find out how to reproduce
this strange behavior

>
> But having a LOAD in the controller generates an unnecessary ajax
> call,
this was just for demonstration purposes, but that failed :D

> and having the script action and view just makes web2py work
> harder instead of letting the web server do it from static, not to
> mention the clutter of having js all over your views directory.
I am working alot with js functions that init tab menus ...
When I write these i usually use things like {{=URL(foobar)}} in the
JS
With the example above  you can mix the web2py template language with
pure JS. This is nicer for me since vim highlits, indents, ... pure JS
much better than embedded JS. Also you can then pass args and vars to
your JS, and use URL() (which is better if you need routing)

Here is an example how i use it. This are the views of the annotate
controller
http://semanticsbml.svn.sourceforge.net/viewvc/semanticsbml/trunk/webui/views/annotate/
In the controller i just load the script.js once (index), all other
ajax loaded functions just use a JS init_foobar() function to activate
their buttons/fields with special functions
http://semanticsbml.svn.sourceforge.net/viewvc/semanticsbml/trunk/webui/controllers/annotate.py?revision=3325&view=markup
now i can apply this to a server and reroute all URL without having to
worry that i hard-coded them into the JS file


[web2py] Re: how to set the value of textarea form field on accept, upload without storing files

2011-05-04 Thread selecta
YEEEHA
> species_form.element(_id="no_table_species").components[0] = 'foobar'

thank you this is what I wanted to, know :D


[web2py] Seperating HTML from JavaScript (while preserving templating with {{= }} in JS ) ... BUG

2011-05-04 Thread selecta
I always wondered how I could separate my JavaScript from the rest of
my HTML
It came to me and it worked almost well

controllers/default.py

def index():
 response.files.append(URL(request.application,'default','script.js'))
 return dict(content = LOAD('default', 'strange', ajax=True))

def script():
 return dict()

def strange():
 return DIV('this div is not rendered as html')

views/script.js
function foobar(){
 // so nice no js in html, but pure js in here
}

no the inclusion of the js file works nice, but as the loaded
component strange is loaded as js
this can be prevented by explicitly calling it as html
return dict(content = LOAD('default', 'strange.html', ajax=True))

but shouldnt the default extension stay html in this case???


[web2py] Re: how to set the value of textarea form field on accept, upload without storing files

2011-05-04 Thread selecta
I tried it but it did not work,
also it would be nice if i could do something with the uploaded
information first (apply some filter, reformating ...)
>   Field('species_file', 'upload', label="Upload Names",
> uploadfield='species')
>
> uploadfield = True # means store file on disk
> uploadfield = 'field_name' # store content in that DB field
do not have a db table, does it matter?
> uploadfield = False # file content is discarded

I really think that species_form.element(_id="no_table_species")
["_value"] = 'foobar'
would be the solution, but _value just does not work for textarea
this looks a bit like a bug


[web2py] Re: how to set the value of textarea form field on accept, upload without storing files

2011-05-02 Thread selecta
*bump*

On Apr 29, 1:30 pm, selecta  wrote:
> > Also I wonder if there is a method to upload the file without ever
> > storing it? If I remove the uploadfolder argument it does not work. I
> > really dont want to store the file at all.
>
> ok i should have serached a bit more
> uploadfield=False
> does the trick
>
> a bit more information on the other problem
> species_form.element(_id="no_table_species")
> species_form_elem["_value"] = 'foobar'
> works, but it produces
> 
> but i want rather
> species_form_elem["value"] = 'foobar'
> foobar
> since only this is displayed in the textarea


[web2py] Re: how to set the value of textarea form field on accept, upload without storing files

2011-04-29 Thread selecta

> Also I wonder if there is a method to upload the file without ever
> storing it? If I remove the uploadfolder argument it does not work. I
> really dont want to store the file at all.
ok i should have serached a bit more
uploadfield=False
does the trick

a bit more information on the other problem
species_form.element(_id="no_table_species")
species_form_elem["_value"] = 'foobar'
works, but it produces

but i want rather
species_form_elem["value"] = 'foobar'
foobar
since only this is displayed in the textarea


[web2py] how to set the value of textarea form field on accept, upload without storing files

2011-04-29 Thread selecta
I have the following form
 species_form = form_factory(
Field('species', 'text', label=TAG['']
("Yeast",BR(),"Systematic Names")),
Field('species_file', 'upload', label="Upload Names",
uploadfolder=os.path.join(request.folder, 'tmp')),
  )

I want he text field to be filled with the content of the uploaded
file if there a file was uploaded

 species_file = request.vars.species_file.file.read() if
request.vars.species_file!=None else ''
 if species_form.accepts(request.vars, session, keepvalues = True):
if species_form.vars.species_file:
hits = re.findall('Y\w+', species_file)
species_form_elem =
species_form.element(_id="no_table_species")
species_form_elem["value"] = ' '.join(hits)

But this does not work? Is there a different way to do this?

Also I wonder if there is a method to upload the file without ever
storing it? If I remove the uploadfolder argument it does not work. I
really dont want to store the file at all.


[web2py] Re: problems creating an issue tracker

2011-04-29 Thread selecta
true, there is no loop, but there is also no real fallback
i get something like
you are redirected here <- very long link (error->error->error->)
this could be a bit nicer

On Apr 28, 8:26 pm, Anthony  wrote:
> Also, note that I don't think a failure of routes_onerror will result in an
> infinite loop if there's an error in a model file. According to the
> routes_example.py file, if the error handling page itself returns an error,
> web2py will fall back to it's default static response. So, with an error in
> models, you won't get your custom error page, but you shouldn't get a loop
> either.
>
> Anthony
>
>
>
> On Thursday, April 28, 2011 1:48:55 PM UTC-4, selecta wrote:
> > hmm well ic, i guess this still not so bad
> > i will create two modes,
> > 1) development mode that show the tickets directly (using app admin)
> > 2) production mode that create custom error messages by redirecting to
> > the controller function (that also checks if this error was already
> > attached to an issue that can be dispalyed)
> > in production mode there should not be any errors in models, since the
> > whole app would not work
> > any objections to this logic?
>
> > On Apr 28, 4:02 pm, Anthony  wrote:
> > > You can redirect to static error pages, but assuming that's not what you
> > > want, I suppose the only alternative would be to have the errors handled
> > by
> > > a separate application.
>
> > > Anthony
>
> > > On Thursday, April 28, 2011 5:42:54 AM UTC-4, selecta wrote:
> > > > i am currently writing an issue tracker, that works already quite
> > > > nicely
> > > > however I have a big problem
>
> > > > I want the issue tracker to create custom error messages
> > > > i learned that you can do this by modifying routes.py
> > > > routes_onerror = [ ('pyMantis/500', '/pyMantis/plugin_issue/
> > > > error_ticket') ]
>
> > > > this works quite well ... as long as the error is not in a model
> > > > since all models are executed before the view is shown this leads to
> > > > an infinite loop :(
> > > > is there a way to prevent this problem (e.g. different route on model
> > > > errors?)
>
> > > > btw a demo can be seen here
> > > >http://pymantis.org/pymantis_server/plugin_issue/index


[web2py] Re: Tr.lời: Re: Tr.lời: Re: Tr.lời: Re: web2py 1.95.1 and open issues

2011-04-28 Thread selecta
> What do you mean by corrupted error tickets? Do you have a traceback?
all I get is an unknow error, a printout in the shell and a ticket
file
if i try to access this ticket file in the appadmin i get the
traceback that i posted before


Traceback (most recent call last):
  File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/restricted.py",
line 181, in restricted
exec ccode in environment
  File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
controllers/default.py", line 1188, in 
  File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/globals.py", line
133, in 
self._caller = lambda f: f()
  File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
controllers/default.py", line 1033, in errors
error = pickle.load(open(fullpath, 'r'))
  File "/usr/lib/python2.6/pickle.py", line 1370, in load
return Unpickler(file).load()
  File "/usr/lib/python2.6/pickle.py", line 858, in load
dispatch[key](self)
  File "/usr/lib/python2.6/pickle.py", line 880, in load_eof
raise EOFError
EOFError


[web2py] Re: problems creating an issue tracker

2011-04-28 Thread selecta
hmm well ic, i guess this still not so bad
i will create two modes,
1) development mode that show the tickets directly (using app admin)
2) production mode that create custom error messages by redirecting to
the controller function (that also checks if this error was already
attached to an issue that can be dispalyed)
in production mode there should not be any errors in models, since the
whole app would not work
any objections to this logic?

On Apr 28, 4:02 pm, Anthony  wrote:
> You can redirect to static error pages, but assuming that's not what you
> want, I suppose the only alternative would be to have the errors handled by
> a separate application.
>
> Anthony
>
>
>
> On Thursday, April 28, 2011 5:42:54 AM UTC-4, selecta wrote:
> > i am currently writing an issue tracker, that works already quite
> > nicely
> > however I have a big problem
>
> > I want the issue tracker to create custom error messages
> > i learned that you can do this by modifying routes.py
> > routes_onerror = [ ('pyMantis/500', '/pyMantis/plugin_issue/
> > error_ticket') ]
>
> > this works quite well ... as long as the error is not in a model
> > since all models are executed before the view is shown this leads to
> > an infinite loop :(
> > is there a way to prevent this problem (e.g. different route on model
> > errors?)
>
> > btw a demo can be seen here
> >http://pymantis.org/pymantis_server/plugin_issue/index


[web2py] Re: Tr.lời: Re: Tr.lời: Re: Tr.lời: Re: web2py 1.95.1 and open issues

2011-04-28 Thread selecta
in a fresh mercurial checkout i commented out
jn = os.path.join in one of my models and the error messages were
normal again

in version 1.95.1 i commented out #mail = Mail()
and i had normal error messges again, complaining that mail is unknow
so i changed
auth.settings.mailer = mail
to
auth.settings.mailer = None

and the error messages are unknown again and only appear in the shell
i am stumbeling in the dark, what is going on here?

On Apr 28, 11:32 am, selecta  wrote:
> ok this cant be correct
> so i started importing things that were missing
>
> from gluon.tools import Auth #ok
> from gluon.tools import Crud #ok
> from gluon.tools import Service #ok
> from gluon.tools import Mail<-here it starts creating corrupt error
> tickets again
>
> On Apr 28, 11:11 am, selecta  wrote:
>
>
>
> > after deleting my app step by step i found it
> > i had
>
> > from gluon.tools import *
>
> > in one of my model files
> > this breaks the ticket generation!
>
> > On Apr 28, 11:06 am, selecta  wrote:
>
> > > I get an unkown error for every ticket that is created by my
> > > application
> > > I can see the print out of the error trackeback in the shell i started
> > > web2py in
> > > also the ticked pickle files are broken, when i open the admin to view
> > > the tickets i get
> > > Traceback (most recent call last):
> > >   File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/restricted.py",
> > > line 181, in restricted
> > >     exec ccode in environment
> > >   File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
> > > controllers/default.py", line 1188, in 
> > >   File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/globals.py", line
> > > 133, in 
> > >     self._caller = lambda f: f()
> > >   File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
> > > controllers/default.py", line 1033, in errors
> > >     error = pickle.load(open(fullpath, 'r'))
> > >   File "/usr/lib/python2.6/pickle.py", line 1370, in load
> > >     return Unpickler(file).load()
> > >   File "/usr/lib/python2.6/pickle.py", line 858, in load
> > >     dispatch[key](self)
> > >   File "/usr/lib/python2.6/pickle.py", line 880, in load_eof
> > >     raise EOFError
> > > EOFError
>
> > > this only is the case for my older applications, i cannot reproduce it
> > > with a newly created application


[web2py] Re: Tr.lời: Re: Tr.lời: Re: Tr.lời: Re: web2py 1.95.1 and open issues

2011-04-28 Thread selecta
in a fresh mercurial checkout i commented out
jn = os.path.join in one of my models and the error messages were
normal again

in version 1.95.1 i commented out #mail = Mail()
and i had normal error messges again, complaining that mail is unknow
so i changed
auth.settings.mailer = mail
to
auth.settings.mailer = None

and the error messages are unknown again and only appear in the shell

On Apr 28, 11:32 am, selecta  wrote:
> ok this cant be correct
> so i started importing things that were missing
>
> from gluon.tools import Auth #ok
> from gluon.tools import Crud #ok
> from gluon.tools import Service #ok
> from gluon.tools import Mail<-here it starts creating corrupt error
> tickets again
>
> On Apr 28, 11:11 am, selecta  wrote:
>
>
>
> > after deleting my app step by step i found it
> > i had
>
> > from gluon.tools import *
>
> > in one of my model files
> > this breaks the ticket generation!
>
> > On Apr 28, 11:06 am, selecta  wrote:
>
> > > I get an unkown error for every ticket that is created by my
> > > application
> > > I can see the print out of the error trackeback in the shell i started
> > > web2py in
> > > also the ticked pickle files are broken, when i open the admin to view
> > > the tickets i get
> > > Traceback (most recent call last):
> > >   File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/restricted.py",
> > > line 181, in restricted
> > >     exec ccode in environment
> > >   File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
> > > controllers/default.py", line 1188, in 
> > >   File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/globals.py", line
> > > 133, in 
> > >     self._caller = lambda f: f()
> > >   File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
> > > controllers/default.py", line 1033, in errors
> > >     error = pickle.load(open(fullpath, 'r'))
> > >   File "/usr/lib/python2.6/pickle.py", line 1370, in load
> > >     return Unpickler(file).load()
> > >   File "/usr/lib/python2.6/pickle.py", line 858, in load
> > >     dispatch[key](self)
> > >   File "/usr/lib/python2.6/pickle.py", line 880, in load_eof
> > >     raise EOFError
> > > EOFError
>
> > > this only is the case for my older applications, i cannot reproduce it
> > > with a newly created application


[web2py] problems creating an issue tracker

2011-04-28 Thread selecta
i am currently writing an issue tracker, that works already quite
nicely
however I have a big problem

I want the issue tracker to create custom error messages
i learned that you can do this by modifying routes.py
routes_onerror = [ ('pyMantis/500', '/pyMantis/plugin_issue/
error_ticket') ]

this works quite well ... as long as the error is not in a model
since all models are executed before the view is shown this leads to
an infinite loop :(
is there a way to prevent this problem (e.g. different route on model
errors?)

btw a demo can be seen here
http://pymantis.org/pymantis_server/plugin_issue/index



[web2py] Re: Tr.lời: Re: Tr.lời: Re: Tr.lời: Re: web2py 1.95.1 and open issues

2011-04-28 Thread selecta
ok this cant be correct
so i started importing things that were missing

from gluon.tools import Auth #ok
from gluon.tools import Crud #ok
from gluon.tools import Service #ok
from gluon.tools import Mail<-here it starts creating corrupt error
tickets again



On Apr 28, 11:11 am, selecta  wrote:
> after deleting my app step by step i found it
> i had
>
> from gluon.tools import *
>
> in one of my model files
> this breaks the ticket generation!
>
> On Apr 28, 11:06 am, selecta  wrote:
>
>
>
> > I get an unkown error for every ticket that is created by my
> > application
> > I can see the print out of the error trackeback in the shell i started
> > web2py in
> > also the ticked pickle files are broken, when i open the admin to view
> > the tickets i get
> > Traceback (most recent call last):
> >   File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/restricted.py",
> > line 181, in restricted
> >     exec ccode in environment
> >   File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
> > controllers/default.py", line 1188, in 
> >   File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/globals.py", line
> > 133, in 
> >     self._caller = lambda f: f()
> >   File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
> > controllers/default.py", line 1033, in errors
> >     error = pickle.load(open(fullpath, 'r'))
> >   File "/usr/lib/python2.6/pickle.py", line 1370, in load
> >     return Unpickler(file).load()
> >   File "/usr/lib/python2.6/pickle.py", line 858, in load
> >     dispatch[key](self)
> >   File "/usr/lib/python2.6/pickle.py", line 880, in load_eof
> >     raise EOFError
> > EOFError
>
> > this only is the case for my older applications, i cannot reproduce it
> > with a newly created application


[web2py] Re: Tr.lời: Re: Tr.lời: Re: Tr.lời: Re: web2py 1.95.1 and open issues

2011-04-28 Thread selecta
after deleting my app step by step i found it
i had

from gluon.tools import *

in one of my model files
this breaks the ticket generation!


On Apr 28, 11:06 am, selecta  wrote:
> I get an unkown error for every ticket that is created by my
> application
> I can see the print out of the error trackeback in the shell i started
> web2py in
> also the ticked pickle files are broken, when i open the admin to view
> the tickets i get
> Traceback (most recent call last):
>   File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/restricted.py",
> line 181, in restricted
>     exec ccode in environment
>   File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
> controllers/default.py", line 1188, in 
>   File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/globals.py", line
> 133, in 
>     self._caller = lambda f: f()
>   File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
> controllers/default.py", line 1033, in errors
>     error = pickle.load(open(fullpath, 'r'))
>   File "/usr/lib/python2.6/pickle.py", line 1370, in load
>     return Unpickler(file).load()
>   File "/usr/lib/python2.6/pickle.py", line 858, in load
>     dispatch[key](self)
>   File "/usr/lib/python2.6/pickle.py", line 880, in load_eof
>     raise EOFError
> EOFError
>
> this only is the case for my older applications, i cannot reproduce it
> with a newly created application


[web2py] Re: Tr.lời: Re: Tr.lời: Re: Tr.lời: Re: web2py 1.95.1 and open issues

2011-04-28 Thread selecta
I get an unkown error for every ticket that is created by my
application
I can see the print out of the error trackeback in the shell i started
web2py in
also the ticked pickle files are broken, when i open the admin to view
the tickets i get
Traceback (most recent call last):
  File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/restricted.py",
line 181, in restricted
exec ccode in environment
  File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
controllers/default.py", line 1188, in 
  File "/home/fkrause/Downloads/tmp/wp/web2py/gluon/globals.py", line
133, in 
self._caller = lambda f: f()
  File "/home/fkrause/Downloads/tmp/wp/web2py/applications/admin/
controllers/default.py", line 1033, in errors
error = pickle.load(open(fullpath, 'r'))
  File "/usr/lib/python2.6/pickle.py", line 1370, in load
return Unpickler(file).load()
  File "/usr/lib/python2.6/pickle.py", line 858, in load
dispatch[key](self)
  File "/usr/lib/python2.6/pickle.py", line 880, in load_eof
raise EOFError
EOFError

this only is the case for my older applications, i cannot reproduce it
with a newly created application


[web2py] typo

2011-04-27 Thread selecta
File "/home/select/Dev/web2py/gluon/sqlhtml.py", line 944, in
createform
raise RuntimeError, 'formsyle not supported'
RuntimeError: formsyle not supported


[web2py] Re: LOAD/web2py component improved web2py_trap_form

2011-04-25 Thread selecta

> So the solution to multiple forms using LOAD is to define a formname... I
> guess...
right this is the solution for multiple forms (for all pages, not just
LOADed pages)

this patch fixes something different:
ONE form, multiple submit buttons


[web2py] Re: LOAD/web2py component improved web2py_trap_form

2011-04-23 Thread selecta
what did not work? what is should do is add a click event to each
submit button and add a special property onclick
$("[type=submit],[type=image]", this).click(function(e){ $
(this).attr("was_clicked_to_submit","YES"); });
if the form is submitted it searches for that property
(was_clicked_to_submit) and adds this element to the variable list, if
you can it would be nice if you could debug it
look in firebug/dragonfly/... if was_clicked_to_submit is an attribute
of your submit button
maybe your submit button has a different type??


On Apr 23, 6:37 pm, Tito Garrido  wrote:
> Hi selecta,
>
> I've tried your patch and didn't work for me... I'm having the same
> problem... with 2 LOAD forms the submit behavior is intermitent.
>
> Regards,
>
> Tito
>
>
>
>
>
> On Sat, Apr 23, 2011 at 3:57 AM, Tito Garrido  wrote:
> > Wow! I just posted a message about this problem... +1 !
>
> > I'm using 2 forms with LOAD on the same page and I got the same problem...
> > it doesn't work on the first submit.
>
> > On Wed, Apr 13, 2011 at 5:12 PM, selecta  wrote:
>
> >> donehttp://code.google.com/p/web2py/issues/detail?id=232
>
> >> On Apr 11, 3:44 pm, Massimo Di Pierro 
> >> wrote:
> >> > No objection in principle but need to check implementation. Can you
> >> > please open an issue on google code and upload your propose patch.
> >> > Thanks.
>
> >> > Massimo
>
> >> > On Apr 7, 4:46 am, selecta  wrote:
>
> >> > > itsnt it annoying that when you have forms with multiple submit
> >> > > buttons in a web2py component the button that is clicked to submit the
> >> > > form is not submitted
> >> > > here is a fix for web2py_ajax.html
>
> >> > > now you can have forms with 2 or more submit buttons/images in web2py
> >> > > components
>
> >> > > diff -r 25822b3791e4 applications/welcome/views/web2py_ajax.html
> >> > > --- a/applications/welcome/views/web2py_ajax.html       Mon Apr 04
> >> 14:48:36
> >> > > 2011 -0500
> >> > > +++ b/applications/welcome/views/web2py_ajax.html       Thu Apr 07
> >> 11:44:37
> >> > > 2011 +0200
> >> > > @@ -72,9 +72,12 @@
> >> > >     jQuery('#'+target+' form').each(function(i){
> >> > >        var form=jQuery(this);
> >> > >        if(!form.hasClass('no_trap'))
> >> > > +         $("[type=submit],[type=image]", this).click(function(e){
> >> > > +             $(this).attr("was_clicked_to_submit","YES");
> >> > > +         });
> >> > >          form.submit(function(obj){
> >> > >           jQuery('.flash').hide().html('');
> >> > > -         web2py_ajax_page('post',action,form.serialize(),target);
> >> > > +         web2py_ajax_page('post',action,form.serialize() + "&" + $
> >> > > ("[was_clicked_to_submit=YES]").attr('name') + "=" + $
> >> > > ("[was_clicked_to_submit=YES]").val(),target);
> >> > >           return false;
> >> > >        });
> >> > >     });
>
> > --
>
> > Linux User #387870
> > .
> >  _/_õ|__|
> > ..º[ .-.___.-._| . . . .
> > .__( o)__( o).:___
>
> --
>
> Linux User #387870
> .
>  _/_õ|__|
> ..º[ .-.___.-._| . . . .
> .__( o)__( o).:___


[web2py] Re: IMPROVED: show error tickets directly if you are a authorized web2py admin

2011-04-22 Thread selecta
playing around with it i realised that inluding the admin css file is
not a good idea
a new css file would have to be added that works better with error
messages in web2py components, will get to that after easter, latest


[web2py] Re: IMPROVED: show error tickets directly if you are a authorized web2py admin

2011-04-21 Thread selecta


On Apr 21, 8:04 pm, pbreit  wrote:
> This potentially saves one click
right not more not less
>and prevents opening the error in a new tab?
why? the link is still there, you can do it if you want to
>
> -1


[web2py] Re: custom error ticket message

2011-04-21 Thread selecta
i dont think this would help since the issue tracker should be a
plugin
as a plugin it can only provide files and folders starting with
plugin_
:(

On Apr 21, 3:59 pm, Anthony  wrote:
> Would it help to use app-specific routes (i.e., put a routes.py file in the
> application folder)?
>
>
>
> On Thursday, April 21, 2011 9:37:33 AM UTC-4, selecta wrote:
> > that is not so nice, it would be a lot better if i could define the
> > error message in my application
> > the reason is that i created an issue tracker plugin that should
> > directly be displayed with the error message
> > however since this is a plugin it may not be available in every
> > application, also the plugin should not have to modify routes to work
> > can this be fixed?
>
> > On Apr 21, 3:07 pm, Anthony  wrote:
> > > I think you should be able to specify that in routes.py, as explained
> > here:http://web2py.com/book/default/chapter/04#Routes-on-Error
>
> > > On Thursday, April 21, 2011 5:44:26 AM UTC-4, selecta wrote:
> > > > I found that in rewrite.py
> > > > def _params_default(app=None):
> > > > there is
> > > >    p.error_message_ticket = ...
>
> > > > Is there a way to customise/overwrite this error messag in my
> > > > application?
> > > > or do i have to edit rewrite.py to customize it


[web2py] IMPROVED: show error tickets directly if you are a authorized web2py admin

2011-04-21 Thread selecta
this patch fixes the files needed to show error tickets directly if
you are logged in into the admin app
if not you will only see the old error message, nothing else

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

massimo, it would be really nice if you could look at this and include
it into web2py as it speeds up the development of web2py applications
alot

this was discussed many times before
http://groups.google.com/group/web2py/browse_thread/thread/a5ce9867336d7193
http://groups.google.com/group/web2py/browse_thread/thread/817ae6e1b1e6baa5
http://groups.google.com/group/web2py/browse_thread/thread/8be17358de52122c
...

this is one step towards a issue tracker that i try to create, another
thing that i would need is here
http://groups.google.com/group/web2py/browse_thread/thread/36de28ac878b7cb4/52365af581f80763#52365af581f80763




[web2py] Re: custom error ticket message

2011-04-21 Thread selecta
that is not so nice, it would be a lot better if i could define the
error message in my application
the reason is that i created an issue tracker plugin that should
directly be displayed with the error message
however since this is a plugin it may not be available in every
application, also the plugin should not have to modify routes to work
can this be fixed?

On Apr 21, 3:07 pm, Anthony  wrote:
> I think you should be able to specify that in routes.py, as explained 
> here:http://web2py.com/book/default/chapter/04#Routes-on-Error
>
>
>
> On Thursday, April 21, 2011 5:44:26 AM UTC-4, selecta wrote:
> > I found that in rewrite.py
> > def _params_default(app=None):
> > there is
> >    p.error_message_ticket = ...
>
> > Is there a way to customise/overwrite this error messag in my
> > application?
> > or do i have to edit rewrite.py to customize it


[web2py] custom error ticket message

2011-04-21 Thread selecta
I found that in rewrite.py
def _params_default(app=None):
there is
   p.error_message_ticket = ...

Is there a way to customise/overwrite this error messag in my
application?
or do i have to edit rewrite.py to customize it


[web2py] Re: LOAD/web2py component improved web2py_trap_form

2011-04-13 Thread selecta
done http://code.google.com/p/web2py/issues/detail?id=232

On Apr 11, 3:44 pm, Massimo Di Pierro 
wrote:
> No objection in principle but need to check implementation. Can you
> please open an issue on google code and upload your propose patch.
> Thanks.
>
> Massimo
>
> On Apr 7, 4:46 am, selecta  wrote:
>
>
>
> > itsnt it annoying that when you have forms with multiple submit
> > buttons in a web2py component the button that is clicked to submit the
> > form is not submitted
> > here is a fix for web2py_ajax.html
>
> > now you can have forms with 2 or more submit buttons/images in web2py
> > components
>
> > diff -r 25822b3791e4 applications/welcome/views/web2py_ajax.html
> > --- a/applications/welcome/views/web2py_ajax.html       Mon Apr 04 14:48:36
> > 2011 -0500
> > +++ b/applications/welcome/views/web2py_ajax.html       Thu Apr 07 11:44:37
> > 2011 +0200
> > @@ -72,9 +72,12 @@
> >     jQuery('#'+target+' form').each(function(i){
> >        var form=jQuery(this);
> >        if(!form.hasClass('no_trap'))
> > +         $("[type=submit],[type=image]", this).click(function(e){
> > +             $(this).attr("was_clicked_to_submit","YES");
> > +         });
> >          form.submit(function(obj){
> >           jQuery('.flash').hide().html('');
> > -         web2py_ajax_page('post',action,form.serialize(),target);
> > +         web2py_ajax_page('post',action,form.serialize() + "&" + $
> > ("[was_clicked_to_submit=YES]").attr('name') + "=" + $
> > ("[was_clicked_to_submit=YES]").val(),target);
> >           return false;
> >        });
> >     });


[web2py] Re: LOAD/web2py component improved web2py_trap_form

2011-04-11 Thread selecta
*bump*
massimo will you include this?

On Apr 7, 11:46 am, selecta  wrote:
> itsnt it annoying that when you have forms with multiple submit
> buttons in a web2py component the button that is clicked to submit the
> form is not submitted
> here is a fix for web2py_ajax.html
>
> now you can have forms with 2 or more submit buttons/images in web2py
> components
>
> diff -r 25822b3791e4 applications/welcome/views/web2py_ajax.html
> --- a/applications/welcome/views/web2py_ajax.html       Mon Apr 04 14:48:36
> 2011 -0500
> +++ b/applications/welcome/views/web2py_ajax.html       Thu Apr 07 11:44:37
> 2011 +0200
> @@ -72,9 +72,12 @@
>     jQuery('#'+target+' form').each(function(i){
>        var form=jQuery(this);
>        if(!form.hasClass('no_trap'))
> +         $("[type=submit],[type=image]", this).click(function(e){
> +             $(this).attr("was_clicked_to_submit","YES");
> +         });
>          form.submit(function(obj){
>           jQuery('.flash').hide().html('');
> -         web2py_ajax_page('post',action,form.serialize(),target);
> +         web2py_ajax_page('post',action,form.serialize() + "&" + $
> ("[was_clicked_to_submit=YES]").attr('name') + "=" + $
> ("[was_clicked_to_submit=YES]").val(),target);
>           return false;
>        });
>     });


[web2py] Re: Fwd: web2py_1.92.1-1_i386.changes ACCEPTED into unstable

2011-04-11 Thread selecta
+1 yeay

On Apr 10, 11:30 pm, Massimo Di Pierro 
wrote:
> +1
>
> On Apr 10, 9:35 am, José Luis Redrejo Rodríguez 
> wrote:
>
>
>
> > It's just been accepted into Debian. I'll upload latest stable version
> > available (1.94.6) inwww.web2py.comtomorrow.
> > So, from now on, Debian users can install it with apt-get  from
> > unstable (sid), and in ten days from testing (wheezy).
>
> > Also, as Ubuntu syncs from Debian every few weeks, it will be
> > available in the next release of Ubuntu very soon.
>
> > Regards.
>
> > -- Forwarded message --
> > From: Debian FTP Masters 
> > Date: 2011/4/10
> > Subject: web2py_1.92.1-1_i386.changes ACCEPTED into unstable
> > To: "José L. Redrejo Rodríguez" 
>
> > Accepted:
> > python-gluon_1.92.1-1_all.deb
> >  to main/w/web2py/python-gluon_1.92.1-1_all.deb
> > python-web2py_1.92.1-1_all.deb
> >  to main/w/web2py/python-web2py_1.92.1-1_all.deb
> > web2py_1.92.1-1.debian.tar.gz
> >  to main/w/web2py/web2py_1.92.1-1.debian.tar.gz
> > web2py_1.92.1-1.dsc
> >  to main/w/web2py/web2py_1.92.1-1.dsc
> > web2py_1.92.1.orig.tar.gz
> >  to main/w/web2py/web2py_1.92.1.orig.tar.gz
>
> > Override entries for your package:
> > python-gluon_1.92.1-1_all.deb - optional python
> > python-web2py_1.92.1-1_all.deb - optional python
> > web2py_1.92.1-1.dsc - source python
>
> > Announcing to debian-devel-chan...@lists.debian.org
> > Closing bugs: 583384
>
> > Thank you for your contribution to Debian.


[web2py] Re: component and jquery lightbox

2011-04-07 Thread selecta
i am also not sure what you exactly mean, but guessing from the fact
that you have a table with an upload field the code above would work
for that
here is a more complete example

db.define_table('mytable', Field('myfield','upload'))
db.mytable.insert(myfield = db.mytable.myfield.store(open('/etc/
issue'), 'issue file'))
#this is done somewhere in the background when a form is processed so
'issue file' would be the original file name in that case

record = db.mytable[1]
filename, file = db.mytable.myfile.retrieve(record.myfile)
print A(filename, _href = URL(request.application, 'default',
'download', args = record.myfile))

it returns
issue file

so you have the original file name and the name under which it is
stored? what other original file name would you need?

On Apr 7, 1:53 pm, carlo  wrote:
> mmh, thank you Selecta but I think I did not understand that.
> Could you point me to one of the past posts?
> I do not want to store the original filename in my table, just to get
> the decoded original filename (the one used by the download function
> to set the disposition header).
> I do not think your solution addresses that but maybe I am wrong
> sorry.
>
> On 7 Apr, 13:24, selecta  wrote:
>
>
>
> > record = db.mytable[1]
> > filename, file = db.mytable.myfile.retrieve(record.myfile)
> > A('%s'%filename, _href = URL(request.application, 'default',
> > 'download', args = record.myfile))
>
> > i read the answer on this mailing list and i provided it to others
> > like 50 times, this should go into the FAQ of web2py


[web2py] Re: component and jquery lightbox

2011-04-07 Thread selecta
record = db.mytable[1]
filename, file = db.mytable.myfile.retrieve(record.myfile)
A('%s'%filename, _href = URL(request.application, 'default',
'download', args = record.myfile))

i read the answer on this mailing list and i provided it to others
like 50 times, this should go into the FAQ of web2py


[web2py] LOAD/web2py component improved web2py_trap_form

2011-04-07 Thread selecta
itsnt it annoying that when you have forms with multiple submit
buttons in a web2py component the button that is clicked to submit the
form is not submitted
here is a fix for web2py_ajax.html

now you can have forms with 2 or more submit buttons/images in web2py
components


diff -r 25822b3791e4 applications/welcome/views/web2py_ajax.html
--- a/applications/welcome/views/web2py_ajax.html   Mon Apr 04 14:48:36
2011 -0500
+++ b/applications/welcome/views/web2py_ajax.html   Thu Apr 07 11:44:37
2011 +0200
@@ -72,9 +72,12 @@
jQuery('#'+target+' form').each(function(i){
   var form=jQuery(this);
   if(!form.hasClass('no_trap'))
+ $("[type=submit],[type=image]", this).click(function(e){
+ $(this).attr("was_clicked_to_submit","YES");
+ });
 form.submit(function(obj){
  jQuery('.flash').hide().html('');
- web2py_ajax_page('post',action,form.serialize(),target);
+ web2py_ajax_page('post',action,form.serialize() + "&" + $
("[was_clicked_to_submit=YES]").attr('name') + "=" + $
("[was_clicked_to_submit=YES]").val(),target);
  return false;
   });
});


[web2py] Re: Congratulations to this mailing list

2011-04-04 Thread selecta
ah i was just about to complain that the main page still links to a
strange irc channel, but that finally changed
i guess this is one of the reasons why there are so few people in the
irc channel, it was just not linked properly

On Apr 4, 9:38 am, Mengu  wrote:
> it's because they beat us on the number of irc users. :)
>
> as of april 4, 2011, 10:33 am gmt +2, #django has 289 users,
> #rubyonrails has 498 users, #web2py has 16 users. we are definitely
> more than that. just come to irc, especially yourself massimo. of
> course we cannot underestimate the number of posts in all 3 mailing
> lists. it's not a secret that web2py mailing list is the most active
> one among the python web frameworks. pylons, pyramid, turbogears,
> web.py, etc have very very low activity.
>
> On Apr 4, 3:32 am, Esteban Ordano  wrote:
>
>
>
> > Congratulations!
>
> > I'm really fond of the web2py framework. In fact, after having used both
> > web2py and django, I am very biased towards web2py. I think that you simply
> > *get* it, and you did a excellent job, and you keep on doing great work.
>
> > But I think that this has to be taken with extreme caution: What does this
> > *really* say about web2py?
>
> > Most of all, beware: I think that a very big pro for django is that in
> > stackoverflow.com there are 16k questions on Django, so this may mean that a
> > lot of questions get answered there instead of being asked in the django
> > mailing list.
>
> > Regards,
> > Esteban
>
> > On Sun, Apr 3, 2011 at 9:16 PM, Massimo Di Pierro <
>
> > massimo.dipie...@gmail.com> wrote:
> > > Here is another plot adding Ruby on Rails data (rubyonrails-talk)
>
> > >http://i.imgur.com/sPLzH.png
>
> > > we passed them too as messages/month since Dec 2010.
> > > According to this (http://rubyonrails.org/community) rubyonrails-talk
> > > is the main Rails list for users.
>
> > > Massimo
>
> > > On Apr 3, 7:08 pm, Anthony  wrote:
> > > > I don't have exact numbers, but over the past 11 months, I think the
> > > web2py
> > > > Google Group membership has grown by over 50%. By contrast, it appears
> > > the
> > > > Django Google Group membership has grown by only about 10%-15%. I guess
> > > > there's a reason there were three April Fools jokes on Reddit targeting
> > > > web2py. :)
>
> > > > On Sunday, April 3, 2011 7:53:35 PM UTC-4, Massimo Di Pierro wrote:
> > > > > I mined some data from:
>
> > > > >http://groups.google.com/group/web2py/about
> > > > >http://groups.google.com/group/django-users/about
>
> > > > > This web2py users group had 56,283 messages posted since 1/1/2009. The
> > > > > Django-users list had 51,119 over the same time period.
>
> > > > > Here is a plot showing the messages/month in the two users groups
> > > > >http://i.imgur.com/GHcce.png
> > > > > As you can see the surpass is significative and consistent since Oct
> > > > > 2009.
>
> > > > > Now we know why some people are upset about web2py ;-)
>
> > > > > Congratulations to all of you!
>
> > > > > Massimo


[web2py] Re: GSOC 2011 - BioChemical Reaction Network Visualization - web2py

2011-04-01 Thread selecta

> can you summarize for us, what is done, what needs to be done.

so far we have experiences visualizing biochemical networks with tools
like Cytoscape, Graphviz, ... we even wrote our own web2py plugin to
create force directed graphs
http://groups.google.com/group/web2py/browse_thread/thread/d9c5b9ef9ddf2e49/63cec30770d1ef9f?lnk=gst
and we have drawn tons of network images by hand,
but this is not enough, what we really need is

1) a fast layout algorithm that creates good layout for biochemical
graphs (better than force directed, ...)
2) a js library that renders these layouts in a standard compiant way
in SVG,
- so far the only standard for drawing biochemical networks out there
is SBGN (http://sbgn.org/Main_Page see here for some examples) and we
intend to use that
- SVG images because the can be displayed in a browser (http://
slides.html5rocks.com/)
- SVG images can be edited with (e.g. Inkskape) and that is crucial
since no layout algorithm will generate images good enough for
publications, wikipeda, ...
3) a communication layer that calls our new layout algorithm (and
possibly others that are available) and uses the js lib to show the
result in a browser, this is where web2py could act as the
communication layer
4) an extension to the js library 2) so that the images can edited on
the web (this will also have to communicate to 3) somehow)
- this lowers the border for people to create standard compliant
images
5) an extension to the communication layer 3) so that it access all
kinds of databases that contain biochemical reaction networks and
visualizes them (we have plenty of experinces with that, but it is
hard work every time you want to do something like that)


you probably see that all the ideas depend on each other and that some
of the steps can be unified/done by one developer
so far a lot of people are interested in 1) and also some in 2) but
for 3) we there was nobody really showing much interest

The development will start from scratch but we a optimistic that we
will have some good results within the two month with a team of 3
students and about 6 mentors

Finally I should mention that we have a experience in using web2py
(http://pymantis.org/ http://semanticsbml.org/semanticSBML/
http://sysbio-goods.org/ ...) and other tools and programming
languages (some of the tools developed in our group:
http://www2.hu-berlin.de/biologie/theorybp/index.php?goto=tools)


[web2py] Re: GSOC 2011 - BioChemical Reaction Network Visualization - web2py

2011-03-31 Thread selecta
we are still looking for people that help us with Idea3
if you do not want to join you could help us find someone with web2py
skills by retweeting this message: 
http://twitter.com/#!/rockdapus/status/53396283687313408

otherwise it might be done in django or some non python framework ...
o_O

On Mar 22, 3:59 pm, selecta  wrote:
> Hi web2py coders,
> I am very happy to tell you that my group - Theoretical Biophysics at
> the HU-Berlin - got selected for a mentoring program for the GSOC2011
> (http://code.google.com/soc/). We want to create an new layout
> algorithm for biochemical reaction networks, a visualization of the
> reaction network using SVG and SBGN and a web based (js) SVG editor
> for the reaction networks.
>
> One of the software tools that we would need is a communication layer
> that brings the graph visualization to the browser. Since we develop a
> lot of software in our group with the help of web2py it would be great
> if one of you would be interested in helping us to achieve our vision.
> The work will have to be done within two month during the summer and
> you would get payed a nice amount of money by google.
>
> You will find more information about ourGSOCproject 
> herehttp://rumo.biologie.hu-berlin.de/gsoc/(read especially Idea 3)
>
> If you are interested and you want to discuss ideas with us 
> joinhttp://groups.google.com/group/tbp-soc2011-stud
>
> Please be aware that if you want to join you should bring some coding
> skills. In addition to that please be aware that Idea 3 does not have
> the highest priority since it depends on other components (layout
> algorithm and SVG rendering) which some of you might also be
> interested in.


[web2py] Re: squeeze + Apache2 = lots of RAM

2011-03-28 Thread selecta
> Anybody is using Apache2 with Debian 6?
>
> I just upgraded from Debian 5 to 6, and notice an obscene amount of
> memory taken by Apache2, which almost 600MB.   Unbelievable.   In
> Debian 5, it took about 300MB.

I tried this setup on my virtual machine server (256MB ram) and i
could not get web2py (rocket server) to start :/ took me quite a while
to interpret the error messages from rocket correctly
the problem is that apache "reserves" all this memory while not even
using it, I switched to lighttpd
http://www.web2pyslices.com/main/slices/take_slice/96


[web2py] Re: another video: web2py components

2011-03-23 Thread selecta

> Because we do not use them enough and feel we have room for
> improvement.

ha what do you mean? components are my fav in web2py :D

http://www.web2pyslices.com/main/slices/take_slice/74

http://pymantis.org/ -> plugin_restapidoc
created it within a few hours with the heavy use of components

http://semanticsbml.org/semanticSBML/sbmldiff/index/biomodels
and one the my most awesome use of components :P
source here
http://semanticsbml.svn.sourceforge.net/viewvc/semanticsbml/trunk/webui/controllers/sbmldiff.py?revision=3285&view=markup


[web2py] GSOC 2011 - BioChemical Reaction Network Visualization - web2py

2011-03-22 Thread selecta
Hi web2py coders,
I am very happy to tell you that my group - Theoretical Biophysics at
the HU-Berlin - got selected for a mentoring program for the GSOC2011
(http://code.google.com/soc/). We want to create an new layout
algorithm for biochemical reaction networks, a visualization of the
reaction network using SVG and SBGN and a web based (js) SVG editor
for the reaction networks.

One of the software tools that we would need is a communication layer
that brings the graph visualization to the browser. Since we develop a
lot of software in our group with the help of web2py it would be great
if one of you would be interested in helping us to achieve our vision.
The work will have to be done within two month during the summer and
you would get payed a nice amount of money by google.

You will find more information about our GSOC project here
http://rumo.biologie.hu-berlin.de/gsoc/ (read especially Idea 3)

If you are interested and you want to discuss ideas with us join
http://groups.google.com/group/tbp-soc2011-stud

Please be aware that if you want to join you should bring some coding
skills. In addition to that please be aware that Idea 3 does not have
the highest priority since it depends on other components (layout
algorithm and SVG rendering) which some of you might also be
interested in.


[web2py] Re: plugins

2011-03-22 Thread selecta
For the the pyMantis project I created the following plugins. Since
they are integrated into the access management of pyMantis some of
them will need some small modifications to make them work with other
applications.

download the web2py app package from, the os releases are currently
broken but will be fixed in the next days
http://pymantis.org/pymantis_server/plugin_release/download

plugin_calendar
just a test to use the jquery calendar plugin, and some code of the
calendar app (???) to create a google like calendar (will need much
more development)

plugin_chat
fb like chat plugin, but for all registered users in one chat (uses
simple polling and has some z-index issues, but is already quite cool)

plugin_comments
my version of the comment plugin (not so great)

plugin_doc
should automatically create documentation of your web2py app using
docstrings (will need much more work, since lib2to3 has to be used
(inspection does not work on web2py apps) and I got tied up with other
things, but I guess it will be worth it if you need a good looking
documentation of you web2py app code)

plugin_filepreview
create HTML previews of filetypes pdf, doc, xls, images,

plugin_forcedirected
create forecedirected graphs in your browser using html5 canvas

plugin_useradmin
a nice visual use admin (create users, edit userinformation, create
groups, add/remove users to/from group, block/unblock/validate
users, ...)

plugin_mailinglist
creates a mailinglist/group similar to this one (still under
development)

plugin_release
this is the latest one, and I am quite proud of it
creates releases of your software (standalone win, src/linux, mac -
w2p packages) with a client and a server instance that allows clients
to automatically check for updates of your web2py app with a nice
"update" button

plugin_restapidoc
create a nice looking documentation of your web2py REST interface

plugin_tagging
Tagging plugin, this is not the same as the one that is on the plugin
list. This one allows you to put multiple tag clouds and forms on one
page, it is uses specific and only works for logged in uses.

plugin_tagging_hyperlink
similar to the above but for hyperlinks

plugin_tagging_miriam
similar to the above but for MIRIAM annotations (http://biomodels.net/
miriam/) needs libSBAnnotation (svn it from 
https://sourceforge.net/projects/semanticsbml/)
in your site-packages (still under development)

plugin_tagging_pubmed
similar to the above, it uses the PubMed REST interface to get papers
from keyword or DOI/pubmed ids

plugin_tracker
bug tracker (got bored developing it so it is not so good, also
depends on plugin_comments...)

plugin_webfolder
creates a win explorer like webinterface where you can upload your
files into a treebases folder structure, use drag and drop to move
files, used plugin_filepreview to view files (itegrates with the
pyMantis access management, so you will have to modify this plugin if
you want to use this in another app)


[web2py] Re: Converting legacy MySQL databases to web2py DAL

2011-03-22 Thread selecta

> just trying to get to a point where i can do the db structure scrape to
> create the web2py db code as i interpret that is what your code does

yes the script uses the mysql and mysqldump excecutables to dump the
table structures and parses that with regular expressions

Nice work Kevin, I have had only created and used for it once to
migrate our legacy db to pyMantis but I am planning to add this as a
feature the pyMantis so this comes in very handy :D


[web2py] Re: Bypassing tickets in development

2011-02-08 Thread selecta
there was already a suggestion for that,
the answer was to take the methods for displaying the tickets and
displaying the ticket content instead of the link if the user has the
right permissions, should be straight forward for somebody a bit into
the web2py code
unfortunately nobody had time/interest yet to implement it
i would love to have it too but also no time currently, so keep
bugging until somebody finally implements it or do it yourself
i remember that massimo said he also likes the idea :D

On Feb 9, 1:29 am, Dane  wrote:
> Would it be possible to set a flag for bypassing the ticketing system
> and just displaying errors on the page during development?
>
> The current system is nice for production, but it's a bit of hassle to
> go through two extra links and enter a password just to see the error
> trace in development.
>
> -Dane


[web2py] Re: password reset does not work

2011-02-08 Thread selecta
yes that is true, thanks alot, :D

any chance to get a better error message for this? oh wait yes, I
should write a patch :P

On Feb 7, 3:39 pm, Massimo Di Pierro 
wrote:
> Looks like you have a custom auth_user table that misses the field
> reset_password_key
>
> Massimo
>
> On Feb 7, 5:29 am, selecta  wrote:
>
>
>
> > Traceback (most recent call last):
> >   File "/home/fkrause/Dev/web2py/gluon/restricted.py", line 188, in
> > restricted
> >     exec ccode in environment
> >   File "/home/fkrause/Dev/web2py/applications/pyMantis/controllers/
> > default.py", line 101, in 
> >   File "/home/fkrause/Dev/web2py/gluon/globals.py", line 95, in
> > 
> >     self._caller = lambda f: f()
> >   File "/home/fkrause/Dev/web2py/applications/pyMantis/controllers/
> > default.py", line 61, in user
> >     return dict(form=auth())
> >   File "/home/fkrause/Dev/web2py/gluon/tools.py", line 1037, in
> > __call__
> >     elif args[0] == 'retrieve_username':
> >   File "/home/fkrause/Dev/web2py/gluon/tools.py", line 2033, in
> > retrieve_password
> >     onvalidation=DEFAULT,
> >   File "/home/fkrause/Dev/web2py/gluon/tools.py", line 2009, in
> > request_reset_password
> >     if self.settings.mailer.send(to=form.vars.email,
> >   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1250, in 
> >     else:
> >   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 4438, in
> > update_record
> >     def __invert__(self):
> >   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 4399, in update
> >     except:
> >   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 854, in update
> >     self.execute(sql)
> >   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1061, in execute
> >   File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1058, in
> > log_execute
> > OperationalError: near "WHERE": syntax error
>
> > ...
>
> > (self=, *a=('UPDATE auth_user SET
> > WHERE (auth_user.id = 1);',), **b={})
>
> > did I do something wrong?


[web2py] password reset does not work

2011-02-07 Thread selecta
Traceback (most recent call last):
  File "/home/fkrause/Dev/web2py/gluon/restricted.py", line 188, in
restricted
exec ccode in environment
  File "/home/fkrause/Dev/web2py/applications/pyMantis/controllers/
default.py", line 101, in 
  File "/home/fkrause/Dev/web2py/gluon/globals.py", line 95, in

self._caller = lambda f: f()
  File "/home/fkrause/Dev/web2py/applications/pyMantis/controllers/
default.py", line 61, in user
return dict(form=auth())
  File "/home/fkrause/Dev/web2py/gluon/tools.py", line 1037, in
__call__
elif args[0] == 'retrieve_username':
  File "/home/fkrause/Dev/web2py/gluon/tools.py", line 2033, in
retrieve_password
onvalidation=DEFAULT,
  File "/home/fkrause/Dev/web2py/gluon/tools.py", line 2009, in
request_reset_password
if self.settings.mailer.send(to=form.vars.email,
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1250, in 
else:
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 4438, in
update_record
def __invert__(self):
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 4399, in update
except:
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 854, in update
self.execute(sql)
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1061, in execute
  File "/home/fkrause/Dev/web2py/gluon/dal.py", line 1058, in
log_execute
OperationalError: near "WHERE": syntax error

...

(self=, *a=('UPDATE auth_user SET
WHERE (auth_user.id = 1);',), **b={})

did I do something wrong?


[web2py] Re: response.view does not work with @cache

2011-01-27 Thread selecta
very nice, thank you

On Jan 26, 6:19 pm, Massimo Di Pierro 
wrote:
> You can put this in a model:
>
> if application.function='option': response.view='default.html'
>
> On Jan 26, 9:41 am, selecta  wrote:
>
>
>
> > this will not work since the inforamtion that a different view should
> > be userd is not chached
> > @cache(request.env.path_info, time_expire=360, cache_model=cache.ram)
> > def option():
> >     items = []
> >     items.append( ITEM_SLINK('&Books', URL(r=request, f='index'),
> > 'back') )
> >     ...
> >     response.view='default.html'
> >     return dict( content = TAG[''](items) )
>
> > i am not sure if there is/will be a solution to this problem, but i
> > wanted to let you know that this problem exists
>
> > ... but if there is a solution, please let me know


[web2py] response.view does not work with @cache

2011-01-26 Thread selecta
this will not work since the inforamtion that a different view should
be userd is not chached
@cache(request.env.path_info, time_expire=360, cache_model=cache.ram)
def option():
items = []
items.append( ITEM_SLINK('&Books', URL(r=request, f='index'),
'back') )
...
response.view='default.html'
return dict( content = TAG[''](items) )

i am not sure if there is/will be a solution to this problem, but i
wanted to let you know that this problem exists

... but if there is a solution, please let me know


[web2py] auto login when you come from localhost

2011-01-21 Thread selecta
http://www.web2pyslices.com/main/slices/take_slice/118

if you have an application that has access control it can be annoying
to log in every time even though you are on localhost. This small
snippet will automatically log you in as the first user when you come
from localhost


put the following in your db.py model (or any other)
import os.path
if not auth.is_logged_in() and db(db.auth_user.id>0).count() and not
os.path.exists(os.path.join(request.folder, 'LOCK')) and
(request.env.remote_addr in '127.0.0.1 localhost'.split()):
from gluon.storage import Storage
user = db(db.auth_user.id==1).select().first()
auth.user = Storage(auth.settings.table_user._filter_fields(user,
id=True))
auth.environment.session.auth = Storage(user=user,
last_visit=request.now,
 
expiration=auth.settings.expiration)
response.flash = 'You were automatically logged in as %s %s.
To prevent this create the file %s'%(user.first_name, user.last_name,
os.path.join(request.folder, 'LOCK'))

You will be automatically logged in as the first user if you call your
web2py app from localhost or 127.0.0.1 you can prevent this behavior
by creating a file called LOCK in your application root directory


[web2py] Re: Storing the Original Filename in the official web2py book

2011-01-14 Thread selecta
no need to store the original filename

record = db(db.mytable.id==1).select().first()
filename, file = db.mytable.uploadfield.retrieve(record.uploadfield)
A('%s'%filename, _href = URL(request.application, 'default',
'download', args = [record.uploadfield]))

On Jan 14, 9:29 am, cjrh  wrote:
> bump


[web2py] Re: ajax upload for components

2011-01-11 Thread selecta
and just for completion my slice doing something similar
http://web2pyslices.com/main/slices/take_slice/113

On Jan 10, 11:35 pm, Michele Comitini 
wrote:
> I made a slice:
>
> http://web2pyslices.com/main/slices/take_slice/114
>
> mic
>
> 2011/1/10 K.R.Arun :
>
>
>
> > Can you show me an example with file upload using jQuery form plugin?
> > Michele Comitini wrote:
> >> sorry i have to repeat myself, use the following, it is working and it
> >> is simple:
> >>http://jquery.malsup.com/form/
>
> >> it does everything for you, and gives more control than 
> >> LOAD(...,ajax=True).
>
> >> mic
> >> 2011/1/9 Massimo Di Pierro :
>
> >> > On Jan 9, 2011, at 11:31 AM, Arun K.Rajeevan wrote:
>
> >> > iframe works its own. I'm not a pro on javascript.
> >> > May be there is a way in js to access parent document from within iframe.
> >> > If there's so, you can write your own js code to update main page (which
> >> > embeds iframe).
>
> >> > yes there is. windows. parent
> >> >http://developer.apple.com/internet/webcontent/iframe.html
>
> >> > I can tell you one more suggestion.
> >> > If the parts in the page to be uploaded after each upload is represented
> >> > together in the document,
> >> > you can redesign the page so that, upload form and parts to be updated
> >> > are separated out to a component and load it into iframe.
> >> > Since everything is within same scope (iframe) it'll work.
> >> > Sorry, I'm not an expert to suggest a way (if part to be uploaded are
> >> > scattered in the main document)
> >> > (I'm pretty sure JS can do that.)  also you are not limited to use only
> >> > uploadify there are others too.
> >> > --
> >> > mail from:GoogleGroups "web2py-developers" mailing list
> >> > make speech: web2py-develop...@googlegroups.com
> >> > unsubscribe: web2py-developers+unsubscr...@googlegroups.com
> >> > details :http://groups.google.com/group/web2py-developers
> >> > the project:http://code.google.com/p/web2py/
> >> > official :http://www.web2py.com/
>
> >> > --
> >> > mail from:GoogleGroups "web2py-developers" mailing list
> >> > make speech: web2py-develop...@googlegroups.com
> >> > unsubscribe: web2py-developers+unsubscr...@googlegroups.com
> >> > details :http://groups.google.com/group/web2py-developers
> >> > the project:http://code.google.com/p/web2py/
> >> > official :http://www.web2py.com/


  1   2   3   4   >