Re: [web2py] Re: An error occured, please reload the page

2016-08-22 Thread Martin Weissenboeck
Anthony, maybe I did not find the right words to describe the situation:. 1. While the error message is visible, I *can *edit the page. 2. The "save"-button is not disabled, but it does nothing. No changes are stored. 3. It is clear, that I have to dismiss the message. 4. Again

[web2py] Re: Can gluon.contrib.populate work with self reference?

2016-08-22 Thread pbreit
Well, just removing the db.commit() made it work as well except that it doesn't populate the self referencing field. if db(db.comment).count()<2: populate(db.comment, 30) On Monday, August 22, 2016 at 9:09:45 PM UTC-7, pbreit wrote: > > I fixed by specifying: > > if

[web2py] Re: Can gluon.contrib.populate work with self reference?

2016-08-22 Thread pbreit
I fixed by specifying: if db(db.comment).count()<2: import random for i in range(1,20): populate(db.comment, 1, contents={'parent_comment': i}) db.commit() On Monday, August 22, 2016 at 8:47:48 PM UTC-7, pbreit wrote: > > Trying to populate: > > db.define_table('comment', >

[web2py] how make repository on github for windows users?

2016-08-22 Thread Dmitri Ermolaev
What steeps? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users"

[web2py] Re: NameError: name 'category' is not defined (reddit clone application)

2016-08-22 Thread pbreit
The paging includes references to "category" except when viewing posts by author, there is no category. A quick fix would be to skip the paging when listing by author: {{if request.function!='list_posts_by_author':}} {{if page>0:}} {{=A('previous', _class='btn', _href=URL(args=(category.name,

[web2py] Re: IMPORTANT - WEB2PY CONSULTING

2016-08-22 Thread pbreit
A quick fix is to remove the paging links for the function " list_posts_by_author" at the bottom since they are using category: {{if request.function!='list_posts_by_author':}} {{if page>0:}} {{=A('previous', _class='btn', _href=URL(args=(category.name, page-1)))}} {{pass}} {{if

[web2py] Re: Limit string length in DAL

2016-08-22 Thread Ron Chatterjee
Its all good. Just checking. Thanks for the help Niphlod. On Monday, August 22, 2016 at 5:11:17 PM UTC-4, Ron Chatterjee wrote: > > What I want is allowing user to put limited string but they can't submit > the form with an empty field. > > requires = IS_EMPTY_OR([IS_LENGTH(8), IS_NOT_EMPTY()]

Re: [web2py] Re: An error occured, please reload the page

2016-08-22 Thread Anthony
OK, I see. At the bottom of the editor page there is a "Hooks" link which reveals a hidden Ajax component when clicked (it shows any _before/_after database callbacks attached to the DAL table models). That Ajax component actually calls the hooks() action in the appadmin.py controller of the

[web2py] Re: records-delete/truncate postgres table in appadmin

2016-08-22 Thread 黄祥
this is what i do in dev environment : *controllers/truncate.py* from gluon.admin import * auth.requires(has_membership_admin)(lambda: None)() def index(): for table in db.tables: db[table].truncate() app = request.application clean = app_cleanup(app, request) redirect(URL('default', 'index') )

[web2py] Reddit clone source code?

2016-08-22 Thread pbreit
Is the Reddit Clone source code from the Vimeo videos (https://vimeo.com/104823162) available anywhere? I saw the Reddit app in the "appliances" source: https://github.com/mdipierro/web2py-appliances But it's quite a bit different. Or does anyone know if a good Reddit and/or HackerNews

[web2py] Re: Limit string length in DAL

2016-08-22 Thread Ron Chatterjee
What I want is allowing user for put limited string but they can't submit the form with an empty field. requires = IS_EMPTY_OR([IS_LENGTH(8), IS_NOT_EMPTY()] ) That don't work. Obviously not because its conflicting. Right? In one hand I am saying empty or insert value (8) and then saying

[web2py] Re: Limit string length in DAL

2016-08-22 Thread Niphlod
to my knowledge, the general rule for validators is that if you have multiple requirements, you should pass a list. That being said, the are "special" validator, like IS_EMPTY_OR, that take a validator as an argument. Goes without saying (it quite translates well), that

Re: [web2py] Re: An error occured, please reload the page

2016-08-22 Thread Martin Weissenboeck
Hi Anthony! No, the error is within the app. Please try it: (1) Create a new app (2) Add this line to db.py: db.define_table("mytable", Field("message")) (3) Wait some seconds. The message "An error occured, please reload the page" appears. (4) The error message in the error file is:

[web2py] Re: web2py resources

2016-08-22 Thread Dmitri Ermolaev
web2py application foe bets portal in bitcoin payments https://github.com/icreator/web2py_bets_bitcoin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) ---

[web2py] Re: NameError: name 'category' is not defined (reddit clone application)

2016-08-22 Thread Dave S
On Monday, August 22, 2016 at 6:58:08 AM UTC-7, Annexx Xaar wrote: > > Hello sir i have tried all i could, still having errors in the reddit > clone application. > everything works fine except when i > implemented {{=author(user_id)}} under list_posts_by_votes.html > the errors blows when i

[web2py] Re: question on how to use pdfinvoice

2016-08-22 Thread Massimo Di Pierro
There is no template. you need to edit the pdfinvoice.py file. On Sunday, 21 August 2016 04:00:42 UTC-5, Vic Ding wrote: > > Hi all, > I am trying to generate pdf using pdfinvoice. The invoice is being > generated and presented in the view. > I am wondering, how can I customise the layout of

[web2py] Re: How do I send a pdf as json object saved in the web2py db?

2016-08-22 Thread Massimo Di Pierro
what? On Sunday, 21 August 2016 05:01:02 UTC-5, Steve Joe wrote: > > How would you do it? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received

[web2py] How can I install a CMS such as Instant-Press via the command line interface?

2016-08-22 Thread Varad Karmarkar
I'm not using the web interface. Any assistance would be appreciated. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because

[web2py] Re: Limit string length in DAL

2016-08-22 Thread Ron Chatterjee
In other words, if I do this: IS_EMPTY_OR(IS_LENGTH(8)) It prevents longer length string but the empty field is inserted as None. I want to prevent both. On Monday, August 22, 2016 at 10:54:08 AM UTC-4, Ron Chatterjee wrote: > > Two question, if you don't mind. > > (1) requires =

[web2py] Re: Limit string length in DAL

2016-08-22 Thread Ron Chatterjee
Two question, if you don't mind. (1) requires = IS_NOT_EMPTY(IS_LENGTH(64)) Or requires = IS_EMPTY_OR(IS_LENGTH(64)) Doesn't work. In other words, if I want to limit the string field entry but also want requires not empty, how to go about it? (2) for my sql, do I still need length = 64 (or 255

[web2py] Re: NameError: name 'category' is not defined (reddit clone application)

2016-08-22 Thread Marlysson Silva
It's possible show the result of get_category function ? Or show errors in these point ? Em segunda-feira, 22 de agosto de 2016 11:12:44 UTC-3, Annexx Xaar escreveu: > > Pls I am waiting for reply. pls anyone help? > > > > > > > > On Monday, August 22, 2016 at 2:58:08 PM UTC+1, Annexx Xaar

Re: [web2py] Re: How to recreate Scheduler tables?

2016-08-22 Thread Tito Garrido
Thanks! On Mon, Aug 22, 2016 at 10:36 AM, Niphlod wrote: > mysched = Scheduler(., migrate=True) > > > On Monday, August 22, 2016 at 3:17:24 PM UTC+2, Tito Garrido wrote: >> >> I have upgraded from 2.5.1 to the latest version but seems that the >> scheduler tables had

[web2py] Re: IMPORTANT - WEB2PY CONSULTING

2016-08-22 Thread Annexx Xaar
Hello sir i have tried all i could, still having errors in the reddit clone application. everything works fine except when i implemented {{=author(user_id)}} under list_posts_by_votes.html the errors blows when i click on the author of a comment. it does not dislay the author's name as it

[web2py] Re: NameError: name 'category' is not defined (reddit clone application)

2016-08-22 Thread Annexx Xaar
Pls I am waiting for reply. pls anyone help? On Monday, August 22, 2016 at 2:58:08 PM UTC+1, Annexx Xaar wrote: > > Hello sir i have tried all i could, still having errors in the reddit > clone application. > everything works fine except when i > implemented {{=author(user_id)}} under

[web2py] Re: reddit clone - foreign key constraint failed

2016-08-22 Thread Annexx Xaar
Examine ur controller, its likely from the controller, i had similar issue. On Friday, November 27, 2015 at 12:43:33 AM UTC+1, Carlos Zenteno wrote: > > Coming back to web2py again. > > I am going through Massimo's videos and doing the reddit clone. > > I use appadmin to add users and categories

[web2py] NameError: name 'category' is not defined (reddit clone application)

2016-08-22 Thread Annexx Xaar
Hello sir i have tried all i could, still having errors in the reddit clone application. everything works fine except when i implemented {{=author(user_id)}} under list_posts_by_votes.html the errors blows when i click on the author of a comment. it does not dislay the author's name as it

[web2py] Re: How to invoke recurring Scheduler task

2016-08-22 Thread Niphlod
"""What I am not clear on is the best way to invoke this code so that only one copy of the task is created""" if you need what you asked, that is the way to do it. You asked for a piece of code that ensures a task is queued but only that one. My solution to the "problem" is having a piece of

[web2py] Re: How to recreate Scheduler tables?

2016-08-22 Thread Niphlod
mysched = Scheduler(., migrate=True) On Monday, August 22, 2016 at 3:17:24 PM UTC+2, Tito Garrido wrote: > > I have upgraded from 2.5.1 to the latest version but seems that the > scheduler tables had changed... I have dropped the old ones and now I am > trying to set web2py to recreate it.

[web2py] How to recreate Scheduler tables?

2016-08-22 Thread Tito Garrido
I have upgraded from 2.5.1 to the latest version but seems that the scheduler tables had changed... I have dropped the old ones and now I am trying to set web2py to recreate it. If I try to enable migrate it complains about some tables that already exists... how to circunvent the tables that are

[web2py] Re: How to invoke recurring Scheduler task

2016-08-22 Thread Scott Hunter
What is a "protected controller"? It sounds like I need a recurring task to monitor my recurring task ("recurring tasks all the way down"). - Scott On Monday, August 22, 2016 at 7:47:07 AM UTC-4, Niphlod wrote: > > just queue the task in a protected controller that checks before inserting >

[web2py] Re: An error occured, please reload the page

2016-08-22 Thread Anthony
If you are receiving an error while in the admin app, then the error is within the admin app itself, not your own app code. To see what the error is, visit the errors page for the admin app itself. You can also open the browser developer tools to examine the specific Ajax request and response

[web2py] Re: How should I tackle this error?

2016-08-22 Thread Anthony
> > def resizedp(): > display=db(db.dp.user_id == auth.user_id).select().first() > from PIL import Image > im1=Image.open(display.pic); > display.pic is just the file name, but you must provide the entire path -- try: import os im1 =

[web2py] Re: Limit string length in DAL

2016-08-22 Thread Niphlod
requires=IS_LENGTH(64) will limit insertion upon validation. the "length" attribute gets translated, wherever possibile, to backend-specific syntaxes. On Sunday, August 21, 2016 at 4:21:22 AM UTC+2, billy...@gmail.com wrote: > > How we limit string length in DAL? It seems length = 64 doesn't

[web2py] Re: How to invoke recurring Scheduler task

2016-08-22 Thread Niphlod
just queue the task in a protected controller that checks before inserting if another instance has been already queued and call that protected controller once in a while (i.e. once per day) On Monday, August 22, 2016 at 3:10:44 AM UTC+2, Scott Hunter wrote: > > The book seems pretty clear

[web2py] Re: Getting only the latest "version" in a query of items with versions.

2016-08-22 Thread Niphlod
max(version_date) . group by item.id On Monday, August 22, 2016 at 9:52:55 AM UTC+2, Encompass solutions wrote: > > Consider the following pseudo model. > > item > ->name = "string" > > version > ->item_id = item.id > ->version_date = "datetime" > > > While I can easily create a

[web2py] How should I tackle this error?

2016-08-22 Thread Steve Joe
def index(): display=SQLFORM(db.dp ,point.id, showid=False, submit_button="Update" ).process() if display.accepted: redirect(URL('you','resizedp', args=auth.user_id)) return locals() def resizedp(): display=db(db.dp.user_id == auth.user_id).select().first() from PIL

Re: [web2py] LDAP authentication and user creation

2016-08-22 Thread Niphlod
see the source and adapt to your likings: web2py is not going to become an LDAP inventory automatically...studying LDAP is not bad per se: you'll find its query syntax pretty much in every 3rd party tool that integrates with LDAP for some kind of reason. On Friday, August 19, 2016 at 4:23:14

[web2py] Re: records-delete/truncate postgres table in appadmin

2016-08-22 Thread Mirek Zvolský
Probably something with foreign key integrity (cascade, restrict, ...) because after deleting of records in other tables it works. However, how to understand such error tickets? Dne pondělí 22. srpna 2016 13:31:50 UTC+2 Mirek Zvolský napsal(a): > > I am trying delete all records with appadmin.

[web2py] records-delete/truncate postgres table in appadmin

2016-08-22 Thread Mirek Zvolský
I am trying delete all records with appadmin. Error message is not very descriptive. Any idea? Traceback (most recent call last): File "/home/www-data/web2py/gluon/main.py", line 464, in wsgibase session._try_store_in_db(request, response) File "/home/www-data/web2py/gluon/globals.py",

[web2py] Getting only the latest "version" in a query of items with versions.

2016-08-22 Thread Encompass solutions
Consider the following pseudo model. item ->name = "string" version ->item_id = item.id ->version_date = "datetime" While I can easily create a collection of the item with it's versions. all_items = db((db.item.id > 0) & (db.version.item_id == db.item.id)).select(orderby=db.item.name |

Re: [web2py] Re: static asset management

2016-08-22 Thread Mathieu Clabaut
Try : response.static_version_urls = True in your model. I think it is not documented in the book, but there is a bug report about it. On Mon, Aug 22, 2016 at 6:46 AM T.R.Rajkumar wrote: > I hope the question is not clear. The purpose is to reduce band with by >

[web2py] Re: An error occured, please reload the page

2016-08-22 Thread mweissen
What I have done: db.define_tabel("mytable", Field("message")) "message" is not allowed as name for a field and I get "An error occured, please reload the page" Now I reload db.py and I want to change "message" to "mymessage". But I cann't: the error message appears faster than I could edit