[web2py] Re: byday=MO versus byday=row.Day.byday

2012-04-26 Thread Annet
Hi Anthony, However, I believe the weekday argument to relativedelta() can also be an > integer from 0 to 6 (0 is Monday, etc.), so maybe your byday field could > store weekday integers instead of names. You're right. Thanks for helping me solve this problem. Kind regards, Annet.

Re: [web2py] How to merge more than one template in web2py

2012-04-26 Thread Keith Edmunds
On Thu, 26 Apr 2012 23:23:06 -0700 (PDT), vibhor.purand...@zero-group.com said: > How to merge more than one template in web2py? http://web2py.com/books/default/chapter/29/5#Page-layout -- "You can have everything in life you want if you help enough other people get what they want" - Zig Ziglar

[web2py] How to merge more than one template in web2py

2012-04-26 Thread Vibhor Purandare
How to merge more than one template in web2py?

Re: [web2py] Cookies and Sessions

2012-04-26 Thread Keith Edmunds
On Wed, 25 Apr 2012 15:49:23 -0700 (PDT), varelay...@gmail.com said: > I'm quite new to web2py and a noob at it. I've been struggling with the > difference between cookies and sessions...But I have plenty of questions > about them and how to use them(in web2py) I think you should approach them f

[web2py] Re: Creating a table or a an entry in a DB from index()

2012-04-26 Thread Anthony
> > But the problem is that the data entered from, say index() is not > available at db.py. Am I right? > If a user enters entries to table "table_names", will db.py see them? Are > the data persistent? > Alan is suggesting that the index function would store the user input in a database table

[web2py] Re: Creating a table or a an entry in a DB from index()

2012-04-26 Thread Madu
Thank you Alan. But the problem is that the data entered from, say index() is not available at db.py. Am I right? If a user enters entries to table "table_names", will db.py see them? Are the data persistent? Also my understanding from reading the online book is that the model files are run on

[web2py] Re: How do I show my views code in a web2py page

2012-04-26 Thread Anthony
Several options: *Pure HTML:* {{some code}} *Python string formatting:* {{='{%s}' % '{some code}'}} *Python function (defined in model or module):* def wrap(code): return '{{%s}}' % code and then in the view: {{=wrap('some code')}} *Javascript:* jQuery(function() { jQuery('.code

[web2py] How can I combine Facebook login and regular login?

2012-04-26 Thread Kenny
So I think I successfully implemented Facebook login. However, I have a problem combining with regular login. Because as the book stated, I did auth.settings.actions_disabled=['register','change_password','request_reset_password','profile'] so I can't use regular register/login How can I combin

[web2py] How to intervene in web2py's upload process(store/retrieve/stream...) to do something with uploaded file?

2012-04-26 Thread Chu Duc Minh
My database is RDBMS, but i want to store uploaded file in a Key/Value storage(NoSQL). How can I intervene to web2py's store/retrieve process? I want temporarily store uploaded file in memory, then call my API to put this in-memory file to my Key/Value storage. When I put this in-memory file(Value)

[web2py] Re: How do I show my views code in a web2py page

2012-04-26 Thread weheh
You could always try {{=XML('{}')}} On Thursday, April 26, 2012 8:44:43 PM UTC+8, LMisi wrote: > > Hi > > I would like to show some view's code in my web2py page. But the first > {{}} symbols in the html generate execution instead of pure displaying > (showing). > I can generate decent html c

[web2py] Re: mailing with pgp

2012-04-26 Thread weheh
I took the additional step of checking all the mail.settings... keys and they are all set to values that look correct. I also retested the gpg --list-secret-keys my_from_addr...@xyz.com and it produces a set of codes consistent with recognizing my address. The failure is happening in this bloc

Re: [web2py] routes.py changes not reflecting in app

2012-04-26 Thread Jonathan Lundell
On Apr 26, 2012, at 7:14 AM, nav010 wrote: > I tried changing map_hyphen = True as i want to change _ to - in urls. > I made changes in routes.py and router.py, but the changes are not > reflecting, I even restarted server many times but bad luck. > > Anybody please help me. Post your routes, p

[web2py] Re: mailing with pgp

2012-04-26 Thread weheh
Thanks for the effort. Sad to report that I tried this and no change. Mail still not getting sent out. Still getting message No key for signing [my_from_addr...@xyz.com] On Thursday, April 26, 2012 4:10:00 PM UTC+8, szimszon wrote: > > Try to replace gluon tools.py with the attachement. And you

[web2py] Re: Creating a table or a an entry in a DB from index()

2012-04-26 Thread Alan Etkin
I think that you could use a common table for storing user input and then have a loop in a model file for creating each new table from the stored db definition records Example: db.define_table("table_names", Field("name")) for row in db(db.table_names).select(): db.define_table(row.name, F

[web2py] Facebook + CAS

2012-04-26 Thread Luis Díaz
greetings 3 app I'm developing of which need all the login is using facebook. the point is that one of the app has N amounts of domain names and facebook is necessary to configure a domain for each system login. I happened to use CAS in this way the app "welcome" would serve as a central authent

Re: [web2py] Looking for a good beginner's guide

2012-04-26 Thread Bruno Rocha
http://killer-web-development.com/ On Thu, Apr 26, 2012 at 11:18 PM, Carlos Costa wrote: > I think web2py.com/book can be a good start. > > 2012/4/26 newbiedev : > > I am a new to programming in general and am looking for an excellent > > beginner's guide to web2py. This is not just for learning

Re: [web2py] Looking for a good beginner's guide

2012-04-26 Thread Carlos Costa
I think web2py.com/book can be a good start. 2012/4/26 newbiedev : > I am a new to programming in general and am looking for an excellent > beginner's guide to web2py. This is not just for learning the framework, but > also learning web programming priciples, in general.  In other words, I'm > not

Re: [web2py] Show my views code in html as can be seen in web2py.com

2012-04-26 Thread Bruno Rocha
mycode = """ def function(): return 'blah' """ {{=CODE(mycode)}} On Wed, Apr 25, 2012 at 9:33 AM, LMisi wrote: > Hi! > > I can show my python code on my home page. I had to generate from > something.py to something.html, but > it does not work on views code. The first "{{" symbols generate err

[web2py] Show my views code in html as can be seen in web2py.com

2012-04-26 Thread LMisi
Hi! I can show my python code on my home page. I had to generate from something.py to something.html, but it does not work on views code. The first "{{" symbols generate error, because the web2py engine try to execute it. Thanks

[web2py] Cookies and Sessions

2012-04-26 Thread Yago
I'm quite new to web2py and a noob at it. I've been struggling with the difference between cookies and sessions. For what I've read the main difference is that you store cookies on the clients side and sessions on the server side, also that cookies expire and sessions get erased when you close

[web2py] How do I show my views code in a web2py page

2012-04-26 Thread LMisi
Hi I would like to show some view's code in my web2py page. But the first {{}} symbols in the html generate execution instead of pure displaying (showing). I can generate decent html code from my python files, and shows in my page, but views... Thanks

[web2py] routes.py changes not reflecting in app

2012-04-26 Thread nav010
I tried changing map_hyphen = True as i want to change _ to - in urls. I made changes in routes.py and router.py, but the changes are not reflecting, I even restarted server many times but bad luck. Anybody please help me. Thanks in advance

[web2py] Creating a table or a an entry in a DB from index()

2012-04-26 Thread Madu
Hello, I'm new to web2py and to web frameworks in general and I am trying to learn the MVC model and web2py by coding. What I'm trying to do is to have a user create tables and entries in a DB that I have defined in dv.py: > *TestDB = DAL("sqlite://storage.sqlite")* Now in index() I'm tryin

[web2py] SQLFORM.factory Field2 depends on Field1

2012-04-26 Thread cory n
Okay, I want to make the second field of a SQLFORM.factory depend on what is chosen in the first field... something like this... form = SQLFORM.factory( Field('PN', requires=IS_NOT_EMPTY()), Field('Segment', requires=IS_IN_SET(['Segment1', 'Segment2'])), Field('Family', r

[web2py] web2py how to change underscore to hypens in URL

2012-04-26 Thread nav010
Hey All, tried this by changing map_hyphen=true in routes.py, but the change is not reflected. Anybody please let me know how can I see this change or is there any other way to change underscores to hyphen in url. Thanks,

[web2py] Re: Free e-book abhout Rest API

2012-04-26 Thread echagas
Tks. On Tuesday, April 24, 2012 5:44:28 PM UTC-3, rochacbruno wrote: > > Download: > > http://blog.apigee.com/detail/announcement_new_ebook_on_web_api_design/ > > -- > > Bruno Rocha > [http://rochacbruno.com.br] > >

[web2py] Looking for a good beginner's guide

2012-04-26 Thread newbiedev
I am a new to programming in general and am looking for an excellent beginner's guide to web2py. This is not just for learning the framework, but also learning web programming priciples, in general. In other words, I'm not just looking for the "how", but also the "why". I have experience with

Re: [web2py] response.view html file from static

2012-04-26 Thread CtrlSoft
> > thanks. works also on windows, > http://agsystem.md/ On Thursday, April 26, 2012 11:32:45 PM UTC+3, rochacbruno wrote: > > if you are on linux, try: > > def myfunction(): > > response.view = *'../* > static/tinymce/jscripts/tiny_mce/plugins/files.html' > > return dict() > >

[web2py] Re: Stats for pageviews

2012-04-26 Thread BlueShadow
the is_bot(request) function is not defined. everything else works perfectly. Am Donnerstag, 26. April 2012 18:22:29 UTC+2 schrieb pbreit: > > One easy way is just to add a counter field and then +1 it each time it's > viewed. I do this: > > if not (item.seller==auth.user_id or is_bot(re

Re: [web2py] Re: web2py: encrypt uploaded files

2012-04-26 Thread Richard Galka
For encrypting/decrypting DB columns, we also use a validator: Ex: db.define_table('table', Field('name', 'text'), Field('host', 'text', requires = SecureValidator(symmetrickey)), Field('secret', 'text', requires = SecureValidator(symmetrickey)) )

Re: [web2py] Re: web2py: encrypt uploaded files

2012-04-26 Thread Richard Galka
For encrypting and decrypting files using a validator works quite well. In our model we have something like: Field('data', 'upload', requires=[IS_NOT_EMPTY(), IS_LENGTH(26214400, 0, error_message="File too large."

Re: [web2py] Routes.py

2012-04-26 Thread Bruno Rocha
You can find the detailed information here: https://github.com/web2py/web2py/blob/master/routes.example.py#L51 and here: http://web2py.com/books/default/chapter/29/4#Routes-on-error On Thu, Apr 26, 2012 at 5:48 PM, Ovidio Marinho wrote: > error messages > > how to customize the error messages

[web2py] Routes.py

2012-04-26 Thread Ovidio Marinho
error messages how to customize the error messages in html 404,405 routes.py Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi

Re: [web2py] response.view html file from static

2012-04-26 Thread Anthony
Good point. I think that should work on Windows as well. Anthony On Thursday, April 26, 2012 4:32:45 PM UTC-4, rochacbruno wrote: > > if you are on linux, try: > > def myfunction(): > > response.view = *'../* > static/tinymce/jscripts/tiny_mce/plugins/files.html' > > return dict() > > >

Re: [web2py] response.view html file from static

2012-04-26 Thread Bruno Rocha
if you are on linux, try: def myfunction(): response.view = *'../* static/tinymce/jscripts/tiny_mce/plugins/files.html' return dict() response.render uses /view as root folder, so you can navigate from there. On Thu, Apr 26, 2012 at 4:53 PM, CtrlSoft wrote: > def myfunction(): > >

[web2py] Re: response.view html file from static

2012-04-26 Thread Anthony
I believe view files have to be within the /views folder. Alternatively, you can manually import the parse_template function from gluon.template and pass it the approriate view path and environment, but you're probably much better off just keeping your views in the /views folder (for one thing,

[web2py] response.view html file from static

2012-04-26 Thread CtrlSoft
i have a file located under static folder that i want to return as view i tried this: def myfunction(): response.view = 'static/tinymce/jscripts/tiny_mce/plugins/files.html' return dict() but doesnt workt any ideas?

Re: [web2py] combine Autocomplete widget and SELECT_OR_ADD_OPTION widget

2012-04-26 Thread Brian M
Richard, Feel free to start your own slice & make this new widget available however you see fit. If it is a new combination of the autocomplete & SELECT_OR_ADD_OPTION widgets it probably is better to keep it separate. Either way I'm more than happy to mention this new widget in the other slice

[web2py] Re: ATTENTION before upgrading to trunk....

2012-04-26 Thread villas
Thinking more about this, an INTEGER will generally store over 2 billion records. Is the reason for updating to BIGINT due to someone having hit that limit? An inner voice is saying: "Can't the person who has breached that limit be asked to create his own tables instead of giving all the r

[web2py] Re: filename in dal

2012-04-26 Thread François Delpierre
Thanks for the tip. But I do not understand the default behavior of Web2Py. I would expect to have the original file name displayed, instead of just the link named "file". In order to achieve this, I take your previous typ and I adapt my DAL : db.mytable.f_sourcefile.represent = lambda rowid,ro

[web2py] Re: crud.create causes an id problem

2012-04-26 Thread villas
Just a thought... if you are trying to create a new table which has a 'bigint' id, this may be incompatible if it references an existing table which has an 'integer' id. Regards, David

[web2py] Re: ATTENTION before upgrading to trunk....

2012-04-26 Thread villas
FYI I just had a problem adding a table to an existing DB (Firebird). I think it was because my old Auth tables are incompatible with BIGINT. To make it work, I created the new table manually. For example, I had to change BIGINT to INTEGER i.e. from this: created_by BIGINT REFERENCES

[web2py] Add RESTful Client to Contrib

2012-04-26 Thread Ross Peoples
Should we add a RESTful client to web2py's contrib folder? We already have clients for XML-RPC and JSON-RPC, so maybe we should include one for REST that can handle both simple a more complex cases (like file uploads, unicode, etc). I found one that I was just about to add to a project and thou

[web2py] Re: byday=MO versus byday=row.Day.byday

2012-04-26 Thread Anthony
Yes, in dateutil.relativedelta, MO, TU, etc. are weekday objects, not strings (that's why you don't put them in quotes when passing them as argument values). However, I believe the weekday argument to relativedelta() can also be an integer from 0 to 6 (0 is Monday, etc.), so maybe your byday fi

[web2py] Re: crud.create causes an id problem

2012-04-26 Thread Ross Peoples
I'm having a similar issue using SQLFORM. I am using a table that stores extra data for users, and I call it auth_user_extended: db.define_table('auth_user_extended', Field('auth_user', db.auth_user, readable=False, writable=False), Field('supervisor', 'boolean', label='Is Supervisor?', d

[web2py] Re: byday=MO versus byday=row.Day.byday

2012-04-26 Thread Annet
Hi Anthony, Is byday just a string? If so, how could it have a "weekday" and an "n" > attribute? Yes, it is: Field('byday',length=2,default='',notnull=True,unique=True) >From the python dateutil docs I learned that this: TODAY+relativedelta(weekday=FR) gives me next Friday's date. ... and

Re: [web2py] Re: web2py: encrypt uploaded files

2012-04-26 Thread minhcd
Edit: I want to temporarily store uploaded file in memory, *then* call API to put this in-memory file to my Key/Value storage. When I put this in-memory file (Value) to Key/Value storage, i will get back a *Key* from it, and save this Key to RDBMS. When i want retrieve this "blob", i will get t

[web2py] Re: attachment;filename=%s.ics

2012-04-26 Thread Annet
Hi Anthony, It should also work without the extra parentheses around IS_SLUG: > > 'attachment;filename=event_%s_%s.ics' % (IS_SLUG()(organization.name)[0], > row.id) > Indeed, it does. I must have overlooked the opening and closing parentheses. Kind regards, Annet.

Re: [web2py] Re: web2py: encrypt uploaded files

2012-04-26 Thread minhcd
Hi, I think your recipe will work ;) My situation is different a bit from Naveed. My database is RDBMS, but i want to store uploaded file in a Key/Value storage(NoSQL). How can I intervent to store/retrieve process? I want to temporarily store uploaded file in memory, than call API to put this

[web2py] Re: storing objects in session

2012-04-26 Thread Annet
Hi Anthony, Thanks for your reply and explanation. I just need the Rows object for retrieve purposes. Kind regards, Annet.

Re: [web2py] Re: Ubuntu and Python3

2012-04-26 Thread Sebastian E. Ovide
just wondering if having web3py in python 3 will give us some problem with some share hosting On Thu, Apr 26, 2012 at 2:52 PM, Johann Spies wrote: > That article says that Python 2.7 will still be part of Ubuntu so there > should not be a problem. > > Regards > Johann > > > -- > Because exper

[web2py] Re: Stats for pageviews

2012-04-26 Thread pbreit
One easy way is just to add a counter field and then +1 it each time it's viewed. I do this: if not (item.seller==auth.user_id or is_bot(request)): item.update_record(views=item.views+1, modified_on=item.modified_on, modified_by=item.modified_by) I have 2 exceptions: bots li

[web2py] Stats for pageviews

2012-04-26 Thread BlueShadow
Hi, I like to have statistics about views of individual articles on my page. The Articles database table contain a title content and pageview field. My problem is I got no idea how to count the visitors. Thanks

Re: [web2py] combine Autocomplete widget and SELECT_OR_ADD_OPTION widget

2012-04-26 Thread Manuele Pesenti
Il 26/04/2012 02:12, Brian M ha scritto: Cool Richard! I haven't done much with that widget since initially creating it. I thought that there was someone who was creating an improved version a few months ago but can't for the life of me find it anywhere. :( Feel free to send me a patch and I

Re: [web2py] String EOF error

2012-04-26 Thread Bruce Wade
Yes I use pickle for my adviewer but that works without a problem. and we can view all pages. I will look at the link you sent now On Thu, Apr 26, 2012 at 7:54 AM, Richard Vézina wrote: > Maybe related : > https://groups.google.com/forum/?fromgroups#!topic/web2py/3VOr81wpP94 > > > On Thu, Apr 26

Re: [web2py] String EOF error

2012-04-26 Thread Richard Vézina
Maybe related : https://groups.google.com/forum/?fromgroups#!topic/web2py/3VOr81wpP94 On Thu, Apr 26, 2012 at 10:53 AM, Richard Vézina < ml.richard.vez...@gmail.com> wrote: > Ok, but do you use pikled object in your app? > > If so, it could come from your code. > > There is maybe broken stuff in

Re: [web2py] String EOF error

2012-04-26 Thread Richard Vézina
Ok, but do you use pikled object in your app? If so, it could come from your code. There is maybe broken stuff in web2py, I saw mail passing on the list about pickle that could not work properly in newer version or in some circonstance, don't remember... I don't know I just try to help. Richard

Re: [web2py] String EOF error

2012-04-26 Thread Bruce Wade
Yeah except this is an issue with web2py I can't even view my apps error page as I just get that message now every time.However when viewing my site normally there is no problems On Thu, Apr 26, 2012 at 7:06 AM, Richard Vézina wrote: > May help?! > > http://bytes.com/topic/python/answers/36704-g

Re: [web2py] use PAM groups for group membership decorators

2012-04-26 Thread Matt Broadstone
On Wed, Apr 25, 2012 at 11:39 AM, Matt wrote: > It seems that web2py group membership is restricted to groups created by > web2py. We have a situation where we are bypassing web2py's user management > and using PAM directly. This works great for just logging in, but we have no > access to group in

Re: [web2py] String EOF error

2012-04-26 Thread Richard Vézina
May help?! http://bytes.com/topic/python/answers/36704-graceful-detection-eof Richard On Wed, Apr 25, 2012 at 5:29 PM, Bruce Wade wrote: > Hi I randomly get a EOFError this doesn't always happen and I have no idea > what is causing it. > > Traceback (most recent call last): > > File "/home/

Re: [web2py] combine Autocomplete widget and SELECT_OR_ADD_OPTION widget

2012-04-26 Thread Richard Vézina
Hi Brian, No problem, but just to make sure, the remix I made is a combination of web2py built-in autocomplete and since I can't make it works out of the box with SELECT_OR_ADD_OPTION, I merge both widget into a single "new" widget that I call : AutocompleteWidgetSelectOrAddOption So, as long as

Re: [web2py] Re: Ubuntu and Python3

2012-04-26 Thread Johann Spies
That article says that Python 2.7 will still be part of Ubuntu so there should not be a problem. Regards Johann -- Because experiencing your loyal love is better than life itself, my lips will praise you. (Psalm 63:3)

Re: [web2py] Re: Ubuntu and Python3

2012-04-26 Thread Bruno Rocha
12.04 is LTS. So the 2.7 will be on servers for a long time. We need to have web3py working till the next LTS. For development just need to create a tool or tutorial to run web2py on a virtualenv. http://zerp.ly/rochacbruno Em 26/04/2012 10:34, "Francisco Costa" escreveu: > another article > h

[web2py] Re: storing objects in session

2012-04-26 Thread Anthony
> > Some how this doesn't result in an error ticket, has anything changed? > Yes, after your original query, we fixed it -- Rows objects are now stored and retrieved as a list of Row objects instead of a list of dictionaries. Note, when Row objects are stored in the session (either individually

[web2py] Re: Ubuntu and Python3

2012-04-26 Thread Francisco Costa
another article http://www.wefearchange.org/2012/04/python-3-on-desktop-for-quantal-quetzal.html On Thursday, April 26, 2012 2:29:47 PM UTC+1, Francisco Costa wrote: > > People at Canonical are thinking on releasing the next Ubuntu (12.10) with > Python3 as default. > Wouldn't be nice to start d

[web2py] Ubuntu and Python3

2012-04-26 Thread Francisco Costa
People at Canonical are thinking on releasing the next Ubuntu (12.10) with Python3 as default. Wouldn't be nice to start developing web3py to be available in 6 months?

[web2py] Re: attachment;filename=%s.ics

2012-04-26 Thread Anthony
It should also work without the extra parentheses around IS_SLUG: 'attachment;filename=event_%s_%s.ics' % (IS_SLUG()(organization.name)[0], row.id) Anthony On Thursday, April 26, 2012 6:16:38 AM UTC-4, Annet wrote: > > This is what it has to be: > > {{response.headers['Content-Disposition'] =

[web2py] Re: how to create login form

2012-04-26 Thread Vibhor Purandare
Thank's On Thursday, April 26, 2012 6:46:21 PM UTC+5:30, Anthony wrote: > > You can customize it the same way as any SQLFORM. First, you can change > the formstyle via the auth.settings.formstyle setting (default is > table3cols, but you can change it to table2cols, divs, or ul). If you need >

[web2py] Re: byday=MO versus byday=row.Day.byday

2012-04-26 Thread Anthony
Is byday just a string? If so, how could it have a "weekday" and an "n" attribute? Anthony On Thursday, April 26, 2012 3:59:20 AM UTC-4, Annet wrote: > > I defined tables Day and OpeningHours: > > db.define_table('Day', > Field('name',length=16, > default='',notnull=True,unique=True), >

[web2py] Re: how to create login form

2012-04-26 Thread Anthony
You can customize it the same way as any SQLFORM. First, you can change the formstyle via the auth.settings.formstyle setting (default is table3cols, but you can change it to table2cols, divs, or ul). If you need more customization, see http://web2py.com/books/default/chapter/29/7#Custom-forms .

[web2py] Re: how to create login form

2012-04-26 Thread Vibhor Purandare
How to change the layout representation of auth login form

[web2py] Re: attachment;filename=%s.ics

2012-04-26 Thread Annet
This is what it has to be: {{response.headers['Content-Disposition'] = 'attachment;filename=event_%s_%s.ics' % ((IS_SLUG()(organization.name)[0]), row.id)}}

[web2py] Re: attachment;filename=%s.ics

2012-04-26 Thread Annet
Hi Cédric, > It's straight python I think. That's what I thought, but it results in the following error ticket. Traceback (most recent call last): File "/Library/Python/2.5/site-packages/web2py/gluon/restricted.py", line 205, in restricted exec ccode in environment File "/Library/Pytho

[web2py] byday=MO versus byday=row.Day.byday

2012-04-26 Thread Annet
I defined tables Day and OpeningHours: db.define_table('Day', Field('name',length=16, default='',notnull=True,unique=True), Field('byday',length=2,default='',notnull=True,unique=True), format='%(name)s', migrate=False) db.define_table('OpeningHours', Field('nodeID','reference