[web2py:35818] Re: crud.select headers attribute

2009-11-23 Thread annet
Massimo, On page 218 of the web2py manual it says: headers={'person.name', 'Name'} That should read like: headers={'person.name':'Name'} Kind regards, Annet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2

[web2py:35819] Re: cron and permissions

2009-11-23 Thread mika
I tried, and it gives me: WARNING:root:WEB2PY CRON Call returned code 1: No error message available On Nov 9, 4:33 pm, mdipierro wrote: > Can you try: > > @auth.requires(auth.has_membership(...) or not request.env) > > On Nov 9, 6:53 am,mika wrote: > > > > > I have no idea for such condition.

[web2py:35820] Re: file|upload third column

2009-11-23 Thread annet
Massimo, > there will be no link to download, no preview and (I think) no delete > button. You're right, all three features are gone when using an SQLFORM. Kind regards, Annet. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

[web2py:35821] Re: twitter in GAE

2009-11-23 Thread Leandro - ProfessionalIT
Hi wes, I copy and paste your suggestion em my controller/page, but I still receive the message: 'Unable to download'. I don't know, but I think that this feature don't run in GAE. Thanks by your help. -- Leandro. --~--~-~--~~~---~--~~ You received this messa

[web2py:35822] Auto-Populate the database

2009-11-23 Thread harshit agrawal
hello sir, I posted a question about auto-population of the database but no replies came. Please tell me can I populate the database by using a file in place of forms. Hoping for a quick response. Harshit --~--~-~--~~~---~--~~ You received this mess

[web2py:35823] Re: Auto-Populate the database

2009-11-23 Thread Kuba Kucharski
The answer came pretty fast.. maybe this is a problem w your email client? http://groups.google.com/group/web2py/browse_thread/thread/bedece34cee4638e?pli=1 -- Kuba On Mon, Nov 23, 2009 at 1:17 PM, harshit agrawal < harsh.agrawal2...@gmail.com> wrote: > > hello sir, >I posted a q

[web2py:35824] Re: Populating database

2009-11-23 Thread harshit agrawal
I got it. Thank You On Nov 22, 5:50 pm, mdipierro wrote: > done. > > On Nov 22, 3:39 pm, "mr.freeze" wrote: > > > Any chance you could add populate to svn? > > > On Nov 22, 9:19 am, mdipierro wrote: > > > > With random data or with your own data? > > > > 1) With random data: > > > > from gluo

[web2py:35825] Maximum No of users can web2py server can support

2009-11-23 Thread harshit agrawal
Hello sir, I am making a portal for my institute in web2py but it requires that about 200 users can use the system simultaneously. So how can we do this? Harshit --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

[web2py:35826] Re: Maximum No of users can web2py server can support

2009-11-23 Thread mr.freeze
This may help: http://www.web2pyslices.com/main/slices/take_slice/33 On Nov 23, 6:54 am, harshit agrawal wrote: > Hello sir, >          I am making a portal for my institute in web2py but it > requires that about 200 users can use the system  simultaneously. So > how can we do this? > > Harshit

[web2py:35827] Re: Extremely basic question about view

2009-11-23 Thread mdipierro
I understand that. You can define at the top of layout and do {{def block(name): try: name() return False except: return True pass return}} and do #layout.html {{if block(title):}}index{{pass}} - mysite.com # some navigation links here {{include}} {{if bloc

[web2py:35828] Re: How to delete file uploaded via SQLFORM.factory()?

2009-11-23 Thread mdipierro
SQLFORM.factory(Field('the_file','upload',requires=IS_UPLOAD_FILENAME ()),uploadfield=False) On Nov 23, 1:24 am, Iceberg wrote: > I noticed that a file uploaded via SQLFORM.factory() exists in myapp/ > uploads. How to delete them automatically? > > By the way, shall the auto-deletion be web2py's

[web2py:35829] Re: cron and permissions

2009-11-23 Thread mdipierro
Can you try @auth.requires(not request.env or auth.has_membership(...) ) On Nov 23, 3:16 am, mika wrote: > I tried, and it gives me: > > WARNING:root:WEB2PY CRON Call returned code 1: No error message > available > > On Nov 9, 4:33 pm, mdipierro wrote: > > > Can you try: > > > @auth.requires(a

[web2py:35830] Re: twitter in GAE

2009-11-23 Thread mdipierro
Use this: def twitter(): session.forget() session._unlock(response) import gluon.tools import gluon.contrib.simplejson as sj page = gluon.tools.fetch('http://twitter.com/web2py?format=json') return sj.loads(page)['#timeline'] and see what error you get in the GAE log. On

[web2py:35831] Re: Maximum No of users can web2py server can support

2009-11-23 Thread mdipierro
On Nov 23, 6:54 am, harshit agrawal wrote: > Hello sir, >          I am making a portal for my institute in web2py but it > requires that about 200 users can use the system  simultaneously. So > how can we do this? > > Harshit --~--~-~--~~~---~--~~ You received t

[web2py:35832] Re: Maximum No of users can web2py server can support

2009-11-23 Thread mdipierro
It really depends on many issues. 200 users are not going to make 1 request/second but more like 1 request every ten seconds each or less. That means you need to handle 20 requests/seconds. On my laptop an average dynamic page takes ~20ms, and that means 50 requests/second. This means I can handl

[web2py:35833] Re: Dropbox based on query

2009-11-23 Thread mdipierro
myactivities = db((db.company_activity.bedrijf==auth.user.bedrijf)& (db.company_activity.activity==db.activity.id)) .select(db.activity.activity) IS_IN_SET([row.activity for row in myactivities]) On Nov 20, 11:23 am, annet wrote: > I have a table which combines companies with activities and I

[web2py:35834] Sphinx

2009-11-23 Thread mdipierro
We have had some discussion about moving the documentation to Sphinx. Months have passed and there has been no progress. I personally do not mind epydoc but some of you really liked Sphinx. If you know Sphinx and want web2py to use it, please help us. Massimo --~--~-~--~~

[web2py:35835] Re: twitter in GAE

2009-11-23 Thread Leandro - ProfessionalIT
Massimo, With this code, I don't receive a error message, but show me a etern 'loading' in the div field. Look in my page: http://www.leandro.inf.br -- Leandro. On Nov 23, 1:07 pm, mdipierro wrote: > Use this: > > def twitter(): >     session.forget() >     session._unlock(response) >

[web2py:35836] Re: Sphinx

2009-11-23 Thread Zoom.Quiet
On Mon, Nov 23, 2009 at 23:28, mdipierro wrote: > > We have had some discussion about moving the documentation to Sphinx. > Months have passed and there has been no progress. I personally do not > mind epydoc but some of you really liked Sphinx. > > If you know Sphinx and want web2py to use it, p

[web2py:35837] Re: twitter in GAE

2009-11-23 Thread mdipierro
I assume you are running on GAE. Your browser calls the twitter action via ajax. That casues en error (the page says loading because ajax does not a valid response0. Now look into the GAE logs for the error. On Nov 23, 9:33 am, Leandro - ProfessionalIT wrote: > Massimo, >     With this code, I d

[web2py:35838] Re: Web2Py Multi-site

2009-11-23 Thread David
I did get a chance to read that this morning. It was well written and gave me a better idea for what I would like to implement. It seems that I should be able to link static files on a per virtualhost directive which _should_ work for what I want to do. On Nov 2, 2:34 pm, Thadeus Burgess wrote:

[web2py:35839] Re: Web2Py Multi-site

2009-11-23 Thread mdipierro
You should consider different approached depending on whether the layout depends on the domain or the user. If it depends on the domain and it is fixed for domain, I suggest different web2py apps with different set of views that talk to the same db. Use virtual hosts to map domain into app. If the

[web2py:35840] Re: twitter in GAE

2009-11-23 Thread Leandro - ProfessionalIT
Master Massimo, Sorry, I forget of this detail. That dummie !. The GAE log: In FILE: /base/data/home/apps/leandro-inf/1.337957566746262675/ applications/init/controllers/default.py Traceback (most recent call last): File "/base/data/home/apps/leandro-inf/1.337957566746262675/gluon/ restri

[web2py:35841] Re: Extremely basic question about view

2009-11-23 Thread Thadeus Burgess
Except when right_col doesn't exist, the "variable referenced before assignment" exception. So you end up with another problem, you have to define your default as a def right_col in the layout.html, and if you define another one in your view.html, the one in layout.html still takes precedence and

[web2py:35842] Re: twitter in GAE

2009-11-23 Thread mdipierro
Sorry to do this to you try: def my test(): import gluon.tools page = gluon.tools.fetch('http://twitter.com/web2py?format=json') return page see if what fetch is getting. On Nov 23, 10:34 am, Leandro - ProfessionalIT wrote: > Master Massimo, > >    Sorry, I forget of this deta

[web2py:35843] Re: Extremely basic question about view

2009-11-23 Thread mdipierro
Yes. In my exmample above {{if block(title):}}index{{pass}} "index" is the default. On Nov 23, 10:44 am, Thadeus Burgess wrote: > Except when right_col doesn't exist, the "variable referenced before > assignment" exception. > > So you end up with another problem, you have to define your defaul

[web2py:35844] Re: Extremely basic question about view

2009-11-23 Thread mdipierro
Silly me. You are right. Let me think about this. On Nov 23, 10:44 am, Thadeus Burgess wrote: > Except when right_col doesn't exist, the "variable referenced before > assignment" exception. > > So you end up with another problem, you have to define your default as a def > right_col in the layou

[web2py:35845] Re: Internationalization

2009-11-23 Thread Yarko Tymciurak
On Mon, Nov 23, 2009 at 12:20 AM, Thadeus Burgess wrote: > if web2py is mostly written in English, then it needs to default to > English, and allow for easy overriding of this default. > I agree. More explicitly - whatever the web2py distribution default is should behave correctly; If an applic

[web2py:35846] Re: Web2Py Multi-site

2009-11-23 Thread David
Layouts should depend on the domain. But I don't want to have 50+ installations per server that need to be update manually when I make changes to the code or bring enhancements. They don't need appadmin. I am writing a control panel for them to manage users. Would it not be possible to share a

[web2py:35847] Re: twitter in GAE

2009-11-23 Thread Leandro - ProfessionalIT
On Nov 23, 3:06 pm, mdipierro wrote: > Sorry to do this to you Hey Master no problems ! I love Web2Py and I think our community is very caring. > try: > > def my test(): >     import gluon.tools >     page = gluon.tools.fetch('http://twitter.com/web2py?format=json') >     return page > > se

[web2py:35848] Re: Internationalization

2009-11-23 Thread mdipierro
Yarko, I am leaning towards accepting your proposal for two reasons: 1) it was seconded (by Thedeus) 2) you are right that this results in an incorrect behavior for Admin/ Examples/Welcome I still stand that those apps have a bug (because when we added translations I did not set the current langu

[web2py:35849] Re: Maximum No of users can web2py server can support

2009-11-23 Thread harshit agrawal
But sir my portal will start at a specific time and around 200-250 users will login at the same time then the system may hang. Also there is a file named options_std.py, in this file what does 'no_of_threads' means reply as soon as possible Thank You Harshit On Nov 23, 10:15 am, mdipierro

[web2py:35850] Re: twitter in GAE

2009-11-23 Thread mdipierro
This looks like a bug in fetch on GAE. It is returning the twitter page but not in JSON. It is returning this: http://twitter.com/web2py instead of this: http://twitter.com/web2py?format=json One more test please: from google.appengine.api.urlfetch import fetch def my test(): page =

[web2py:35851] Re: Maximum No of users can web2py server can support

2009-11-23 Thread mdipierro
On Nov 23, 11:36 am, harshit agrawal wrote: > But sir my portal will start at a specific time and around 200-250 > users will login at the same time then the system may hang. Is this an assumption or a fact? > Also there is a file named options_std.py, in this file what does > 'no_of_threads'

[web2py:35852] Timer

2009-11-23 Thread sandy
Sir, I want to ask - how we can set a timer in our TA portal which we are making with the help of web2py. The timer will show how much time is left to close the portal. sandeep --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

[web2py:35853] Re: Timer

2009-11-23 Thread mdipierro
I would use this: http://plugins.jquery.com/project/jCountdown $("#countdown").countdown({ target:"{{=target_time.isoformat()}}" }); web2py would pass the target_time as a datetime. On Nov 23, 11:42 am, sandy wrote: > Sir, > I want to ask - how we can set a timer in our TA portal which we are

[web2py:35854] Re: twitter in GAE

2009-11-23 Thread Leandro - ProfessionalIT
Massimo, > from google.appengine.api.urlfetch import fetch > def my test(): >     page = fetch('http://twitter.com/ > web2py',payload='format=json').content >     return page > > do you get JSON? > > Massimo This function run OK (http://www.leandro.inf.br/init/default/my_test), then I try change

[web2py:35855] Re: Internationalization

2009-11-23 Thread Yarko Tymciurak
On Mon, Nov 23, 2009 at 11:33 AM, mdipierro wrote: .. > I still stand that those apps have a bug (because when we added > translations I did not set the current language) not languages.py. > Then we must agree to disagree. For me, it is quite evident (by tracing execution of JUST gluon/lang

[web2py:35856] Re: Maximum No of users can web2py server can support

2009-11-23 Thread Thadeus Burgess
I'd assume this is in a corporate office, where the business opens in the morning, and everybody arrives at the same time and logs in. Id go with massimo's suggestion, along with a pound server, and some scripts to update each instance of the panel. -Thadeus On Mon, Nov 23, 2009 at 11:47 AM,

[web2py:35857] Re: Maximum No of users can web2py server can support

2009-11-23 Thread harshit agrawal
This is a fact. Sir I am almost done with all the queries in my project using the default sqlite and now I want to put the portal on apache server. How can we do this? On Nov 23, 12:47 pm, mdipierro wrote: > On Nov 23, 11:36 am, harshit agrawal > wrote: > > > But sir my portal will start at a

[web2py:35858] Re: Maximum No of users can web2py server can support

2009-11-23 Thread waTR
This is farily simple. No big deal. DAL can be switched to PostgreSQL without having to do anything other than change the line at the top of the db.py file in MODEL. This sounds like a school course registration system. Definetly use the APACHE + WSGI. Also, use caching as much as possible for y

[web2py:35859] Re: Internationalization

2009-11-23 Thread Thadeus Burgess
I just don't want my code littered with error_message=languages[0] print languages[1] alert(languages[3]) -Thadeus On Mon, Nov 23, 2009 at 12:23 PM, Yarko Tymciurak < resultsinsoftw...@gmail.com> wrote: > > On Mon, Nov 23, 2009 at 11:33 AM, mdipierro wrote: > .. > >> I still stand that

[web2py:35860] Re: Maximum No of users can web2py server can support

2009-11-23 Thread Alexandre Andrade
Web2py migrates the model of your database without problem, but not your data. Short tutorial 1. To export your sqlite database, use the shell: db.export_to_csv_file(open('somefile.csv', 'wb')) 2. create a empty postgresql database, and change db = DAL('sqlite://storage.sqlite') to

[web2py:35861] Re: Internationalization

2009-11-23 Thread Yarko Tymciurak
On Mon, Nov 23, 2009 at 12:47 PM, Thadeus Burgess wrote: > I just don't want my code littered with > > error_message=languages[0] > > print languages[1] > > alert(languages[3]) > :-) I agre, that would TRULY be terrible! If anything, if Massimo would want to go in that direction (instead of fir

[web2py:35862] Re: Internationalization

2009-11-23 Thread Yarko Tymciurak
On Mon, Nov 23, 2009 at 12:56 PM, Yarko Tymciurak < resultsinsoftw...@gmail.com> wrote: > On Mon, Nov 23, 2009 at 12:47 PM, Thadeus Burgess > wrote: > >> I just don't want my code littered with >> >> error_message=languages[0] >> >> print languages[1] >> >> alert(languages[3]) >> > > :-) > > I ag

[web2py:35863] Re: Internationalization

2009-11-23 Thread Yarko Tymciurak
On Mon, Nov 23, 2009 at 12:59 PM, Yarko Tymciurak < resultsinsoftw...@gmail.com> wrote: > > > On Mon, Nov 23, 2009 at 12:56 PM, Yarko Tymciurak < > resultsinsoftw...@gmail.com> wrote: > >> On Mon, Nov 23, 2009 at 12:47 PM, Thadeus Burgess >> wrote: >> >>> I just don't want my code littered with >

[web2py:35864] Re: Internationalization

2009-11-23 Thread Yarko Tymciurak
2009/11/23 Yarko Tymciurak > On Mon, Nov 23, 2009 at 12:59 PM, Yarko Tymciurak < > resultsinsoftw...@gmail.com> wrote: > >> >> >> On Mon, Nov 23, 2009 at 12:56 PM, Yarko Tymciurak < >> resultsinsoftw...@gmail.com> wrote: >> >>> On Mon, Nov 23, 2009 at 12:47 PM, Thadeus Burgess >> > wrote: >>> >>>

[web2py:35865] Re: Web2Py Multi-site

2009-11-23 Thread mdipierro
On Nov 23, 11:21 am, David wrote: > Layouts should depend on the domain. > > But I don't want to have 50+ installations per server that need to be > update manually when I make changes to the code or bring enhancements. > > They don't need appadmin. I am writing a control panel for them to > ma

[web2py:35866] Re: twitter in GAE

2009-11-23 Thread mdipierro
One more try. I think I understand the problem now. Here is a possible solution: def twitter(): session.forget() session._unlock(response) import gluon.tools import gluon.contrib.simplejson as sj from google.appengine.api.urlfetch import fetch #page

[web2py:35867] Re: Maximum No of users can web2py server can support

2009-11-23 Thread mdipierro
What is current setup? Windows binary? Do you know linux? On Nov 23, 12:36 pm, harshit agrawal wrote: > This is a fact. > > Sir I am almost done with all the queries in my project using the > default sqlite and now I want to put the portal on apache server. How > can we do this? > > On Nov 23, 1

[web2py:35868] Re: twitter in GAE

2009-11-23 Thread Leandro - ProfessionalIT
Massimo, > def twitter(): >         session.forget() >         session._unlock(response) >         import gluon.tools >         import gluon.contrib.simplejson as sj >         from google.appengine.api.urlfetch import fetch >         #page = gluon.tools.fetch('http://twitter.com/web2py? > format=j

[web2py:35869] Re: twitter in GAE

2009-11-23 Thread mdipierro
Looks like you found a bug in gluon.tools.fetch (I remember testing this, perhaps they changed the behavior of GAE fetch? whatever). I fixed it in trunk and your original code should work as originally intended. On Nov 23, 1:49 pm, Leandro - ProfessionalIT wrote: > Massimo, > > > def twitter():

[web2py:35870] Re: Internationalization

2009-11-23 Thread mdipierro
Yarko's patch is tentatively in trunk since nobody seems to complain about this change in behavior. Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to w

[web2py:35871] Re: Internationalization

2009-11-23 Thread Thadeus Burgess
I'm not sure if changing the underlying workings of T is really necessary. What are the Pro's and Con's of each system (translation vs string serving). Mainly, what are the Con's with the current implementation that a new underlying system would fix? Does it make creating new language files easier

[web2py:35872] Re: Internationalization

2009-11-23 Thread Yarko Tymciurak
just to repeat (again) --- pointing out this difference in fundamental paradigm: translation vs. string-serving was not to suggest we make a change (at this point) but rather to point out the necessity to be explicit and crisp about describing what we _have_ chosen to do (as not having this bounda

[web2py:35873] Re: Internationalization

2009-11-23 Thread mdipierro
This is a different than addressed in this thread. Please open a different thread if you want to discuss that. A web2py translation is a dictionary that maps original strings into translated strings. You can write an interface to google translate simply. On Nov 23, 2:55 pm, Thadeus Burgess wrot

[web2py:35874] Re: Internationalization

2009-11-23 Thread Yarko Tymciurak
FYI - This should not impact anyone; if a clent browses your site with multiple language preferences (which will probably not be the majority of visitors), then those people will have correct language selection (that is the fix). If you have a site in some language, and it is other than English,

[web2py:35875] Running query in default.py using urllib

2009-11-23 Thread Yash
When I run some function in web2py by opening it's url in browser i get the output. But when i run the url using urllib module in python using python code It doesn't give output. say application name is TLS and in default.py i have made a function trial as def trial(): print "yash"

[web2py:35876] Re: Maximum No of users can web2py server can support

2009-11-23 Thread waTR
Someone needs to do a wiki entry for HIGH PERFORMANCE web2py setup. I.e. Apache + WSGI + Postgre/MySQL + Query Cache code + Page Cache code. A simple program that could be made for this is an app for allowing students to register for classes. Requirements: Super user can: add classes, change clas

[web2py:35877] Languages integration with Google Translate

2009-11-23 Thread Thadeus Burgess
I am doing a case study on determining the viability for integrating google translate into web2py. I would like any input or ideas from the community, currently my line of thinking is to have a controller that will post queries to googles translate form, and then place the results in the languages

[web2py:35878] Re: Running query in default.py using urllib

2009-11-23 Thread Thadeus Burgess
lines = urllib.urlopen(url).read() print lines -Thadeus On Mon, Nov 23, 2009 at 3:30 PM, Yash wrote: > > When I run some function in web2py by opening it's url in browser i > get the output. > But when i run the url using urllib module in python using python code > It doesn't give output. >

[web2py:35879] Re: Maximum No of users can web2py server can support

2009-11-23 Thread Thadeus Burgess
We have articles about this on web2pyslices.com... Three to be exact. -Thadeus On Mon, Nov 23, 2009 at 3:45 PM, waTR wrote: > > Someone needs to do a wiki entry for HIGH PERFORMANCE web2py setup. > > I.e. Apache + WSGI + Postgre/MySQL + Query Cache code + Page Cache > code. > A simple progra

[web2py:35880] Re: Maximum No of users can web2py server can support

2009-11-23 Thread mdipierro
I think it makes sense for web2py users to form interest groups in at least two areas: - education - healthcare and develop common tools to work on those. Massimo On Nov 23, 3:45 pm, waTR wrote: > Someone needs to do a wiki entry for HIGH PERFORMANCE web2py setup. > > I.e. Apache + WSGI + Postg

[web2py:35881] Re: Maximum No of users can web2py server can support

2009-11-23 Thread Thadeus Burgess
Kind of like how django went the news / blogging route? -Thadeus On Mon, Nov 23, 2009 at 4:33 PM, mdipierro wrote: > > I think it makes sense for web2py users to form interest groups in at > least two areas: > - education > - healthcare > and develop common tools to work on those. > > Massim

[web2py:35882] Re: Web2Py Multi-site

2009-11-23 Thread David
Hi Massimo, Yes I saw the plugin and thought it was pretty fancy. I might have missed the point on implementation of it. Here's a better look at what I am trying to do: www.example1.com ---> css+ static files in their own home directory (Independent of example2.com) | <=

[web2py:35883] Re: Web2Py Multi-site

2009-11-23 Thread mdipierro
You layout.html needs to look into request.env.http_host for the requested host name and include a corresponding then present them with a small manual on the output tags that could be > used to implement boxes, feeds, products etc on their custom > templates. > > Both sites will share a common

[web2py:35884] Re: validity of file

2009-11-23 Thread Richard
could a new validator be added to check the mime type from the POSTed content-type? IS_MIME_TYPE('png') Django has something like this: http://docs.djangoproject.com/en/dev/topics/http/file-uploads/?from=olddocs#uploadedfile-objects Richard On Nov 23, 2:50 pm, Thadeus Burgess wrote: > This is

[web2py:35885] Re: Delete record from row object

2009-11-23 Thread Richard
ah OK - I didn't know the record update could be split like that. Neat. Richard On Nov 19, 1:23 pm, mdipierro wrote: > A Row object extends a dictionary and inherits an update method. It > only updates the dict not the record. The us of it is that you can do: > > row.update(...) > row.update(..

[web2py:35886] Re: web2py and postgresql

2009-11-23 Thread Richard
Modules are only executed once, so could you create the index there? Or use a database flag. What I do is create a special function in the controller like "initiate_database()" and put my code there and then manually call this function. Not a neat solution, but it works. Richard On Nov 19, 8:5

[web2py:35887] Re: Image Uploading

2009-11-23 Thread Richard
Good catch. Alternatively you could set request.vars.filename before form.accepts (). On Nov 20, 8:34 pm, Thadeus Burgess wrote: > With the above function it will try to insert the image into the database > twice, you need. > > if form.accepts(request.vars, session, dbio=False) > > -Thadeus > >

[web2py:35888] Re: validity of file

2009-11-23 Thread Thadeus Burgess
>>> import tarfile >>> tarfile.is_tarfile("web2py.plugin.tagging.w2p") True >>> tarfile.is_tarfile("cookbook2.pdf") False >>> :) File "", line 1 :) ^ SyntaxError: invalid syntax >>> Now this needs to integrate with SQLFORM on_validation. Should I also open the tar archive, and verify it

[web2py:35889] Encoding problem (bug?)

2009-11-23 Thread blackthorne
hi Here's my problem... Let's say I make a View file and add utf-8 characters such as 'ã'. It works fine. However, if that same character comes in another View file which happens an extension of the first, it won't work. >From my tests, encoding only works well on a View file that doesn't extend

[web2py:35890] SQLFORM upload field, absolute filepath

2009-11-23 Thread Thadeus Burgess
How do I get the new filename of an uploaded file? Along with its new absolute path.. Below, from the book, does not exist. web2py 2nd edition pg 196 p. 2. Only its extension is preserved. This is a security requirement since the filename may contain special characters that could allo

[web2py:35891] Re: Web2Py Multi-site

2009-11-23 Thread David
Massimo, I have downloaded and installed the layout plugin you had mentioned above. I can see what you are getting at when you are talking about including the layouts. I will have a go with this and see what I can come up with. Thank you for your help! -David :0) On Nov 23, 7:02 pm, mdipierr

[web2py:35892] Re: Plugin Layout

2009-11-23 Thread David
Massimo, I just got this installed and working and it's given me a few ideas about different layouts for users. Thank you for making this plugin. It's very nice. - David On Nov 10, 9:55 pm, Wiiboy wrote: > I just noticed: if you hit "changelayout" and you're not logged in as > an Admin, it d

[web2py:35893] Re: SQLFORM upload field, absolute filepath

2009-11-23 Thread mr.freeze
I believe it is form.vars._newfilename. You should be able to get the path with: os.path.join (request.folder,'uploads',form.vars._newfilename) There may be a better way though. On Nov 23, 9:21 pm, Thadeus Burgess wrote: > How do I get the new filename of an uploaded file? Along with its new >

[web2py:35894] Re: SQLFORM upload field, absolute filepath

2009-11-23 Thread Thadeus Burgess
The problem is I am trying to get the file from the function in SQLFORM.onvalidation... and this happens before the file gets renamed or saved to the disk. The only way i see of accomplishing this is if form.accepts(request.vars, session, dbio=False): #def is_plugin_archive(form)

[web2py:35895] Re: SQLFORM upload field, absolute filepath

2009-11-23 Thread Richard
IIRC, you can use db.table.field.store(request.vars.field) to get the web2py generated filename. On Nov 24, 2:53 pm, Thadeus Burgess wrote: > The problem is I am trying to get the file from the function in > SQLFORM.onvalidation... and this happens before the file gets renamed or > saved to the

[web2py:35896] Re: SQLFORM upload field, absolute filepath

2009-11-23 Thread Thadeus Burgess
Ah yes would love to, however it ends up copy the file twice, since it will do it in my function, and then again later on in SQLFORM.accepts. This is the modified version, it works, I just need to make sure the file is not too large for the server to handle. The limitation really comes from tarfi

[web2py:35897] Re: validity of file

2009-11-23 Thread mdipierro
Unfortunately checking the mime type is no guarantee that the file format is conform to specs. On Nov 23, 7:49 pm, Richard wrote: > could a new validator be added to check the mime type from the POSTed > content-type? > IS_MIME_TYPE('png') > > Django has something like > this:http://docs.django

[web2py:35898] Re: Encoding problem (bug?)

2009-11-23 Thread mdipierro
Haven't seen you in long time. How are you? can post a minimalist app to reproduce the problem? On Nov 23, 9:13 pm, blackthorne wrote: > hi > > Here's my problem... > Let's say I make a View file and add utf-8 characters such as 'ã'. It > works fine. > However, if that same character comes in an

[web2py:35899] RSS does not escape output?

2009-11-23 Thread Thadeus Burgess
Why does the generic.rss default to non-escaped output? -Thadeus --~--~-~--~~~---~--~~ 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

[web2py:35900] Re: RSS does not escape output?

2009-11-23 Thread mdipierro
I think it does but not there. It calls gluon.serializers.rss which calls gluon.contrib.rss2.dumps. This is a standard python module for RSS. This module uses SAX for generating XML+RSS. generic.rss does not escape because the data passed to it is already in XML. The escaping should be done by t

[web2py:35901] Including static html pages

2009-11-23 Thread Johann Spies
How do I present a set of html pages created by an external application (Sphinx) in a web2py application? I am working on a page for system administrators which inter alia provides documentation some of it which were written using sphinx. This is a rephrase of my previous question about Restruct

[web2py:35902] Re: RSS does not escape output?

2009-11-23 Thread mr.freeze
I don't think it does by default. On Nov 24, 12:47 am, mdipierro wrote: > I think it does but not there. It calls gluon.serializers.rss which > calls gluon.contrib.rss2.dumps. This is a standard python module for > RSS. This module uses SAX for generating XML+RSS. > > generic.rss does not escape

[web2py:35903] Re: RSS does not escape output?

2009-11-23 Thread Thadeus Burgess
No the escaping is not done in the RSS2 module, I checked. Firefox is displaying the form and everything I posted as a comment bad bad bad! I fixed it by calling XML sanitize as I was looping through the rows. I do think there should be a note about this? ... description=XML(row.comment.conte

[web2py:35904] Re: Including static html pages

2009-11-23 Thread Thadeus Burgess
Easiest way is to just reference the static files directly http://mysite.com/init/static/documentation/index.html -Thadeus On Tue, Nov 24, 2009 at 1:15 AM, Johann Spies wrote: > lication (Sphinx) in a web2py application? I am working on a page > for system administrators which inter alia pr

[web2py:35905] Re: Including static html pages

2009-11-23 Thread mr.freeze
You can render any view from a controller using response.render (view,vars). Where are the pages stored? On Nov 24, 1:15 am, Johann Spies wrote: > How do I present a set of html pages created by an external > application (Sphinx) in a web2py application?  I am working on a page > for system admi