[web2py:35419] Multiple requires IS_IN_DB dropdown filter

2009-11-15 Thread rondevu
I am trying to create a dropdown using SQLFORM.factory using requires=IS_IN_DB(db,'field_val','represented_by') validator. I need to create a dropdown containing selected rows only. Is it possible to filter the resulting dropdown list that is returned to i.e. the column record which only has the

[web2py:35418] /user/not_authorized should raise 403

2009-11-15 Thread Wiiboy
Shouldn't /[app]/default/user/not_authorized raise a 403 error? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from th

[web2py:35417] Re: customizing auth_user

2009-11-15 Thread Wiiboy
It looks like it's line 792 in tools.py --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email

[web2py:35416] Re: ajax standard forms

2009-11-15 Thread Wiiboy
I'm not totally sure what you're trying to do, but I don't know why you'd use "input:visible:enabled:first.focus()" to send the request. I'd use $(document).ready(function() { $("form").submit(function() { //Send request, etc. here }) }) --~--~-~--~~~--

[web2py:35415] Re: customizing auth_user

2009-11-15 Thread Wiiboy
Ahh, on trying to DB-Admin the table auth_membership, I get this: Traceback (most recent call last): File "/media/apps/web2py/gluon/restricted.py", line 184, in restricted exec ccode in environment File "/media/apps/web2py/applications/main/controllers/appadmin.py", line 261, in File "/

[web2py:35414] Working with NoSQLs?

2009-11-15 Thread David Mitchell
Hello everyone, I've done a bunch of work recently with CouchDB on Ruby, and now there's an interesting article on using Python with Redis at http://simonwillison.net/2009/Oct/22/redis/ Is there any work being done to have web2py work with these, or other, "NoSQL" databases? Right now, I really

[web2py:35413] Re: decimal type in web2py

2009-11-15 Thread DenesL
New decimal tested OK with MS SQL. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2

[web2py:35412] web2py job on GetAFreelancer

2009-11-15 Thread Richard
Came a across a job that involves web2py at http://www.getafreelancer.com/projects/Python-Linux/Python-developer-web.html """ Description I need a python developer who has very good knowledge in Python web2py framework. You must be strong in networking programming and also know the irc protocol.

[web2py:35411] Re: Replace html with {{=CODE(src, language=lang)}} for syntax highlighting

2009-11-15 Thread Thadeus Burgess
Lol, yes :) -Thadeus On Sun, Nov 15, 2009 at 3:59 PM, mr.freeze wrote: > > Do you mean this one? > http://www.web2pyslices.com/main/slices/take_slice/32 > > > On Nov 15, 3:55 pm, Thadeus Burgess wrote: > > By the way > > > > http://www.web2pyslices.com/main/slices/take_slice/30 > > > > -Thad

[web2py:35410] Re: Replace html with {{=CODE(src, language=lang)}} for syntax highlighting

2009-11-15 Thread mr.freeze
Do you mean this one? http://www.web2pyslices.com/main/slices/take_slice/32 On Nov 15, 3:55 pm, Thadeus Burgess wrote: > By the way > > http://www.web2pyslices.com/main/slices/take_slice/30 > > -Thadeus > > On Sun, Nov 15, 2009 at 3:51 PM, Thadeus Burgess wrote: > > > [SOLVED], this is the fina

[web2py:35409] Re: Replace html with {{=CODE(src, language=lang)}} for syntax highlighting

2009-11-15 Thread Thadeus Burgess
By the way http://www.web2pyslices.com/main/slices/take_slice/30 -Thadeus On Sun, Nov 15, 2009 at 3:51 PM, Thadeus Burgess wrote: > [SOLVED], this is the final model. > > I had to parse the content and replace the html entities. > > functions.py > http://pastebin.com/f25d3c971 > > usage > >

[web2py:35408] Re: Replace html with {{=CODE(src, language=lang)}} for syntax highlighting

2009-11-15 Thread Thadeus Burgess
[SOLVED], this is the final model. I had to parse the content and replace the html entities. functions.py http://pastebin.com/f25d3c971 usage {{=XML(__highlight__(blog_post.content))}} -Thadeus On Sun, Nov 15, 2009 at 3:22 PM, Thadeus Burgess wrote: > How would I convert html char codes i

[web2py:35407] Re: Replace html with {{=CODE(src, language=lang)}} for syntax highlighting

2009-11-15 Thread Thadeus Burgess
How would I convert html char codes into their actual UTF-8 representation? Because def somefunc(avar="hi"): pass gets turned into this by CKeditors. def somefunc(avar='hi'): pass -Thadeus On Sun, Nov 15, 2009 at 3:14 PM, Thadeus Burgess wrote: > Ok, the problem was using tags, CKEdit

[web2py:35406] Re: Replace html with {{=CODE(src, language=lang)}} for syntax highlighting

2009-11-15 Thread Thadeus Burgess
Ok, the problem was using tags, CKEditor attempts to format them. Switching to tags, CKEditor will not format them So def __highlight__(content, dom_element='pre'): from pygments import highlight from pygments.lexers import get_lexer_by_name from pygments.formatters import HtmlF

[web2py:35405] Re: Replace html with {{=CODE(src, language=lang)}} for syntax highlighting

2009-11-15 Thread Thadeus Burgess
Thanks that got me on the right track! This is what I ended up with, a view function that gets called on the blog posts content. The only problem is CKEditor tries to format the code during editing, so you end up with alot of leaked in, working on solving that. {{ def __highlight__(content):

[web2py:35404] Re: Replace html with {{=CODE(src, language=lang)}} for syntax highlighting

2009-11-15 Thread Mengu
hi Thadeus, hope it helps: http://github.com/mengu/blog/blob/master/models/post.py#L39 On Nov 15, 8:48 am, Thadeus Burgess wrote: > I have a html content (for a blog) and would like to parse the content for > tags, and of course replace the content with web2py syntax > highlighting using CODE

[web2py:35403] Re: db.py error

2009-11-15 Thread mdipierro
Can you show us db.py? I think you miss db=DAL('sqlite://storage.sqlite') at the top of the file. On Nov 15, 12:30 pm, blye wrote: > I keep getting this error in the apps I enter to learn web2py. > eg the Wiki app  in the users group pages. > > "D:\\web2py\\applications\\wiki/models/db.py", li

[web2py:35402] Re: plugin

2009-11-15 Thread mdipierro
No because we have not completely clarified the specs. On Nov 15, 12:55 pm, leone wrote: > There is a developer-manual to build plugins? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post

[web2py:35401] Re: db.py error

2009-11-15 Thread Thadeus Burgess
Do you have the following line in db.py at the top? db = DAL('sqlite://storage.sqlite') -Thadeus On Sun, Nov 15, 2009 at 12:30 PM, blye wrote: > > I keep getting this error in the apps I enter to learn web2py. > eg the Wiki app in the users group pages. > > "D:\\web2py\\applications\\wiki/

[web2py:35400] Re: plugin

2009-11-15 Thread Thadeus Burgess
Not yet, just a video on vimeo. -Thadeus On Sun, Nov 15, 2009 at 12:55 PM, leone wrote: > > There is a developer-manual to build plugins? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" gro

[web2py:35399] plugin

2009-11-15 Thread leone
There is a developer-manual to build plugins? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send ema

[web2py:35398] Re: plugin_query (help!)

2009-11-15 Thread Thadeus Burgess
It is because you have a table inside of a table Try removing border, padding, and margins from class st_table. -Thadeus On Sun, Nov 15, 2009 at 1:44 AM, mdipierro wrote: > > I am building this plugin: > > https://www.web2py.com/plugins/plugin_query > > It is only 50% done and it is not yet

[web2py:35397] db.py error

2009-11-15 Thread blye
I keep getting this error in the apps I enter to learn web2py. eg the Wiki app in the users group pages. "D:\\web2py\\applications\\wiki/models/db.py", line 4, in \nNameError: name \'db\' is not defined\n' p8 s. What am I doing wrong? Thanks --~--~-~--~~~---~--~

[web2py:35396] Re: How to read an uploaded file object line by line?

2009-11-15 Thread Iceberg
Bingo! You found that reason which costs me hours of time. T_T Thanks! On Nov15, 11:22pm, mdipierro wrote: > because the file stream has already been read by accept and the you > are pointing at the bottom of the file. Try > > request.vars.backup.file.seek(0) > request.form.vars.backup.file.rea

[web2py:35395] Re: How to read an uploaded file object line by line?

2009-11-15 Thread mdipierro
because the file stream has already been read by accept and the you are pointing at the bottom of the file. Try request.vars.backup.file.seek(0) request.form.vars.backup.file.read() if it does not work, then the file stream can only be read sequentially and you need to re-open the file and read

[web2py:35394] Re: Missing web2py-menu-active definition in base.css?

2009-11-15 Thread mdipierro
thanks. will do. On Nov 15, 4:17 am, Iceberg wrote: > I noticed the MENU() helper uses a "web2py-menu-active" status, but > there is no corresponding definition in static/base.css > > Suggest to add this into the default base.css: >   .web2py-menu-active a {background-color: white;} > > So that

[web2py:35393] Re: gluon.storage.Storage.copy()

2009-11-15 Thread mdipierro
perhaps a __copy__? thanks for you help on this. On Nov 15, 3:34 am, "Xie&Tian" wrote: > It's nothing wrong with using copy module of standard python, I just > find it more convenient with a .copy() method. And plus, since Storage > inherits dict, developer can call .copy() and expect a Storage

[web2py:35392] How to read an uploaded file object line by line?

2009-11-15 Thread Iceberg
Hi folks, How to read an uploaded file object line by line? This seemingly easy task stumps me. Now I am totally lost. :-/ def restore(): form = SQLFORM.factory(Field ('backup','upload',requires=IS_UPLOAD_FILENAME())) if form.accepts(request.vars,keepvalues=True,session=None): #

[web2py:35391] Missing web2py-menu-active definition in base.css?

2009-11-15 Thread Iceberg
I noticed the MENU() helper uses a "web2py-menu-active" status, but there is no corresponding definition in static/base.css Suggest to add this into the default base.css: .web2py-menu-active a {background-color: white;} So that the active menu item will be shown in white background color. Wan

[web2py:35390] Re: gluon.storage.Storage.copy()

2009-11-15 Thread
It's nothing wrong with using copy module of standard python, I just find it more convenient with a .copy() method. And plus, since Storage inherits dict, developer can call .copy() and expect a Storage object returned. Currently it returns dict and that breaks the coherence of the behaviour of St

[web2py:35389] Re: Know SQLAlchemy already and want to learn w2p? We translated all the examples in the sqlalchemy tutorial.

2009-11-15 Thread Zoom.Quiet
On Sun, Nov 15, 2009 at 15:33, mdipierro wrote: > > http://www.reddit.com/r/Python/comments/a4hvk/know_sqlalchemy_already_and_want_to_learn_w2p_we/ > perfect! we'r thinking usage SqlAlchemy in w2p, but base this: http://web2py.com/examples/static/sqla2.html flowing w2p is easy and stable and cle

[web2py:35388] Re: gluon.storage.Storage.copy()

2009-11-15 Thread mdipierro
I like idea but there is a problem. It break backward compatibility for apps that use a session variable named 'copy' >>> class A(dict): ... def __getattr__(self,key): return self[key] ... def __setattr__(self,key,value): self[key]=value ... def copy(self): return self >>> a=A() >>> a