[web2py] Re: New-py4web-group

2020-04-12 Thread Andrew W
Excellent, thanks Massimo.

On Sunday, March 29, 2020 at 8:46:26 AM UTC+13, Massimo Di Pierro wrote:
>
> We ave a new group for py4web questions and discussions:
>
> https://groups.google.com/forum/#!forum/py4web
>
> Please also use it for pydal, yatl, and pluralize questions.
> For web2py specific questions, please use the per-existing group.
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8f0a0eb8-6f11-4772-9856-94b0ba17897d%40googlegroups.com.


[web2py] py4web - Deployment on GCloud (aka Google App Engine)

2020-04-12 Thread Andrew W
Hi all,
Not a question but a tip for others experimenting with py4web on GCP App 
Engine.

Following the instructions in the _documentation, after a few failed 
attempts to access my app (with 502 and 404 errors), I modified the deploy 
command in the Makefile by adding the --promote flag to make it :

gcloud app deploy app.yaml --promote


I'm ready to build out my first py4web app !

Might be worth adding this to the script and/or documentation.


Regards

Andrew W



-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1d9e301f-7575-4671-a67b-c38c19a8bb37%40googlegroups.com.


[web2py] Re: Weird problems with scheduler on OSX

2015-09-14 Thread Andrew W
Late to this as I haven't run the scheduler on my mac before.  The script 
runs fine.
I'm getting the same python error.   Running 2.12.3 Stable.

Andrew W

On Monday, March 9, 2015 at 10:59:36 AM UTC+13, Niphlod wrote:
>
> try this script and see if it fails. it's the boiled down version of what 
> happens with -X
>
> https://www.dropbox.com/s/5dpddioc4u8z6bg/web2py_trial.py?dl=0
>
> PS: put it next to web2py.py and run it with 
>
> python web2py_trial.py
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web2py web mapping capabilities

2014-09-16 Thread Andrew W
You could also use d3.js with web2py, using geojson and topojson for display.   
See d3js.org

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: a proposal for form improvement

2014-09-08 Thread Andrew W
Sounds like I need to improve my JS skills.
A Plugin or a Module ?   which is better for this type of thing ?



On Friday, September 5, 2014 3:56:23 PM UTC+10, Massimo Di Pierro wrote:
>
> Please find attached a welcome4.zip with contains the following files:
>
> controllers/default.py
> views/layout.html
> vides/default/index.html
> modules/jform.py
> static/js/jform.js
> static/js/jform-bootstrap2.js
> static/js/jform-bootstrap3.js
>
> My proposal is the following:
> 1) deprecate SQLFORM (but keep it for backward compatibility)
> 2) replace 
>
> form = SQLFORM(table).process()
> ...
> {{=form}}
>
> with
>   
> form = JForm(table)
> ...
> {{=form}}
>
> what is the difference? SQLFORM generates html. JForm generates JSON 
> metadata which is then converted into the form client-side by the js in 
> jform.js.
> why?
> - it is much faster because all rendering is done client-side
> - it can "optionally" submit the form via Ajax without having to change 
> your code.
> - it is much easier to style and create widgets for different css 
> frameworks.
> For example include the right one:
> static/js/jform-bootstrap2.js
> static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not bs3)
> - it is much more powerful because you can customize widgets in JS. 
>
> We could also add a JTable, a JMenu and a JLogin and keep all the styling 
> info in JS files as opposed to Python files.
> This would make web2py leaner and cleaner.
>
> Thoughts?
>
> Massimo
>
>
>
>
>
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: scheduler new feature: task dependencies

2014-08-06 Thread Andrew W
P.S.  Although I expect they are not the same thing, I am interested to see 
how this dependency feature may be used to implement the workflow ideas 
expressed in:
https://groups.google.com/forum/#!searchin/web2py/workflow/web2py/0z1BysNp8Gc/aQFdaBqymE8J
 
 
 

On Thursday, August 7, 2014 7:28:11 AM UTC+10, Andrew W wrote:

> Sounds great.  Looking forward to testing it out.  Thanks
> Andrew W

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: scheduler new feature: task dependencies

2014-08-06 Thread Andrew W
Sounds great.  Looking forward to testing it out.  Thanks
Andrew W

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: When to use jQuery.ajax or $.web2py.component ?

2014-06-30 Thread Andrew W
Thank you Anthony,
I have read that section many times, and I'll probably go back and read it 
again as javascript is not my strong point. 

Perhaps I'm getting component confused with a component plugin, which may 
require a view to "LOAD" it.  Using the looser definition, a callback 
function (controller) is still a component that can be called by 
$.web2py.component.

Maybe Massimo was just using that approach for demonstration / education 
purposes.  If both are relevant, I'll try the $.web2py.component until I 
find a situation where I get stuck.   I'll try and rewrite that section of 
reddit_clone as an example.  

Regards
Andrew W

On Tuesday, July 1, 2014 1:40:17 PM UTC+10, Anthony wrote:
>
> The jQuery ajax method can be used but is not web2py specific. web2py 
> components provide some additional functionality and convenience. See the 
> documentation: 
> http://web2py.com/books/default/chapter/29/12/components-and-plugins#Components--LOAD-and-Ajax
> .
>
> Anthony
>
> On Monday, June 30, 2014 8:30:24 PM UTC-4, Andrew W wrote:
>>
>> Hello,
>> I've been looking into the use of callbacks and components to make a more 
>> dynamic app.   I revisited the reddit_clone app from web2py training videos 
>> and noticed that is uses the following:
>>
>>  jQuery.ajax({method:'post',url:'{{=URL("comm_vote_callback")}}',
>>
>> Trying to understand the rule when I would use the above technique over 
>> using $.web2py.component.   Is it correct that either could have been used 
>> for the reddit_clone scenario ?  
>>
>> Thanks
>>
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] When to use jQuery.ajax or $.web2py.component ?

2014-06-30 Thread Andrew W
Hello,
I've been looking into the use of callbacks and components to make a more 
dynamic app.   I revisited the reddit_clone app from web2py training videos 
and noticed that is uses the following:

 jQuery.ajax({method:'post',url:'{{=URL("comm_vote_callback")}}',

Trying to understand the rule when I would use the above technique over 
using $.web2py.component.   Is it correct that either could have been used 
for the reddit_clone scenario ?  

Thanks

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Trying to use the LOAD helper, if a button is clicked

2014-06-20 Thread Andrew W
Thanks.

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Trying to use the LOAD helper, if a button is clicked

2014-06-18 Thread Andrew W
Hi, 
trying to find out more about $.web2py.component, but it's not in the book. 
 Chapter 11 mentions web2py_ajax_component but it isn't mentioned in 
Chapter 12 as indicated.  An old reference perhaps.
Anthony, I don't understand "If you want to dynamically add a component in 
the browser, you cannot use the LOAD helper"  as the example also 
includes a {{= }}.   Then again, I don't really understand javascript 
either.
When to use LOAD or $.web2py.component ?

Thanks



On Thursday, June 19, 2014 1:25:48 PM UTC+10, Brian M wrote:
>
> Here's how I'm doing it in an app. I'm not using grid or smartgrid but 
> rather a datatables.net table where each row has a linked edit button.  
> There may be other (better?) ways to do it but this works for me.
>
> Each record includes:
> {{=A(edit_icon, _href=URL(r=request,f='edit_item', args=[record_id]), 
> _class="updateDialog")}}
>
>
> And then I've got javascript to intercept the clicks on the edit icon, 
> figure out which record's edit page it links to and instead load that edit 
> form within a jqueryui dialog.
> 
> //Manage the display of the dialog for editing details.
> $(function() {
> $("#edit_dialog").dialog({
> width: 600,
> height: 355,
> modal: true,
> //hide: 'slide',
> autoOpen: false
> });
> //opens the dialog whenever one of the edit icons is clicked
> $(document).on('click', 'a.updateDialog', function() {
> //get url to load from the clicked link's href
> var url = $(this).attr('href');
>
> //get the datatable row ID that we're editing
> var nTr = $(this).closest("tr").get(0); // key line that gets the 
> closest TR
> aPos = vol_table.fnGetPosition( nTr ); // gets the position 
> within the datatable
> 
> //augment the url with the row index (aPos) because need to be 
> able refer to it in the server response to be able to update correct row's 
> display
> url = url+'/'+aPos;
> 
> //load up the actual form from server & embed it within the 
> dialog's body element (edit_form_loader)
> $.web2py.component(url, 'edit_form_loader');//request web2py's 
> ajax to reload the component with the URL for this specific item's info
>
> $('#edit_dialog').dialog('open');//show the dialog
> return false;
> });
> });
>
>
> 
>
>
>
> Good Luck!
> ~Brian
>
> On Wednesday, June 18, 2014 9:45:08 AM UTC-5, Tomeu Roig wrote:
>>
>> I call a function that content a grid or smartgrid and need pass args and 
>> (user_signature=True), how i can make it?
>>
>> now I use in controller response.js like:
>>
>> tab_history = """jQuery('#historial 
>> a[href="#historico"]').click(function(){
>> $.web2py.component("%s", target="historico");
>> })""" % URL('albaranes', 'view_albs_cli.load', 
>> args=[cliente_id,'historico'],user_signature=True)
>> response.js = tab_history
>>
>> It's works but i would like make the same in the view, it's possible?
>>
>> thanks.
>>
>> El lunes, 16 de junio de 2014 15:33:05 UTC+2, Anthony escribió:
>>>
>>> If you want to dynamically add a component in the browser, you cannot 
>>> use the LOAD helper, which is a Python helper that is serialized on the 
>>> server. Instead, use the $.web2py.component() Javascript function. 
>>> Something like:
>>>
>>> 
>>>
>>> 
>>>
>>> Anthony
>>>
>>> On Friday, June 13, 2014 7:47:34 PM UTC-4, Omri Levy wrote:

 Hi ,

 So I have a ticket system, and I want to allow user to edit the ticket 
 without leaving the page.
 I don't want to LOAD the edit_page and hide it, but only load it once 
 user is clicking on the ticket body.
 Another thing is, when user edits the ticket, he should again see 
 changes on the same page.

 Is this possible? I'm a bit confused, because LOAD works fine, but not 
 when using conditions with JS.

 Thanks.

>>>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Brainstorming

2014-06-16 Thread Andrew W
I want to use the template capabilities of web2py for server side script 
generation, not just html.   From my brief look at the ractive website I'm 
wondering if it is any better than what web2py does now.  Do I really want 
a js library for this for server side templating.  I could use node but I 
can't see a reason to change.

Massimo, are you thinking of changing the templating approach ?


On Tuesday, June 17, 2014 6:25:17 AM UTC+12, Derek wrote:
>
> I prefer jqote2 and jquery pesonally. It's one of the fastest out there 
> and the templates are pretty simple yet flexible.
>
> On Sunday, June 15, 2014 1:34:25 AM UTC-7, Massimo Di Pierro wrote:
>>
>> Often Angular comes up on this list. I tried it and I was un-impressed. 
>> Instead today my favorite client-side stack is based on these:
>>
>> - jquery.js
>> - sugar.js
>> - ractive.js
>> - semantic-ui (css & js)
>>
>> Have you tried sugar, ractive, and semantic-ui? What is your opinion?
>>
>> Massimo
>>
>>
>>
>>
>>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: {{=XML(data)}} for javascript variable issue

2014-06-12 Thread Andrew W
Yes.  Add a 

[web2py] Re: json to D3 graph

2014-06-11 Thread Andrew W
P..S.   The above uses the approach of the generic.json files.  Refer to:
http://web2py.com/books/default/chapter/29/10/services?search=serializers
and the generic.json code.


On Thursday, June 12, 2014 8:20:04 AM UTC+10, Andrew W wrote:
>
> This may not be the crucial hint, but I noticed that your flare is a list 
> (array).  If you checkout the structure at:
> https://github.com/mbostock/d3/wiki/Cluster-Layout you see that its a 
> dict (or object).
>
> Try removing the [] around your flare definition. 
>
> Secondly:   Where I have used XML(json... in the controller  it has been 
> to produce a standaoone .json output from web2py, I then create an 
> independent view that then uses the d3.json function to read the json 
> output.   That is the approach that mostly matches the majority of d3 
> examples.   This works if you want to separate your data sources (thinking 
> independent data api)  from your presentation views.
>
> The other approach is to use the variables, which you've done.  There may 
> be more than one way to do this but this has worked for me:
> 1.  Change your flare definition to be a dict. remove the []
> 2.  Change your controller output to be return locals(). 
> 3.  In your view , in the 

[web2py] Re: json to D3 graph

2014-06-11 Thread Andrew W
This may not be the crucial hint, but I noticed that your flare is a list 
(array).  If you checkout the structure at:
https://github.com/mbostock/d3/wiki/Cluster-Layout you see that its a dict 
(or object).

Try removing the [] around your flare definition. 

Secondly:   Where I have used XML(json... in the controller  it has been to 
produce a standaoone .json output from web2py, I then create an independent 
view that then uses the d3.json function to read the json output.   That is 
the approach that mostly matches the majority of d3 examples.   This works 
if you want to separate your data sources (thinking independent data api)  
from your presentation views.

The other approach is to use the variables, which you've done.  There may 
be more than one way to do this but this has worked for me:
1.  Change your flare definition to be a dict. remove the []
2.  Change your controller output to be return locals(). 
3.  In your view , in the 

[web2py] json to D3 graph

2014-06-11 Thread Andrew W
What else is in your view?  Is the code inside a 

[web2py] Re: D3.js calling Json in View

2014-05-23 Thread Andrew W
good work.  data just refers to the dictionary.  When you open up your json 
file you just see a dictionary with one key that points to an array.
By saying data.dashboard_data you are then directly referencing the value 
of the key, ie. the array in the dictionary.  

There are several ways to do this which I must post to web2pyslices soon, 
but yours is one of them, and it works !

web2py with d3 is a good combo.   I plan to do a lot more with the two 
combined.



On Friday, May 23, 2014 10:04:17 PM UTC+10, thehuman trashcan wrote:
>
> In my impatience I just quickly edited the file.  data.dashboard_data is 
> all that was needed.
>
> I have managed to leave Scheme=true.
>
> I don't fully understand how data.dashboard_data converts my dictionary to 
> an array, but I will be looking into this to understand.
>
> In any case, thank you ever so much!
>
>
> On Friday, 23 May 2014 05:41:16 UTC+1, Andrew W wrote:
>>
>> Also, try scheme='https' in your case. See Core chapter of book.
>
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Simple loan system for library

2014-05-23 Thread Andrew W
Hi John,
One step at a time, looking at your database model,  how does 'copies' 
relate to a book ?  You are missing a foreign key reference.   Are there 
any other attributes that a copy may have ?


On Saturday, May 24, 2014 7:30:35 AM UTC+10, john smith wrote:
>
> I'm trying to create library system and have a little problem. Here's my 
> current model:
> db.define_table('tags', 
> Field('name'),format='%(name)s') 
> db.define_table('copies',
> Field('is_active','boolean',default=True))
>
> db.define_table('book',
> Field('title',requires=IS_NOT_EMPTY(), label='Tytuł'),
> Field('author', requires=IS_NOT_EMPTY(), label='Autor'),
> Field('isbn', 'integer', requires=IS_LENGTH(13), label='ISBN'),
> Field('release_year', 'integer', requires=IS_INT_IN_RANGE(-3000, 
> request.utcnow.year+1), label='Rok wydania'),
> Field('format', label='Format'),
> Field('cover', 'upload', requires = IS_EMPTY_OR(IS_IMAGE()), 
> label='Okładka'),
> Field('publisher', label='Wydawca'),
> Field('tags', 'list:reference tags', label='Tagi'), 
> Field('copies', db.copies),
> auth.signature)
>
> db.book.tags.widget = SQLFORM.widgets.checkboxes.widget
>
> Here is what I want to achieve: when a user adds new 'book' table record, 
> he types number of copies of that book and that amount of records is 
> automatically created in 'copies' table. Then a user will be able to loan a 
> specific copy of a book (i will probably be able to figure this part out 
> thanks to library example) but only for specific period. If you have other 
> ideas on how to solve my problem, please share.
> Also less important but i would like to change the style of my tags 
> widget, so it would display either set number of tags per row or just 
> display maximum number that will fit in screen.
> Thanks in advance for all replies.
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: D3.js calling Json in View

2014-05-22 Thread Andrew W
Also, try scheme='https' in your case. See Core chapter of book.

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: D3.js calling Json in View

2014-05-22 Thread Andrew W
I'm not at a desktop machine so I'll be brief.
D3 expects an array, you have provided a dict.
When you reference "data" such as in the foreach, try data.dashboard_data which 
will reference the array.  Syntax is probably not quite correct.

Also, if you're not sure add console.log stmts to show the data.  I used this a 
lot to better understand what's happening and to debug.

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: D3.js calling Json in View

2014-05-21 Thread Andrew W
In the URL() call, add scheme=True, host=True.   

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: D3.js calling Json in View

2014-05-20 Thread Andrew W
I use this technique regularly.  Show the controller code and/or json output 
and I'll have a look.

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: RFC: web2py-based workflow engine

2014-04-18 Thread Andrew W
Thanks.  That's a .net solution so not quite the web2py solution I was looking 
for.

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Dynamic, User customisable DAL connection parameters

2014-04-08 Thread Andrew W
Hello,
I am building a web2py app which is an admin interface for an exisitng 
application with its own database.   I will define all of the other app's 
tables with migrate=False.
I would like the setting of the DAL connection parameters for this database 
to be a part of the web2py application.  
 
Problem is that I will not know the password, or even the user, and these 
need to be updatable by the end user.  So I can't let web2py try to connect 
until I have these set.
 
Looking for feedback on the following approach.  It works (so far) but 
wondering if there is a simpler approach or a pattern that has already been 
worked out ?
 
1) I have defined the DAL and tables for the user's app in a models 
subfolder, so that the initial web2py connection will not immediately try 
to connect to this database.
2)  I have a 0conn.py model file, something like:
CONN_FUNCTION='localconn'
if session.localconn:
# Good news, I already have the connection details as a session 
variable.
pass
elif not session.redir:
#redirect to the screen with the form to specify the connection details 
, and update the session parameters
#set redir to True so that it doesn't start an infinite loop of 
redirects each time the model is called.
session.redir = True
redirect(URL('LocalTD', 'default', CONN_FUNCTION))
elif session.redir and request.function == CONN_FUNCTION:
# This is a proper redirect to the conn setting, let it go
pass
else:
print "This should really be a redirect, what's going on ?"
print "I have a session.localtdconn: %s, redir : %s" % 
(session.localtdconn, session.redir)
3) in the standard SQLITE db.py I have defined a connection table that 
stores all of the connection parameters.
   The function CONN_FUNCTION (from above) has a form that retrieves this 
info and allows the user to update it. if the form is accepted, it will 
also set the session variables.
   CONN_FUNCTION is called the first time the app is opened to confirm the 
connection details, update the table if necessary, and sets the session 
variables.
 
4) finally my models/local.py model file specifies DAL something like:
 dbc = DAL('drivername'://DSN=session.localconn['dsn']; \
 UID=session.localconn['dbuser']; \
 PWD=session.localconn['pwd']; 
etc.
   This model file should only be called if the session.localconn variable 
is already set.
 
Any comments on this apprach ?
 
Thanks
Andrew W
 
 

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Incompatibility with web2py's calendar.js and d3.js

2014-02-09 Thread Andrew W
Update:  I applied a fix from the d3 post by adding this to my 

[web2py] Incompatibility with web2py's calendar.js and d3.js

2014-02-09 Thread Andrew W
Date parsing in d3 doesn't work with web2py when running the default 
calendar.js.  d3.time.format().parse()
 
I've just hit this specific issue, using d3 with web2py (date parsing in d3 
fails), using web2py 2.8.2.
https://groups.google.com/forum/#!searchin/d3-js/d3.time.format.parse/d3-js/dSOl8BBcGfw/A_yb0blePyIJ
 
and I also found this web2py issue involving moment.js which had the same 
cause; that calendar.js overwrites setFullYear.
http://osdir.com/ml/web2py/2012-12/msg01573.html  which resulted in an 
issue:  
*http://code.google.com/p/web2py/issues/detail?id=1243*<http://code.google.com/p/web2py/issues/detail?id=1243>
  

"It appears that calendar.js redefined the Date.setFullYear function of the 
JS Date object. "
 
This issue was resolved in Dec 2012  "The fix involves preventing the 
re-definition of the methods and creating new ones, as needed by 
calendar.js."   Any more details on the fix for this?
Should I reopen this issue or is there something that has to be done in 
web2py to work around this ? 
 
Note that I commented out calendar.js from the web2py_ajax.html and 
everything then works as expected. I'm sure I'll need calendar.js for 
other things though.
 
thanks
 
Andrew W

 


 
 

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: how to custmize the layout in web2py

2013-12-15 Thread Andrew W
And adding to what Anthony said, look at this web2py tutorial site which builds 
the ui from scratch.
http://killer-web-development.com/section/4/2

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Scheduler - a second try

2013-11-07 Thread Andrew W
Well, I just added -D 0 when starting the scheduler and it prints to the 
console.   
Yes, we should add something, because after reading the logging sections of 
the book I was sure I had to add something to the conf file.

On Friday, November 8, 2013 3:46:29 PM UTC+11, Jonathan Lundell wrote:

> On 7 Nov 2013, at 7:05 PM, Andrew W > 
> wrote:
>
>  Thanks.   I've never been quite sure what to put in logging.conf for the 
> scheduler debug key, based on the "logger =" statement in scheduler.py.
>
>
> We should add a schedule section to the logging example file.
>
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Scheduler - a second try

2013-11-07 Thread Andrew W
Thanks.   I've never been quite sure what to put in logging.conf for the 
scheduler debug key, based on the "logger =" statement in scheduler.py.
 
 

On Friday, November 8, 2013 6:59:17 AM UTC+11, Niphlod wrote:

> logging is enabled as anything else in web2py.
> just start the scheduler with 
> web2py.py -K appname -D 0
> to enable the DEBUG level.
> Of course logging.conf must be configured to allow DEBUG messages to be 
> printed in the console.
>
> BTW: *Error cleaning up* shows up usually when the scheduler can't act on 
> its own tables. I've seen that happen with SQLite without WAL and multiple 
> workers, because of the well known problems related to SQLite concurrency, 
> but never on a "production-ready" backend. That's why I asked for what db 
> is used in that app. 
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Scheduler - a second try

2013-11-07 Thread Andrew W
herbou1 is   a function in my isi-controller.

Shouldn't this function be in your models?

A question for you:  how did you turn on debugging for the scheduler?

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: odbc error question, when running scheduler_test app.

2013-10-16 Thread Andrew W
Apparently MSSQL ODBC does an implicit DEALLOCATE for cursors, whereas 
Teradata doesn't.I'm testing a new close() method for the Teradata 
Adapter that does a self.connection.cursor.close() as well.  So far so 
good.   No reason why this couldn't be done in general (explicit close for 
each open)  but I'll get it working for Teradata for now.
 
Thanks
 
 

On Wednesday, October 16, 2013 5:43:09 PM UTC+11, Niphlod wrote:

> on mssql I don't see anything like that, even raising to 15 pool_size and 
> flooding the poor rocket webserver there are at most 15 connections to 
> the backend.
>
> Il giorno mercoledì 16 ottobre 2013 00:30:37 UTC+2, Andrew W ha scritto: 
>>
>> P.S.   This may be an issue for all pyodbc databases MSSQL, DB2.
>>
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: odbc error question, when running scheduler_test app.

2013-10-15 Thread Andrew W
P.S.   This may be an issue for all pyodbc databases MSSQL, DB2.

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: odbc error question, when running scheduler_test app.

2013-10-15 Thread Andrew W

>
>  yes but, if the connection is recycled, a new session is created for the 
> same connection,
>
 
Depends what "recycled" means.  I thought the idea of a pool_size was that 
the session is reused, saving on database login time.  the code in 
ConnectionPool.reconnect()  implies that the pool keeps open existing 
connections (& cursors ?)  self.connection = POOL[uri].pop()
 
Did you mean cursor instead of session ?
 

>  A new cursor is created when a connection is recycled (pool_size>0). 
>  
>
Yes, I can see that in self.cursor = cursor and self.connection.cursor()
 
 

>  This is possible. We close the connection (when necessary) but I do not 
>> think there is a concept of closing a cursor. How would you close it on 
>> Teradata?
>>
>  
>
 
Teradata is using pyodbc, and it is possible to do cursor.close(), as well 
as connection.close().http://code.google.com/p/pyodbc/wiki/Cursor  .
What I think is happening is that each new request is creating a new 
cursor, possibly with existing connections from the pool.   At the end of 
the request the cursor is not closed and stays open.After a few 
requests the number of cursors builds up for the connection, and pretty 
soon the 16 cursor limit is reached.
 
I think what is missing is that at the end of a request there should be a 
self.cursor.close(), or for the DAL: self._adapter.cursor.close().   
Where is dal.py does a connection get returned to the pool when the request 
is finished ?   
Given that a connection is meant to have a single curror, in the case of 
pyodbc, should methods like commit, rollback, and close be at the cursor 
level, not the connection level ?   
 
I think a workaround is to not set pool_size, thereby getting a new session 
with only one cursor each time, but this will be a lot slower.
Sorry if this has turned into more of a developer post.
 
Thanks
Andrew W

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: odbc error question, when running scheduler_test app.

2013-10-14 Thread Andrew W
I've found out that a cursor maps to a odbc hstmt.   I also found out that 
Teradata supports 16 open result sets (hstmt) for each session.   So it 
appears that web2py is reusing the same database session for multiple 
simultaneous requests, or isn't closing them correctly before starting the 
next request. 
 
To rephrase my question a bit,  Does a web2py connection equate to a 
database session ?   Does a new request reserve a connection until it's 
complete, i.e another request can't issue database statements 
simultaneously on the same connection ?
 
So, I think the closing of a connection, or the returning of it to the 
pool, is not working properly on Teradata.  Perhaps the cursors are staying 
open and new cursors are created instead of reusing the existing ones (with 
pool_size>0).   I see there is a self._adapter.close() line in dal.py (line 
8056)  so I may need to add something to the TeradataAdapter to make this 
more robust.
 
Does that sound right ?  Thanks.
 

 

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] odbc error question, when running scheduler_test app.

2013-10-14 Thread Andrew W
Hello,
I've hit an odbc error using the Scheduler_Test app against an experimental 
instance on Teradata.

When I turn on the scheduler monitoring I sometimes get:

Error: ('HY000', '[HY000] [Teradata][ODBC Teradata Driver] Beyond 
SQL_ACTIVE_STATEMENTS limit')

I've improved things a bit by setting a pool_size and increasing the scheduler 
poll interval but it still occurs.   I think the time to complete a login on 
Teradata (on my system anyway) may contribute - perhaps the next poll cycle 
comes up while the last one is still running.

I've found that it has to do with the hstmt limit being reached in the odbc 
driver.  Not really sure what that means.

*This isn't necessarily a web2py, scheduler, or pyodbc error, but maybe one of 
controlling the odbc activity to within limits.  Has anyone seen this before 
and been able to manage it ?It may be a limitation in the Teradata odbc driver 
that may limit its effectiveness for high concurrency web apps.*

*Thanks*

*Andrew W*

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Scheduler question

2013-10-02 Thread Andrew W
Hi Niphlod,
If I could add to the questions (I'm having some success with the scheduler 
but there's a few gaps in my understanding):
What process removes the rows from the scheduler_worker table ?  
Does it make any difference to Kill a worker by updating it's status or by 
just Ctl-C (Or closing the window in Windows) to stop the task ?
 
I have one worker row with a status of KILL.  The scheduler worker process 
has stopped correctly.   Does there need to be at least one active worker 
to clean up this table ?  Will this row be removed when I restart a worker 
instance?
 
What happens when I have several Assigned Tasks, but the worker to which 
they are assigned is Killed ?  Will they be reassigned automatically ?  
 
Does KILLing a worker terminate the task that the worker is running as well 
as the specific worker instance ?  I expect so but to be clear there are 
two things running - the worker instance, and the specific task that the 
worker has initiated.   Some of the wording talks about the worker task, 
but is that referring to both or just one of these two processes ?
 
Probably just a general web2py question, but I have a menu item that calls 
a controller which runs " scheduler.queue_task(" .  Unfortunately I get 
two rows inserted into scheduler_task and i can't work out why.  The 
controller appears to be called twice.  
 
Thanks

On Thursday, October 3, 2013 12:13:50 AM UTC+10, Niphlod wrote:

>
>
> Il giorno mercoledì 2 ottobre 2013 15:15:16 UTC+2, Marin Pranjić ha 
> scritto: 
>>
>> Hi,
>>
>> I have a task queue that runs in the background. I want to switch to 
>> scheduler because I need more workers.
>> Queued tasks are long running (video transcoding, 10-20 minutes each).
>>
>> 1. If I terminate (Ctrl+C) scheduler process, scheduler_run record is 
>> STOPPED and scheduler_task record is back to QUEUED status. That's cool.
>> What happens if there is a system failure or power supply loss? Is the 
>> record stuck at RUNNING or is there a mechanism that 'fixes' invalid state 
>> once scheduler is up again?
>> This is likely to happen multiple times.
>>
>
> How do you handle it is up to you. schedule a task that inspects what has 
> been done by your task, eventually prune temporary files, reschedule the 
> task, do whatever you need. There's no limits in configuration because 
> anyone needs different type of tasks ("retry blindly" vs "stop and warn me" 
> approaches are very different and scheduler doesn't pose a limit on those). 
> However in that particular case (assuming your using a TIMEOUT, which you 
> definitely **should**) tasks in RUNNING will be marked as TIMEOUT.
>  
>
>>
>> 2. Is there a way of stopping a task without terminating a worker?
>>
>>
> Nope, but it's not that hard to schedule the os to restart a worker if 
> it's killed, and it's a task better handled separately (attached processes, 
> zombie resources, etc). 
> If you follow the deployment config with upstart as soon as it's killed it 
> restarts automatically.
>  
>

-- 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: feeding python string object to d3.js csv

2013-06-26 Thread Andrew W
Not sure if its faster, but you'll write less js code if you use json, and it 
makes sense to use the controller to deliver the data in the expected format 
that is directly usable.  Less js coding works for me!

Margaret, as Anthony suggests, try the json approach.  I can post an example 
when I'm next at my computer.

By the way, Im working on a visualisation of the gluon library, once I figure 
out how to extract the module / class hierarchy as a json URL.   Mike uses a 
software package for many of his examples  ( 
http://bl.ocks.org/mbostock/4063550 )

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: feeding python string object to d3.js csv

2013-06-25 Thread Andrew W
Suggest you look at the book section "rendering a dictionary",  I use the json 
approach with d3, and then reference the URL in the js script.  Works great and 
should work for csv too.  This approach allows you to get the file formatted in 
the way d3 expects it, without trying to do it in js code.

I'm still working out the best approach of embedding the d3 js code in an app,  
controller (perhaps a hybrid of https://github.com/mikedewar/d3py), in the view 
or a separate js file. ?



-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Issues with rendering wiki in html.

2013-05-22 Thread Andrew W
Did you perhaps create your pages first (with markmin) and then add the 
render=HTML after?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: EmberJS is the web2py of the client! :)

2013-04-03 Thread Andrew W
Would you use ember with web2py? Why?
Is having two mvc frameworks at the same time too many?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: looking for volunteers to help proof-read book 5th ed.

2013-01-25 Thread Andrew W
I won't get it done before Saturday, but here's one:
replace the first "http://code.google.com/p/instant-press/";
with
"https://github.com/rochacbruno/Movuca";


On Tuesday, January 22, 2013 1:29:25 AM UTC+13, dhmorgan wrote:
>
> Signed, I hope! 
>
> I just downloaded diff and am looking forward to the task. 
>

-- 





Re: [web2py] Re: auth.wiki menu

2013-01-16 Thread Andrew W
I just tried something like this:

if request.function != 'wiki':
   response.menu += Wiki(auth).menu(controller="default", function="wiki")



On Wednesday, January 16, 2013 10:07:06 PM UTC+13, Paolo valleri wrote:
>
> Hi Alan, thank for the tip :-), it seems to work correctly.
> The only issue is that when I call the function 'wiki' I get two menu, one 
> from the ad-hoc import, the other one from the common wiki. 
> What shoud be nice is to explicitly tell auth.wiki when it has to populate 
> the response.menu and when not.  
> Paolo
>
>
> 2013/1/15 Alan Etkin >
>
>> > Now I want to have response.menu populated with the wiki pages too  in 
>> every page I have, is there a way to populate it calling
>> > somehow auth.wiki or I have to do that by hand, updating each time 
>> menu.py? 
>>
>> If you put this on top of the controller (or model), you get the wiki menu
>>
>> from gluon.tools import Wiki
>> response.menu += Wiki(auth).menu(controller="default", function="wiki")
>>
>> The controller and / or function is required since otherwise, the wiki 
>> object cannot resolve redirection to edit/search/etc., and that address 
>> should be an action that calls auth.wiki(). And also you must check the 
>> action name to avoid duplicating the sub-menu
>>
>> What about an extra set of keyword arguments to activate the menu?:
>>
>> auth.wiki(resolve=False, menu=True, controller=..., function=)
>>
>>
>>  -- 
>>  
>>  
>>  
>>
>
>
>
> -- 
>  Paolo 
>

-- 





[web2py] Re: wiki now partially documented

2013-01-14 Thread Andrew W
Thanks
default/index.
The main page has a lot of tags like {{=auth.wiki('whatwedo')}} so that 
each subsection can be edited through the [Wiki] menu.  The rest are 
straight one wiki page for each url.  (except for Contact where I use a 
component.  I would probably rejig the front page at some point.  Not from 
an appearance perspective, but after finishing it I realised there are 
probably smarter ways to do it( but it works).

I'm writing up a User's Guide for how to edit the site (for friend's of 
mine) which I'd be happy to share.   They don't use a computer very much.






On Monday, January 14, 2013 11:23:12 PM UTC+13, Alan Etkin wrote:
>
> performancecomposites.co.nz
>>
>
> I like the site, but, where's the auth.wiki feature used (in which action)?
>

-- 





[web2py] Re: wiki now partially documented

2013-01-12 Thread Andrew W
Great work.

And if you want to see a deployed auth.wiki, go to:

performancecomposites.co.nz

There are still some routes.py and IE things to sort out, but it's working. 
  Any one in need of a wheel for their racing yacht ?





On Sunday, January 13, 2013 4:45:11 AM UTC+13, wwwgong wrote:
>
> Thanks for auth.wiki doc

-- 





[web2py] Re: I don't get routes.py

2013-01-11 Thread Andrew W
I'm looking at this snippet from routes.example.py:

routes_app = ((r'/(?Pwelcome|admin|app)\b.*', r'\g'),
  (r'(.*)', r'myapp'),
  (r'/?(.*)', r'myapp'))

I'm not very good at re syntax, but I assume  is part of the re 
expression and I don't change it, but I would change app to be the name of 
my "otherapp", and I would change myapp to be "myotherapp".

This is what I have  (I only have one app: init)  I think I may be doubling 
up between line 1 and the others.

routes_app = ((r'/(?Padmin|init)\b.*', r'\g'),
  (r'(.*)', r'init'),
  (r'/?(.*)', r'init'))

Do I need to put something in:
BASE = ''  # optonal prefix for incoming URLs
such as the domain name ?

If I fill in routes_app, do I then need to have a separate routes.py for 
each of the applications in their respective application folder ?

Thanks

Andrew W


>>>>>

-- 





[web2py] Re: request for fcgi users

2013-01-11 Thread Andrew W
I've tried touching and renaming the fcgi file but I can't see any changes.
Either it hasn't picked up the changes, or I've done it wrong.   Any way of 
knowing if routes.py has kicked in ?
 
P.S.  I'm running shared on HostGator, with no admin (ssl) access.  
 
Will killing all the fcgi running processes help ?

On Sunday, October 24, 2010 2:48:42 AM UTC+13, cjrh wrote:

> On Oct 22, 11:49 pm, Jonathan Lundell  wrote: 
> > Just a reminder: a change to routes.py won't be noticed until you 
> restart web2py (or explicitly do a reload). 
>
> Yes, I touch the web2py.fcgi file so that Apache restarts the 
> process.  So I assume that the web2py process was restarted.   I'd 
> need to add logging and such to make sure tho.

-- 





[web2py] Re: I don't get routes.py

2013-01-10 Thread Andrew W
Don't bother, I should have looked in routes_example.py too. Thanks.


On Friday, January 11, 2013 4:13:39 PM UTC+13, Andrew W wrote:
>
> One more question if I may (I still don't get it):
>
> I am also replacing an existing website with a new web2py site.  I've 
> found links on other websites that still need to work with the new website.
>
> If someone clicks on an old link such as "mydomain.com/aboutus.html",   I 
> would like it to redirect and find my new page at (with full url)  "
> mydomain.com/init/default/index/aboutus.
>
> It is not obvious (to me) after looking at router_example.py and the 
> book.   Do I need to use the pattern based approach for this ?
>
> thanks
>
> Andrew W
>
>
>
>
>
>
>
> On Friday, January 11, 2013 11:29:25 AM UTC+13, Andrew W wrote:
>>
>> Yes, I think you're correct.   I must have glossed over this in my book 
>> searching.
>> Thanks.
>>
>> On Friday, January 11, 2013 10:56:01 AM UTC+13, Anthony wrote:
>>>
>>> I don't think anything regarding URL rewrite was removed from the book, 
>>> though the parameter-based system in particular has never been thoroughly 
>>> documented there. Instead, the penultimate line of this 
>>> section<http://web2py.com/books/default/chapter/29/04#Parameter-based-system>simply
>>>  refers you to the additional documentation within the 
>>> router.example.py file itself.
>>>
>>> Anthony
>>>
>>> On Thursday, January 10, 2013 2:04:31 PM UTC-5, Andrew W wrote:
>>>>
>>>> Hi all,
>>>>
>>>> Did we prune some content out of the book on this ?  I'm sure there was 
>>>> more before.  
>>>>
>>>> This is a line out of the Services chapter, talking about exactly what 
>>>> I need to know:
>>>> "yet this is a matter of test and we have already discussed it at 
>>>> length in chapter 4."
>>>>
>>>> But we haven't discussed it in Chapter 4.  It's been removed !?
>>>>
>>>> Anyway, for my auth.wiki app, I don't want people to see this:
>>>> http://www.myweb2pywebsite.com/init/default/index/my_wiki_page
>>>>
>>>> I want them to see:
>>>> http://www.myweb2pywebsite.com/my_wiki_page,   or maybe with the index 
>>>> in there too.
>>>>
>>>> How do I do it ?
>>>>
>>>> P.S.  If we mention Chapter numbers in the book, should we also include 
>>>> them on the chapter index ?
>>>>
>>>> Thanks
>>>> Andrew W
>>>>
>>>>

-- 





[web2py] Re: I don't get routes.py

2013-01-10 Thread Andrew W
One more question if I may (I still don't get it):

I am also replacing an existing website with a new web2py site.  I've found 
links on other websites that still need to work with the new website.

If someone clicks on an old link such as "mydomain.com/aboutus.html",   I 
would like it to redirect and find my new page at (with full url)  
"mydomain.com/init/default/index/aboutus.

It is not obvious (to me) after looking at router_example.py and the 
book.   Do I need to use the pattern based approach for this ?

thanks

Andrew W







On Friday, January 11, 2013 11:29:25 AM UTC+13, Andrew W wrote:
>
> Yes, I think you're correct.   I must have glossed over this in my book 
> searching.
> Thanks.
>
> On Friday, January 11, 2013 10:56:01 AM UTC+13, Anthony wrote:
>>
>> I don't think anything regarding URL rewrite was removed from the book, 
>> though the parameter-based system in particular has never been thoroughly 
>> documented there. Instead, the penultimate line of this 
>> section<http://web2py.com/books/default/chapter/29/04#Parameter-based-system>simply
>>  refers you to the additional documentation within the 
>> router.example.py file itself.
>>
>> Anthony
>>
>> On Thursday, January 10, 2013 2:04:31 PM UTC-5, Andrew W wrote:
>>>
>>> Hi all,
>>>
>>> Did we prune some content out of the book on this ?  I'm sure there was 
>>> more before.  
>>>
>>> This is a line out of the Services chapter, talking about exactly what I 
>>> need to know:
>>> "yet this is a matter of test and we have already discussed it at length 
>>> in chapter 4."
>>>
>>> But we haven't discussed it in Chapter 4.  It's been removed !?
>>>
>>> Anyway, for my auth.wiki app, I don't want people to see this:
>>> http://www.myweb2pywebsite.com/init/default/index/my_wiki_page
>>>
>>> I want them to see:
>>> http://www.myweb2pywebsite.com/my_wiki_page,   or maybe with the index 
>>> in there too.
>>>
>>> How do I do it ?
>>>
>>> P.S.  If we mention Chapter numbers in the book, should we also include 
>>> them on the chapter index ?
>>>
>>> Thanks
>>> Andrew W
>>>
>>>

-- 





Re: [web2py] Re: File generation using web2py

2013-01-10 Thread Andrew W
Hello Brian,

Thanks very much for sharing your script.  It works a treat and saved me a 
lot of time and confusion.

Andrew 

On Wednesday, May 2, 2012 11:18:25 PM UTC+12, RAHUL PRIYADARSI wrote:
>
> Dear Mr.Brian,
> Thank you very much for you reply.
> " If you're worried about text alignment and other layout stuff, why not 
> just use HTML templates"
>
> Well because I wish to get prints from them using dot matrix printer, 
> which prints only txt files!
> But any way your response did help me very much.
>
> With Regards,
> rahulserver.
>
> On 1 May 2012 02:30, Brian M > wrote:
>
>> Yep, it is the web, you can't automatically write a file directly to the 
>> user's computer (Holy security issues Batman!) but you can provide them the 
>> prepared file as a download that they can then save to wherever they want. 
>> Doesn't matter if it is CSV or TXT or HTML or PDF or RTF whatever. 
>> Definitely note that reponse.header content-type and content-disposition 
>> portion of my sample code above, that is what will help you cause the 
>> user's browser to download the file with the correct name.  There is some 
>> StringIO stuff in there too which Khalil mentioned and you'd definitely 
>> want for generating the files.
>>
>> As far as the formatting of strings you bet python & web2py can do it. If 
>> you're worried about text alignment and other layout stuff, why not just 
>> use HTML templates, that's what web2py is for. If you look around on this 
>> list there is also some stuff on generating PDF reports - I think there is 
>> a markmin to PDF converter available too.   I believe that pyrtf is also in 
>> web2py's contrib so you could use that to do Rich Text Format files.  
>> Plenty of options out there for you.
>>
>>
>> On Monday, April 30, 2012 2:54:28 AM UTC-5, Khalil KHAMLICHI wrote:
>>
>>> Raul, when working with the web you always (most of the times) create 
>>> the files server side and invite user to download it and save it to his 
>>> file system, this sais you don't need to access the file system yourself, 
>>> just invite the user to download your file and you are done.
>>> for csv versus txt files, they are both the same thing IF the user is 
>>> not going to import them into some other software that needs only csv 
>>> content,
>>> python has a module called StringIO, you can use it as a file and write 
>>> to it mixed content : simple text and csv data.
>>>
>>> On Mon, Apr 30, 2012 at 6:03 AM, RAHUL PRIYADARSI <> wrote:
>>>
  Dear All,
 Thanks for your answers.But what I was looking for was,putting into 
 simple words,implementing a use case similar to the following "The system 
 maintains the data related to each transaction.Each transaction includes 
 the list of items demanded per transaction with each item belonging to a 
 category.The system also generates an aggregated report per transaction as 
 well as an overall report of the total items belonging to each category 
 demanded.".Now "the report" here need not be in csv only.It may be txt 
 file.Since I am not sure as to whether is it possible to print formatted 
 strings(e.g. the string "report" printed right aligned in a total field of 
 15 characters,something likd printf(%15s)) in web2py,my question is that 
 how we do file IO in web2py. Can we generate a txt file in web2py. And can 
 we print formatted strings to it? 
 Since the controller runs on server and my application would be 
 deployed in an intranet lan and it needs to generate files to be used in 
 local file system of the system on which the user will access the app , 
 where must this file IO code be written, in controller or view.
  

 On 30 April 2012 07:35, Brian M <> wrote:

> Yep, I've got a processing app that spits out all sorts of csv files 
> based on data gathered from multiple sources.
>
> Here's a little helper function I use
>
> def csv_export(records, column_names, fields, mode = 'dal'):
> """Export DAL result set, list of dicts or list of lists to CSV 
> stream for returning to user
> Arguments:
> records = the data to be returned
> column_names (list)= the column names/headings for the first row 
> in the CSV file
> Example ['First Name', 'Last Name', 'Email']
> fields (list) = the names of the fields (as they appear in 
> records) in the order they
> should be in the CSV. Example ['f_name', 'l_name', 
> 'email']
> or ['table_a.f_name', 'table_a.l_name', 
> 'table_b.email']
> If mode = 'list' and your records are in the 
> correct order then fields may be None
> otherwise use [1,3,0] if you list is in a 
> different order
> mode (string) = what type of data is in records? 'dal' (Default), 
> 'dict' or 'list'
> 'dal' if records

[web2py] Re: I don't get routes.py

2013-01-10 Thread Andrew W
Yes, I think you're correct.   I must have glossed over this in my book 
searching.
Thanks.

On Friday, January 11, 2013 10:56:01 AM UTC+13, Anthony wrote:
>
> I don't think anything regarding URL rewrite was removed from the book, 
> though the parameter-based system in particular has never been thoroughly 
> documented there. Instead, the penultimate line of this 
> section<http://web2py.com/books/default/chapter/29/04#Parameter-based-system>simply
>  refers you to the additional documentation within the 
> router.example.py file itself.
>
> Anthony
>
> On Thursday, January 10, 2013 2:04:31 PM UTC-5, Andrew W wrote:
>>
>> Hi all,
>>
>> Did we prune some content out of the book on this ?  I'm sure there was 
>> more before.  
>>
>> This is a line out of the Services chapter, talking about exactly what I 
>> need to know:
>> "yet this is a matter of test and we have already discussed it at length 
>> in chapter 4."
>>
>> But we haven't discussed it in Chapter 4.  It's been removed !?
>>
>> Anyway, for my auth.wiki app, I don't want people to see this:
>> http://www.myweb2pywebsite.com/init/default/index/my_wiki_page
>>
>> I want them to see:
>> http://www.myweb2pywebsite.com/my_wiki_page,   or maybe with the index 
>> in there too.
>>
>> How do I do it ?
>>
>> P.S.  If we mention Chapter numbers in the book, should we also include 
>> them on the chapter index ?
>>
>> Thanks
>> Andrew W
>>
>>

-- 





Re: [web2py] I don't get routes.py

2013-01-10 Thread Andrew W
Thankyou very much !

On Friday, January 11, 2013 8:18:11 AM UTC+13, Jonathan Lundell wrote:
>
> On 10 Jan 2013, at 11:04 AM, Andrew W > 
> wrote: 
> > Anyway, for my auth.wiki app, I don't want people to see this: 
> > http://www.myweb2pywebsite.com/init/default/index/my_wiki_page 
> > 
> > I want them to see: 
> > http://www.myweb2pywebsite.com/my_wiki_page,   or maybe with the index 
> in there too. 
> > 
> > How do I do it ? 
> > 
>
> Use the parametric router, specifying init and default as the default 
> application and controller respectively (which they are by default, but it 
> doesn't hurt to say so). That will give you what you want, but with index 
> showing (note that you could change your default function to 'wiki' instead 
> of 'index', which might be prettier. 
>
> If you want to get rid of 'index', you need to supply a list of all 
> functions in your default controller (functions=). 
>
> In addition to the book, have a look at the comments at the head of 
> router.example.py. 
>
> You might end up with something like this: 
>
> routers = dict( 
>
> # base router 
> BASE=dict( 
> default_application='init', 
> ), 
>
> init=dict( 
> default_controller='default', 
> default_function='wiki', 
> functions=['index', 'wiki', 'user', ...], 
> ), 
> ) 
>
>
> You might be tempted to name both your application and your default 
> function 'wiki'. Don't do that; the ambiguity will prevent the router from 
> making some omissions you might otherwise prefer to have.

-- 





[web2py] I don't get routes.py

2013-01-10 Thread Andrew W
Hi all,

Did we prune some content out of the book on this ?  I'm sure there was 
more before.  

This is a line out of the Services chapter, talking about exactly what I 
need to know:
"yet this is a matter of test and we have already discussed it at length in 
chapter 4."

But we haven't discussed it in Chapter 4.  It's been removed !?

Anyway, for my auth.wiki app, I don't want people to see this:
http://www.myweb2pywebsite.com/init/default/index/my_wiki_page

I want them to see:
http://www.myweb2pywebsite.com/my_wiki_page,   or maybe with the index in 
there too.

How do I do it ?

P.S.  If we mention Chapter numbers in the book, should we also include 
them on the chapter index ?

Thanks
Andrew W

-- 





[web2py] Re: auth.wiki deployment issue

2013-01-09 Thread Andrew W
and again:
I edited each page and submitted.   All OK.Just a little bit of a pain. 
 It is only a one off task, but would a Submit All button be appropriate on 
the Manage Pages page ?



On Thursday, January 10, 2013 8:42:34 AM UTC+13, Andrew W wrote:
>
> I'll answer my own questions :) :
> It's because the wiki page saves the body (user entered content) and the 
> generated html separately.  The html has not been regenerated.
>
> How do I get it to regenerate all of the pages after deployment in the new 
> environment ?
>
> Thanks
>
> Andrew W
>
>
> On Thursday, January 10, 2013 8:32:58 AM UTC+13, Andrew W wrote:
>>
>> Another Big Issue that I only just found after stopping my local rocket 
>> server:
>> None of the Page Images are displaying.  They are obviously looking for 
>> the localhost reference, which was looking great when I was also running 
>> locally.
>>
>> Looking at the html I see the following in the menu  (Looks OK)
>> > data-toggle="dropdown">About Us
>>
>> But my wiki images look like:
>> http://127.0.0.1:8000/PerformanceComposites/default/index/6/carbonweave.jpg"; 
>> alt="Carbon Weave" style="float:right">
>>
>> And a link looks like:
>> http://127.0.0.1:8000/PerformanceComposites/default/index/project1";>Current 
>> Projects
>>
>>
>>
>>
>> On Thursday, January 10, 2013 8:19:23 AM UTC+13, Andrew W wrote:
>>>
>>> Hi,
>>> I need some help please.  I've just deployed my first auth.wiki app.   
>>> I'll let you know what it is once it's working properly.
>>>
>>> I've deployed to HostGator using web2py 2.3.2  (and the posts in this 
>>> forum on the subject were very helpful).
>>> Using render='markmin'
>>>
>>> Everything was looking good on my local machine.  But I have two issues:
>>> 1) The problem is that all of my page links point back to 127.0.0.1.  
>>> Something like @products on the menu works fine, but as a link on 
>>> the page it looks for 127.0.0.1.
>>>
>>> and 2) I have @{component:default/contact_details.load} on one page, 
>>> which works fine locally, but I get an invalid request on the deployed app.
>>> I've cleaned the app before deploying, removed any .pyc files, and 
>>> checked that I haven't hardcoded anything.
>>> I did change the app folder name to init on the deployed server (wonder 
>>> if that has anything to do with it).
>>>
>>> Thanks
>>>
>>>

-- 





[web2py] Re: auth.wiki deployment issue

2013-01-09 Thread Andrew W
I'll answer my own questions :) :
It's because the wiki page saves the body (user entered content) and the 
generated html separately.  The html has not been regenerated.

How do I get it to regenerate all of the pages after deployment in the new 
environment ?

Thanks

Andrew W


On Thursday, January 10, 2013 8:32:58 AM UTC+13, Andrew W wrote:
>
> Another Big Issue that I only just found after stopping my local rocket 
> server:
> None of the Page Images are displaying.  They are obviously looking for 
> the localhost reference, which was looking great when I was also running 
> locally.
>
> Looking at the html I see the following in the menu  (Looks OK)
>  data-toggle="dropdown">About Us
>
> But my wiki images look like:
> http://127.0.0.1:8000/PerformanceComposites/default/index/6/carbonweave.jpg"; 
> alt="Carbon Weave" style="float:right">
>
> And a link looks like:
> http://127.0.0.1:8000/PerformanceComposites/default/index/project1";>Current 
> Projects
>
>
>
>
> On Thursday, January 10, 2013 8:19:23 AM UTC+13, Andrew W wrote:
>>
>> Hi,
>> I need some help please.  I've just deployed my first auth.wiki app.   
>> I'll let you know what it is once it's working properly.
>>
>> I've deployed to HostGator using web2py 2.3.2  (and the posts in this 
>> forum on the subject were very helpful).
>> Using render='markmin'
>>
>> Everything was looking good on my local machine.  But I have two issues:
>> 1) The problem is that all of my page links point back to 127.0.0.1.  
>> Something like @products on the menu works fine, but as a link on the 
>> page it looks for 127.0.0.1.
>>
>> and 2) I have @{component:default/contact_details.load} on one page, 
>> which works fine locally, but I get an invalid request on the deployed app.
>> I've cleaned the app before deploying, removed any .pyc files, and 
>> checked that I haven't hardcoded anything.
>> I did change the app folder name to init on the deployed server (wonder 
>> if that has anything to do with it).
>>
>> Thanks
>>
>>

-- 





[web2py] Re: auth.wiki deployment issue

2013-01-09 Thread Andrew W
Another Big Issue that I only just found after stopping my local rocket 
server:
None of the Page Images are displaying.  They are obviously looking for the 
localhost reference, which was looking great when I was also running 
locally.

Looking at the html I see the following in the menu  (Looks OK)
About Us

But my wiki images look like:
http://127.0.0.1:8000/PerformanceComposites/default/index/6/carbonweave.jpg";
 
alt="Carbon Weave" style="float:right">

And a link looks like:
http://127.0.0.1:8000/PerformanceComposites/default/index/project1";>Current
 
Projects




On Thursday, January 10, 2013 8:19:23 AM UTC+13, Andrew W wrote:
>
> Hi,
> I need some help please.  I've just deployed my first auth.wiki app.   
> I'll let you know what it is once it's working properly.
>
> I've deployed to HostGator using web2py 2.3.2  (and the posts in this 
> forum on the subject were very helpful).
> Using render='markmin'
>
> Everything was looking good on my local machine.  But I have two issues:
> 1) The problem is that all of my page links point back to 127.0.0.1.  
> Something like @products on the menu works fine, but as a link on the 
> page it looks for 127.0.0.1.
>
> and 2) I have @{component:default/contact_details.load} on one page, which 
> works fine locally, but I get an invalid request on the deployed app.
> I've cleaned the app before deploying, removed any .pyc files, and checked 
> that I haven't hardcoded anything.
> I did change the app folder name to init on the deployed server (wonder if 
> that has anything to do with it).
>
> Thanks
>
>

-- 





[web2py] auth.wiki deployment issue

2013-01-09 Thread Andrew W
Hi,
I need some help please.  I've just deployed my first auth.wiki app.   I'll 
let you know what it is once it's working properly.

I've deployed to HostGator using web2py 2.3.2  (and the posts in this forum 
on the subject were very helpful).
Using render='markmin'

Everything was looking good on my local machine.  But I have two issues:
1) The problem is that all of my page links point back to 127.0.0.1.  
Something like @products on the menu works fine, but as a link on the 
page it looks for 127.0.0.1.

and 2) I have @{component:default/contact_details.load} on one page, which 
works fine locally, but I get an invalid request on the deployed app.
I've cleaned the app before deploying, removed any .pyc files, and checked 
that I haven't hardcoded anything.
I did change the app folder name to init on the deployed server (wonder if 
that has anything to do with it).

Thanks

-- 





[web2py] Re: anyone tried jQuery svg?

2013-01-07 Thread Andrew W
I haven't either, but I'd recommend a look at d3js.org, if you want to use 
svg.

I've done something similar to this one, using a web2py generated json data 
feed - data driven layout !

http://mbostock.github.com/d3/talk/2016/bundle.html





On Monday, January 7, 2013 7:29:10 AM UTC+13, villas wrote:
>
> Look at what he does here:
>
> http://keith-wood.name/svgBasics.html
>
> See the drawInitial function.
> You need to load it, put it into a document.ready function or something.
>
>
> On Sunday, January 6, 2013 2:14:13 PM UTC, jonas wrote:
>>
>> Hi. 
>>
>> Has anyone here tried the jQuery svg lib http://keith-wood.name/svg.html
>> ? 
>>
>> I tried to use it in web2py but with no success. 
>>
>> the necessary lib was imported: > src="{{=URL('static','js/jquery/jquery.svg.js')}}">
>> but is seems that the svg function is not present :
>>
>> svg should be here
>>
>> 
>>
>> $('.test').svg();
>>
>> var svg=$('.test').svg('get'); 
>> svg.circle(130, 75, 50, {fill: 'none', stroke: 'red', strokeWidth: 3});
>>
>> 
>>
>> the above snippet doesn't work. anyone tried this? 
>>
>>

-- 





[web2py] Re: auth.wiki menugroups not working

2013-01-02 Thread Andrew W
Trunk.
However, just figured it out.
>From an earlier post, I added the following to models so that the wiki 
tables were displayed in the Database Administration;
auth.wiki(resolve=False)

In my controller I added return auth.wiki(render='markmin', menugroups = 
['wiki-editor','wiki-author']).

The models statement creates the auth.wiki, but menugroups was not defined 
at that time, which is why I still see the Wiki menu.

I've added menugroups to the models auth.wiki call,  and it all works now ! 
 (or remove the auth.wiki call from models).

Thanks
Andrew W


return auth.wiki(render='markmin', menugroups = ['wiki_editor'])

On Tuesday, January 1, 2013 9:33:21 AM UTC+13, Massimo Di Pierro wrote:
>
> Which web2py version?
>
> On Monday, 31 December 2012 13:02:57 UTC-6, Andrew W wrote:
>>
>> I have this in my controller function
>>
>> return auth.wiki(render='markmin', menugroups = 
>> ['wiki-editor','wiki-author']) 
>>
>> but [Wiki] still appears in the menu when not logged in.
>>
>>
>>
>>

-- 





[web2py] auth.wiki menugroups not working

2012-12-31 Thread Andrew W
I have this in my controller function

return auth.wiki(render='markmin', menugroups = 
['wiki-editor','wiki-author']) 

but [Wiki] still appears in the menu when not logged in.



-- 





[web2py] Re: Help with book proofreading

2012-12-31 Thread Andrew W
OK.  "Corrections in place" - just update the diff log directly ?


On Tuesday, January 1, 2013 6:36:26 AM UTC+13, Massimo Di Pierro wrote:
>
> This file:
>
> https://dl.dropbox.com/u/18065445/Tmp/diff2.log
>
> contains the lines added or edited in the book so far. If some of you can 
> help proof-read these changes and send corrections in place it would save 
> lots of time vs reading the entire book.
>
> Massimo
>

-- 





Re: [web2py] Re: Auth.wiki() classes in tags

2012-12-29 Thread Andrew W
Thanks.  That worked, although the speck one doesn't.
Worth adding to the book I think.


On Sunday, December 30, 2012 5:38:06 AM UTC+13, Massimo Di Pierro wrote:
>
> def index(): return auth.wiki(render='html')
>
> in index.html
>
> {{extend 'layout'}}
> http://js.nicedit.com/nicEdit-latest.js"</a>; 
> type="text/javascript">
>  type="text/javascript">jQuery(function(){bkLib.onDomLoaded(nicEditors.allTextAreas);});
>  
> {{=content}}
>
>
> On Saturday, 29 December 2012 01:35:34 UTC-6, Andrew W wrote:
>>
>> "you just attach it to the textarea...":
>>
>> I don't quite follow.  Can you expand please, do I add the  code 
>> to layout.html, do I need to actually download the plugin as the src points 
>> to the website ?
>> This could be worth adding to the book as anyone using render='html' 
>> would want to add an editor.
>>
>> Thanks
>>
>>
>> On Sunday, December 16, 2012 8:32:23 AM UTC+13, Massimo Di Pierro wrote:
>>>
>>> In default MAKRMIN mode you can create blocks with classes with
>>>
>>> ``hello``:classname
>>>
>>> (standard markmin class)
>>>
>>> To switch from markmin to HTML you do:
>>>
>>>auth.wiki(render='html')
>>>
>>> (assuming you don't have data already in db)
>>>
>>> Then if you have a wysiwyg plugin you just attach it to the textarea. 
>>> For example assuming <a  rel="nofollow" href="http://speckedit.com/demo">http://speckedit.com/demo</a> this is done with:
>>>
>>> <script 
>>> src="<a  rel="nofollow" href="http://speckedit.com/_library/2008/10/speck.js">http://speckedit.com/_library/2008/10/speck.js</a>;<<a  rel="nofollow" href="http://speckedit.com/_library/2008/10/speck.js">http://speckedit.com/_library/2008/10/speck.js</a>>"
>>>  
>>> type="text/javascript">http://speckedit.com/_library/2008/10/speck.css;<http://speckedit.com/_library/2008/10/speck.css>"
>>>  
>>> rel="stylesheet" type="text/css" />speckInit();
>>>
>>> That should be all.
>>>
>>> On Saturday, 15 December 2012 11:26:23 UTC-6, Andrew W wrote:
>>>>
>>>>
>>>> On developers forum,  Massimo mentioned:
>>>>
>>>> > auth.wiki() supports html tags (float divs, tables, image uploading, 
>>>> etc.)? 
>>>>
>>>> "yes. "
>>>>
>>>> How do I enter a generic tag like a div with a class?
>>>>
>>>> Also,
>>>> "Notice that auth.wiki() can use wysiwyg if you simply set it up that 
>>>> way and including an appropriate js editor. "
>>>> How ?
>>>>
>>>>

-- 





Re: [web2py] Re: Auth.wiki() classes in tags

2012-12-28 Thread Andrew W
P.S.  I'm talking about using it with auth.wiki

On Saturday, December 29, 2012 8:35:34 PM UTC+13, Andrew W wrote:
>
> "you just attach it to the textarea...":
>
> I don't quite follow.  Can you expand please, do I add the  code 
> to layout.html, do I need to actually download the plugin as the src points 
> to the website ?
> This could be worth adding to the book as anyone using render='html' would 
> want to add an editor.
>
> Thanks
>
>
> On Sunday, December 16, 2012 8:32:23 AM UTC+13, Massimo Di Pierro wrote:
>>
>> In default MAKRMIN mode you can create blocks with classes with
>>
>> ``hello``:classname
>>
>> (standard markmin class)
>>
>> To switch from markmin to HTML you do:
>>
>>auth.wiki(render='html')
>>
>> (assuming you don't have data already in db)
>>
>> Then if you have a wysiwyg plugin you just attach it to the textarea. For 
>> example assuming <a  rel="nofollow" href="http://speckedit.com/demo">http://speckedit.com/demo</a> this is done with:
>>
>> <script 
>> src="<a  rel="nofollow" href="http://speckedit.com/_library/2008/10/speck.js">http://speckedit.com/_library/2008/10/speck.js</a>;<<a  rel="nofollow" href="http://speckedit.com/_library/2008/10/speck.js">http://speckedit.com/_library/2008/10/speck.js</a>>"
>>  
>> type="text/javascript">http://speckedit.com/_library/2008/10/speck.css;<http://speckedit.com/_library/2008/10/speck.css>"
>>  
>> rel="stylesheet" type="text/css" />speckInit();
>>
>> That should be all.
>>
>> On Saturday, 15 December 2012 11:26:23 UTC-6, Andrew W wrote:
>>>
>>>
>>> On developers forum,  Massimo mentioned:
>>>
>>> > auth.wiki() supports html tags (float divs, tables, image uploading, 
>>> etc.)? 
>>>
>>> "yes. "
>>>
>>> How do I enter a generic tag like a div with a class?
>>>
>>> Also,
>>> "Notice that auth.wiki() can use wysiwyg if you simply set it up that 
>>> way and including an appropriate js editor. "
>>> How ?
>>>
>>>

-- 





Re: [web2py] Re: Auth.wiki() classes in tags

2012-12-28 Thread Andrew W
"you just attach it to the textarea...":

I don't quite follow.  Can you expand please, do I add the  code to 
layout.html, do I need to actually download the plugin as the src points to 
the website ?
This could be worth adding to the book as anyone using render='html' would 
want to add an editor.

Thanks


On Sunday, December 16, 2012 8:32:23 AM UTC+13, Massimo Di Pierro wrote:
>
> In default MAKRMIN mode you can create blocks with classes with
>
> ``hello``:classname
>
> (standard markmin class)
>
> To switch from markmin to HTML you do:
>
>auth.wiki(render='html')
>
> (assuming you don't have data already in db)
>
> Then if you have a wysiwyg plugin you just attach it to the textarea. For 
> example assuming <a  rel="nofollow" href="http://speckedit.com/demo">http://speckedit.com/demo</a> this is done with:
>
> <script 
> src="<a  rel="nofollow" href="http://speckedit.com/_library/2008/10/speck.js">http://speckedit.com/_library/2008/10/speck.js</a>;<<a  rel="nofollow" href="http://speckedit.com/_library/2008/10/speck.js">http://speckedit.com/_library/2008/10/speck.js</a>>"
>  
> type="text/javascript">http://speckedit.com/_library/2008/10/speck.css;<http://speckedit.com/_library/2008/10/speck.css>"
>  
> rel="stylesheet" type="text/css" />speckInit();
>
> That should be all.
>
> On Saturday, 15 December 2012 11:26:23 UTC-6, Andrew W wrote:
>>
>>
>> On developers forum,  Massimo mentioned:
>>
>> > auth.wiki() supports html tags (float divs, tables, image uploading, 
>> etc.)? 
>>
>> "yes. "
>>
>> How do I enter a generic tag like a div with a class?
>>
>> Also,
>> "Notice that auth.wiki() can use wysiwyg if you simply set it up that way 
>> and including an appropriate js editor. "
>> How ?
>>
>>

-- 





[web2py] Re: The book updates and status

2012-12-19 Thread Andrew W
I'm happy to proof read.   Send it through when ready.

Andrew W

On Thursday, December 20, 2012 2:46:41 PM UTC+13, Anthony wrote:
>
> On Wednesday, December 19, 2012 5:56:48 PM UTC-5, Massimo Di Pierro wrote:
>
>> I have been going over that document. The things in gray were not in the 
>> published 4th edition but are in the online version. 
>>
>
> Make sure you click the link below -- it's an updated version of the 
> original document. All the gray items were removed, and some newer items 
> have been added (though some of them may already be in the book).
>
> Anthony
>
>  On Wednesday, 19 December 2012 14:15:46 UTC-6, Anthony wrote:
>
>> This document is a bit old, so some of the items may already have been 
>>> added: 
>>> https://docs.google.com/document/d/1yQy0F5HcxiecBOBLblrLmAAAsAK6sL37wSL527yssGk/edit
>>
>>

-- 





[web2py] Getting Apache 2.4 to work on Suse Linux

2012-12-19 Thread Andrew W
Hi all,

Just a note on Apache that may help others:

I've battled for days with getting web2py working with apache (2.4) on a 
Suse linux server.   I kept on getting Forbidden errors.
I eventually stumbled onto the "Require all granted" statement - once I 
added this then everything works fine.


  # I don't need the next line
  # Allow from all
  # The following line is REQUIRED (for me anyway)
  Require all granted


So,  Does the documentation need updating ?  I assume it has worked as is 
for others.  Perhaps is should be as there are obviously situations when it 
is required.
I can comment out the "Allow from all"  and it still works.  
Is this just for Apache 2.4 as opposed to version 2.2 ?


-- 





[web2py] Re: The book updates and status

2012-12-19 Thread Andrew W
The #1 thing I am waiting on is the addition of auth.wiki.

On Thursday, December 20, 2012 9:15:46 AM UTC+13, Anthony wrote:
>
> This document is a bit old, so some of the items may already have been 
> added: 
> https://docs.google.com/document/d/1yQy0F5HcxiecBOBLblrLmAAAsAK6sL37wSL527yssGk/edit
>
> Anthony
>
> On Wednesday, December 19, 2012 12:11:55 PM UTC-5, Massimo Di Pierro wrote:
>>
>> It would help me if people could add to this thread some comments about:
>> - what needs clarification?
>> - what is poorly undocumented?
>> - what do you expect in the 5th edition?
>> Please when making comments refers to the online english version.
>>
>> Massimo
>>
>> On Wednesday, 19 December 2012 03:11:37 UTC-6, Andrew W wrote:
>>>
>>> Just checking in on how the 5th edition is going ?
>>> Thanks
>>>
>>> On Thursday, November 29, 2012 11:58:29 PM UTC+13, Kostas M wrote:
>>>>
>>>> I have bought the (printed) web2py book (editions 3rd and 4th) from 
>>>> Lulu, and my note is that the black & white printouts are much less 
>>>> attractive from
>>>> the web css book layout. The coloring helps understanding the syntax as 
>>>> well. I wish the printed book could look as nice as the web version...
>>>> I once printed some chapters in a color printer to have this nice 
>>>> layout. Couldn't the Lulu book follow a better printing style?
>>>>
>>>> Kostas
>>>>
>>>> On Wednesday, November 28, 2012 7:08:48 PM UTC, Massimo Di Pierro wrote:
>>>>>
>>>>> Almost everything is documented except: 1) auth.wiki; 2) some of the 
>>>>> new grid parameters.
>>>>>
>>>>> Along with these changes I am planning some minor book refactoring 
>>>>> before publishing to 5th edition.
>>>>>
>>>>> Massimo
>>>>>
>>>>>>
>>>>>>>>

-- 





[web2py] Re: The book updates and status

2012-12-19 Thread Andrew W
Just checking in on how the 5th edition is going ?
Thanks

On Thursday, November 29, 2012 11:58:29 PM UTC+13, Kostas M wrote:
>
> I have bought the (printed) web2py book (editions 3rd and 4th) from Lulu, 
> and my note is that the black & white printouts are much less attractive 
> from
> the web css book layout. The coloring helps understanding the syntax as 
> well. I wish the printed book could look as nice as the web version...
> I once printed some chapters in a color printer to have this nice layout. 
> Couldn't the Lulu book follow a better printing style?
>
> Kostas
>
> On Wednesday, November 28, 2012 7:08:48 PM UTC, Massimo Di Pierro wrote:
>>
>> Almost everything is documented except: 1) auth.wiki; 2) some of the new 
>> grid parameters.
>>
>> Along with these changes I am planning some minor book refactoring before 
>> publishing to 5th edition.
>>
>> Massimo
>>
>>>
>

-- 





Re: [web2py] Re: RFC: web2py-based workflow engine

2012-12-19 Thread Andrew W
Does anyone know if there has been any progress on this ?
Hello Ross ?



On Tuesday, September 25, 2012 1:52:46 AM UTC+12, Ramos wrote:
>
> Same question here 
> Ross,
> How's the workflow engine going ?
>
> Cheers
> António
>
> 2012/7/6 Andrew >
>
>> Hi Ross,
>> How's the workflow engine going ?
>>
>> Regards
>> Andrew W
>>
>
>

-- 





[web2py] Re: NEWINSTALL not working

2012-12-17 Thread Andrew W
Thanks

-- 





[web2py] NEWINSTALL not working

2012-12-15 Thread Andrew W
Hi,
Trying to get an updated welcome.w2p file.  I've added a NEWINSTALL file 
(which usually works), but not today !
The last time it worked successfully was 18 Nov.

Anyone else getting this ?

-- 





Re: [web2py] Re: Auth.wiki() classes in tags

2012-12-15 Thread Andrew W

On developers forum,  Massimo mentioned:

> auth.wiki() supports html tags (float divs, tables, image uploading, etc.)? 

"yes. "

How do I enter a generic tag like a div with a class?

Also,
"Notice that auth.wiki() can use wysiwyg if you simply set it up that way and 
including an appropriate js editor. "
How ?

-- 





Re: [web2py] raspberry pi

2012-12-15 Thread Andrew W
I just bought one with the goal that its a clever "toy" that the kids to learn 
and have some fun at the same time,

-- 





Re: [web2py] Re: Auth.wiki() classes in tags

2012-12-14 Thread Andrew W
Thanks, but how do I specify the class in the wiki page?

-- 





Re: [web2py] Re: Auth.wiki() documentation

2012-12-14 Thread Andrew W
I hope to have a website up and running soon where I have done the 
following (If you have a better idea, then please let me know)

in layout.html, or in default/index.html
 {{if request.args==['index'] or request.args==[]: }}  # The Main Page
 

.other stuff


# Or Things like

  
  {{=auth.wiki('whatwedo')}}
  
  
  {{=auth.wiki('why')}}
  
  
  {{=auth.wiki('wealsodo')}}
  


   {{pass}}



On Saturday, December 15, 2012 5:00:37 AM UTC+13, Massimo Di Pierro wrote:
>
> Thanks. Can I use it for the book?
>
> On Thursday, 13 December 2012 15:15:11 UTC-6, Alan Etkin wrote:
>>
>> El jueves, 13 de diciembre de 2012 11:42:02 UTC-3, viniciusban escribió:
>>>
>>> Agree in part, Massimo. 
>>>
>>> This feature is very good. Really! 
>>>
>>>
>> I have posted a slice about auth.wiki 
>> here. 
>> It covers a couple of features not documented yet.
>>
>

-- 





Re: [web2py] Re: Auth.wiki() classes in tags

2012-12-13 Thread Andrew W
Also, with Images I can do left , right, center.
Can I do something like a css clear / clear: both ?


On Friday, December 14, 2012 6:35:11 AM UTC+13, viniciusban wrote:
>
> I need to identify images by its location. When they're inside a 
> table, it's easier because I can attach a class to the table. 
>
> I'll refine it a bit more. I just watched a talk about responsive web 
> design with some ideias I think will help me. 
>
> BTW, is there a way to type HTML tags inside my Markmin doc? 
>
>
>
> On Thu, Dec 13, 2012 at 2:47 PM, Massimo Di Pierro 
> > wrote: 
> > I agree with that and think it is a good idea. You can make the CSS 
> device 
> > dependent but that is outside the markup language scope. Perhaps I am 
> > missing something. 
> > 
> > 
> > On Thursday, 13 December 2012 08:51:35 UTC-6, viniciusban wrote: 
> >> 
> >> Yes, you're right, Massimo. 
> >> 
> >> So, let's try to solve this kind of situation I'm facing right now: 
> >> I have a page with images that must be seen among different devices 
> >> (pc, tablet and smartphone). I can fix image length inside its tag (in 
> >> markmin), but its size will vary, proportionally, according to the 
> >> device. 
> >> 
> >> So, I thought about using CSS to present the image with size depending 
> >> on the device. 
> >> 
> >> Any ideias to solve this problem with another approach? 
> >> 
> >> Help wanted. 
> >> 
> >> BTW, Markmin allow tables to have the class attribute and it's useful, 
> >> indeed. Mainly for Markmin power users editing content in a wiki app. 
> >> 
> >> 
> >> 
> >> 
> >> On Thu, Dec 13, 2012 at 12:38 PM, Massimo Di Pierro 
> >>  wrote: 
> >> > I do not doubt this would be useful but do we want to transform the 
> wiki 
> >> > syntax in a markup language? I think of the purpose of the wiki 
> syntax 
> >> > is 
> >> > make sure the user has no freedom in messing up style info. If the 
> user 
> >> > can 
> >> > set the class of tags they can break the page presentation. 
> >> > 
> >> > 
> >> > On Thursday, 13 December 2012 07:23:59 UTC-6, viniciusban wrote: 
> >> >> 
> >> >> According to plugin_wiki documentation, I can personalize classes 
> just 
> >> >> in  and . 
> >> >> 
> >> >> How about allowing images and link classes, too? Maybe lists, too. 
> >> >> I thought in something like attributes in web2py helpers: 
> >> >> DIV(_class="myclass"). 
> >> >> 
> >> >> In images, it would be: [[myimage attachment:3.png center 200px 
> >> >> _class="myclass"]] 
> >> >> 
> >> >> How about that? 
> >> > 
> >> > -- 
> >> > 
> >> > 
> >> > 
> > 
> > -- 
> > 
> > 
> > 
>

-- 





[web2py] Re: count distinct

2012-12-13 Thread Andrew W
Does your dbms support count(distinct ) ?
What happens if you only put one column in COUNT(DISTINCT vista.municipio) ?

On Friday, December 14, 2012 1:13:32 PM UTC+13, Niphlod wrote:
>
> it may help knowing what are you trying to count (e.g. write down the 
> plain sql syntax you'd like to fire, or explain with a sample table what 
> resultset you expect)
>
> On Friday, December 14, 2012 1:01:37 AM UTC+1, Manuele wrote:
>>
>> Hi! 
>> trying this simple query I got this error: 
>>
>> ipdb> db(query)._count(distinct=fields) 
>> "SELECT count(DISTINCT vista.municipio, vista.quartiere, vista.desvia, 
>> vista.den_tot, vista.den_predatori, vista.den_confl, vista.den_dann) 
>> FROM vista WHERE ((vista.id > 0) AND (vista.quartiere = '22: S. 
>> Martino'));" 
>>
>> ipdb> db(query).count(distinct=fields) 
>> *** ProgrammingError: function count(character varying, character 
>> varying, character varying, integer, integer, integer, integer) does not 
>> exist 
>> LINE 1: SELECT count(DISTINCT vista.municipio, vista.quartiere, vist... 
>> ^ 
>> HINT:  No function matches the given name and argument types. You might 
>> need to add explicit type casts. 
>>
>> did I make errors somewhere? 
>>
>> thanks a lot 
>> Cheers 
>>
>>  Manuele 
>>
>

-- 





Re: [web2py] Re: Auth.wiki() documentation

2012-12-13 Thread Andrew W
Hi Alan,
I have been checking out auth.wiki to see what can be done, in particular 
how to get different page layouts within the one "index" controller and 
view.
Would you wrap something like this example (from the slice) in an if clause 
?  Or, I imagine you could use this scenario for boilerplate text in your 
view for all web pages, with slugs like "header", "footer", 
"standard_text".  

content = db(db.wiki_page.slug=="index").select().first().body


P.S.  Still hanging our for the auth.wiki doco


On Friday, December 14, 2012 10:45:50 AM UTC+13, viniciusban wrote:
>
> Thank you, Alan. 
>
> Really useful. 
>
>
>
> On Thu, Dec 13, 2012 at 7:15 PM, Alan Etkin > 
> wrote: 
> > El jueves, 13 de diciembre de 2012 11:42:02 UTC-3, viniciusban escribió: 
> >> 
> >> Agree in part, Massimo. 
> >> 
> >> This feature is very good. Really! 
> >> 
> > 
> > I have posted a slice about auth.wiki here. It covers a couple of 
> features 
> > not documented yet. 
> > 
> > -- 
> > 
> > 
> > 
>

-- 





[web2py] Re: MARKMIN line break

2012-12-06 Thread Andrew W
I assume you are no longer talking about markmin.   I didn't think you 
could use {{  }}  in markmin.

Correct ?



On Sunday, December 2, 2012 10:51:49 PM UTC+13, apps in tables wrote:
>
> Thank you...
>
> On Sunday, December 2, 2012 7:45:50 AM UTC+3, Massimo Di Pierro wrote:
>>
>> You are missing that you need to generate html  and {{=anything}} 
>> always escape anything.
>>
>> You want:
>>
>> {{=(row.body1)}}{{=(row.body2)}} 
>>
>> or
>>
>> {{=CAT(row.body1,BR(),row.body2)}}
>>
>> or
>>
>> {{=CAT(row.body1,XML(''),row.body2)}}
>>
>> or 
>>
>> {{=XML(row.body1+''+row.body2, 
>> sanitize=True)}}
>>
>> The latter is not quite the same as the others as it allows some HTML in 
>> the row.body1/2.
>>
>>
>>
>> On Saturday, 1 December 2012 21:43:22 UTC-6, apps in tables wrote:
>>>
>>>
>>> I am trying these:
>>>
>>> {{=(row.body1)+  \n\n  +(row.body2)}}
>>>
>>> {{=(row.body1)+ ' \n\n '+(row.body2)}}
>>>
>>> {{=(row.body1)+ [[NEWLINE]]  +(row.body2)}}
>>>
>>> {{=(row.body1)+ '[[NEWLINE]]' +(row.body2)}}
>>>
>>> and they are not working.
>>>
>>> What am i missing?
>>>
>>> Regards,
>>>
>>> Ashraf
>>>
>>

-- 





[web2py] Re: auth.wiki( extra=dict() )

2012-11-28 Thread Andrew W
Just an update to the group.  It's not a bug, just (me) typing it 
incorrectly.

This is a very good feature when you want to allow a website editor to add 
some style to their content.  I've got a few simple things in mind.

Hopefully to add to the auth.wiki documentation, here is an example:

I want to make a few specific customisations available to the website 
editors:

return auth.wiki(render='markmin', extra=dict(custom1=lambda text: 
'' + text + '', 
   custom2=lambda text: 
'' + text + '',
   custom3=lambda text: 
'' + text + '') )

I added the following to my layout.html page, or better still in a css file.
  
   #blahid1 {color:green;}
  .blahclass2 {color:blue;  border: 1px solid black; }
  .blahclass3 {color: steelblue; border: 1px solid orange;}
   

and then edited my page in the auth.wiki editor.  The body was:

# A H1 Header
## A H2 Header

``Hello1 Custom tagged``:custom1
``Hello2 Custom tagged``:custom2
-``Custom list also tagged``:custom3
``Some Python Code ``:python
Some more plain text
-
A normal block
-:myblockclass

which gives me the following screen (attached).

<https://lh4.googleusercontent.com/-WblLlpW7QqA/ULaNML_x3ZI/AAc/vI-TDMcSkFg/s1600/Screen+Shot+29-11-12+at+11.15.19+AM.png>
Not very pretty (yet) but it proves how to add extra customised style to 
your auth.wiki page.
I hope to show it in use very soon.



On Monday, November 19, 2012 1:15:52 AM UTC+13, Massimo Di Pierro wrote:
>
> Should work the same. Perhaps this is a bug. Please open a ticket and I 
> will look asap.
>
> On Saturday, 17 November 2012 19:21:52 UTC-6, Andrew W wrote:
>>
>>   
>> I'm assuming it works differently to the markmin document.I can see 
>> is adds a class called "custom", but I don't see the lambda function 
>> working as in:
>>
>>   >>> markmin2html("‘‘aaa‘‘:custom", extra=dict(custom=lambda text: 
>> ’x’+text+’x’
>>   
>> generates 
>>  
>> ’xaaax’ 
>>
>> (the ‘‘...‘‘:custom block is rendered by the custom=lambda function 
>> passed to render). 
>>
>>
>> 

-- 





[web2py] Re: Where does auth.wiki save pages to?

2012-11-28 Thread Andrew W
But I think you need to differentiate between the wiki static pages, and 
"blog" type of article pages.I think the intent of auth.wiki was to 
allow the simple creation of a user updated website, not so much with blog 
type articles pages.   

But that's an interesting way to get both.   What about if your articles 
had an "article" tag that you could add to your search.  You only want to 
see the top 10 articles, you don't want to see a static page that you 
created recently.

Would the above be the best way to achieve this.  Other ideas?



On Monday, October 22, 2012 1:07:48 PM UTC+13, HittingSmoke wrote:
>
> I was thinking more like a db call that would display previews of the ten 
> most recently submitted articles. Sorted by 
> db.wiki_page.created_on
>
>
> On Sunday, October 21, 2012 4:06:26 PM UTC-7, Bill Thayer wrote:
>>
>> Ok,
>>
>> Actually i am just getting there myself on my application. There is a 
>> cloud() function and a search() function inside gluon.tools so chances are 
>> writing a pre-defined search might get you 3/4 the way there. Wish I had a 
>> better strategy to give to you.
>>
>> Regards,
>> Bill
>>
>> Signature for search looks promising with the preview=True argument.
>> def search(self, tags=None, query=None, cloud=True, preview=True,
>>limitby=(0, 100), orderby=None):
>>
>>
>>

-- 





[web2py] Re: The book updates and status

2012-11-28 Thread Andrew W
Thanks for the update.

On Thursday, November 29, 2012 8:08:48 AM UTC+13, Massimo Di Pierro wrote:
>
> Almost everything is documented except: 1) auth.wiki; 2) some of the new 
> grid parameters.
>
> Along with these changes I am planning some minor book refactoring before 
> publishing to 5th edition.
>
> Massimo
>
> On Tuesday, 27 November 2012 23:01:17 UTC-6, Andrew W wrote:
>>
>> May I ask, in terms of status, where are we up to ?
>>
>> What is *still left to do* to bring the documentation up to date for 
>> Version 2.2.x ?  
>>
>> Thanks.
>>
>>
>> On Friday, November 23, 2012 3:46:01 PM UTC+13, Andrew W wrote:
>>>
>>> Thanks.
>>>
>>> On Friday, November 23, 2012 2:39:41 PM UTC+13, villas wrote:
>>>>
>>>> Hi Andrew
>>>> You can see the current state and updates here:
>>>> https://github.com/mdipierro/web2py-book
>>>>
>>>>
>>>> On Thursday, November 22, 2012 4:32:39 PM UTC, Andrew W wrote:
>>>>>
>>>>> The book has been at 4th edition for a while and I'm sure there have 
>>>>> been updates since then.  The edition numbers may tick over at major 
>>>>> updates,but is it possible to put a last update date on it to tell when 
>>>>> it 
>>>>> has changed.
>>>>>
>>>>> One thing we talked about before version 2 was getting the doco up to 
>>>>> date ASAP, we even talked about delaying the release, or at least it's 
>>>>> announcement till that was done.  I'm not sure if that has actually 
>>>>> happened yet (completely)
>>>>>
>>>>> Eg.  Waiting to see updates around replacing plugin_wiki with 
>>>>> auth.wiki (I think that's the strategy).  I would like to deploy an app 
>>>>> soon using it but its not quite there yet.
>>>>>
>>>>> Happy to help too.
>>>>> Thanks
>>>>>
>>>>>

-- 





[web2py] Re: videos not working in auth.wiki page

2012-11-28 Thread Andrew W
Awesome !   
Thanks.

On Thursday, November 29, 2012 8:23:08 AM UTC+13, Massimo Di Pierro wrote:
>
> I see. You cannot do it this way.
>
> You should just use:
>
> 
>  Ecover at sea
>
> http://www.youtube.com/watch?v=NgZIyJm2Aao
> 
>
> because the link is not a video. it is a page containing a video. You have 
> to let web2py's oembed protocol figure out how to embed it.
>
> On Wednesday, 28 November 2012 02:27:03 UTC-6, Andrew W wrote:
>>
>> It's:
>>
>>  Ecover at sea
>>
>> [[ecover http://www.youtube.com/watch?v=NgZIyJm2Aao video]]
>>
>>
>> On Wednesday, November 28, 2012 5:14:41 AM UTC+13, Massimo Di Pierro 
>> wrote:
>>>
>>> Can you please post the exact wiki content you are using with auth.wiki?
>>>
>>> On Tuesday, 27 November 2012 02:40:13 UTC-6, Andrew W wrote:
>>>>
>>>>
>>>> This is what I see and the play button doesn't work (see attached). 
>>>>  The link is OK as I can open it if I right click and press Open Video in 
>>>> new tab.  
>>>>
>>>> Thanks
>>>>
>>>>
>>>> On Friday, November 23, 2012 3:51:49 PM UTC+13, Andrew W wrote:
>>>>>
>>>>> Could you please confirm that it's working OK ?
>>>>>
>>>>> thanks
>>>>>
>>>>>
>>>>> On Saturday, November 17, 2012 10:37:14 AM UTC+13, Andrew W wrote:
>>>>>>
>>>>>> Thanks.
>>>>>> That's what I did.  
>>>>>>
>>>>>> On Friday, November 16, 2012 11:56:49 PM UTC+13, Massimo Di Pierro 
>>>>>> wrote:
>>>>>>>
>>>>>>> No. You do not need it. You just cut and paste the link to the 
>>>>>>> youtube video page and it will embed the video automatically.
>>>>>>>
>>>>>>> On Thursday, 15 November 2012 22:32:17 UTC-6, Andrew W wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> Does the plugin_wiki syntax work in auth.wiki ? (I'll try it 
>>>>>>>> tonight).   From the book (plugins section):
>>>>>>>>
>>>>>>>> For example, to embed a YouTube video in a plugin_wiki page, you 
>>>>>>>> can do
>>>>>>>>
>>>>>>>> ``
>>>>>>>> name: youtube
>>>>>>>> code: l7AWnfFRc7g
>>>>>>>> ``:widget
>>>>>>>>
>>>>>>>> or to embed the same widget in a web2py view, you can do:
>>>>>>>>
>>>>>>>> {{=plugin_wiki.widget('youtube',code='l7AWnfFRc7g')}}
>>>>>>>>
>>>>>>>>
>>>>>>>>

-- 





[web2py] Re: videos not working in auth.wiki page

2012-11-28 Thread Andrew W
It's:

 Ecover at sea

[[ecover http://www.youtube.com/watch?v=NgZIyJm2Aao video]]


On Wednesday, November 28, 2012 5:14:41 AM UTC+13, Massimo Di Pierro wrote:
>
> Can you please post the exact wiki content you are using with auth.wiki?
>
> On Tuesday, 27 November 2012 02:40:13 UTC-6, Andrew W wrote:
>>
>>
>> This is what I see and the play button doesn't work (see attached).  The 
>> link is OK as I can open it if I right click and press Open Video in new 
>> tab.  
>>
>> Thanks
>>
>>
>> On Friday, November 23, 2012 3:51:49 PM UTC+13, Andrew W wrote:
>>>
>>> Could you please confirm that it's working OK ?
>>>
>>> thanks
>>>
>>>
>>> On Saturday, November 17, 2012 10:37:14 AM UTC+13, Andrew W wrote:
>>>>
>>>> Thanks.
>>>> That's what I did.  
>>>>
>>>> On Friday, November 16, 2012 11:56:49 PM UTC+13, Massimo Di Pierro 
>>>> wrote:
>>>>>
>>>>> No. You do not need it. You just cut and paste the link to the youtube 
>>>>> video page and it will embed the video automatically.
>>>>>
>>>>> On Thursday, 15 November 2012 22:32:17 UTC-6, Andrew W wrote:
>>>>>>
>>>>>>
>>>>>> Does the plugin_wiki syntax work in auth.wiki ? (I'll try it 
>>>>>> tonight).   From the book (plugins section):
>>>>>>
>>>>>> For example, to embed a YouTube video in a plugin_wiki page, you can 
>>>>>> do
>>>>>>
>>>>>> ``
>>>>>> name: youtube
>>>>>> code: l7AWnfFRc7g
>>>>>> ``:widget
>>>>>>
>>>>>> or to embed the same widget in a web2py view, you can do:
>>>>>>
>>>>>> {{=plugin_wiki.widget('youtube',code='l7AWnfFRc7g')}}
>>>>>>
>>>>>>
>>>>>>

-- 





[web2py] Re: The book updates and status

2012-11-27 Thread Andrew W
May I ask, in terms of status, where are we up to ?

What is *still left to do* to bring the documentation up to date for 
Version 2.2.x ?  

Thanks.


On Friday, November 23, 2012 3:46:01 PM UTC+13, Andrew W wrote:
>
> Thanks.
>
> On Friday, November 23, 2012 2:39:41 PM UTC+13, villas wrote:
>>
>> Hi Andrew
>> You can see the current state and updates here:
>> https://github.com/mdipierro/web2py-book
>>
>>
>> On Thursday, November 22, 2012 4:32:39 PM UTC, Andrew W wrote:
>>>
>>> The book has been at 4th edition for a while and I'm sure there have 
>>> been updates since then.  The edition numbers may tick over at major 
>>> updates,but is it possible to put a last update date on it to tell when it 
>>> has changed.
>>>
>>> One thing we talked about before version 2 was getting the doco up to 
>>> date ASAP, we even talked about delaying the release, or at least it's 
>>> announcement till that was done.  I'm not sure if that has actually 
>>> happened yet (completely)
>>>
>>> Eg.  Waiting to see updates around replacing plugin_wiki with auth.wiki 
>>> (I think that's the strategy).  I would like to deploy an app soon using it 
>>> but its not quite there yet.
>>>
>>> Happy to help too.
>>> Thanks
>>>
>>>

-- 





Re: [web2py] Database table prefix

2012-11-27 Thread Andrew W
What about a "prefix" column, and filter all selects on the prefix.   A single 
database ctructure sounds more scalable and logically you're partitioning the 
data based on login or context.  Prefixing table names doesn't sound like a 
good idea.

-- 





[web2py] Re: videos not working in auth.wiki page

2012-11-27 Thread Andrew W

This is what I see and the play button doesn't work (see attached).  The 
link is OK as I can open it if I right click and press Open Video in new 
tab.  

Thanks


On Friday, November 23, 2012 3:51:49 PM UTC+13, Andrew W wrote:
>
> Could you please confirm that it's working OK ?
>
> thanks
>
>
> On Saturday, November 17, 2012 10:37:14 AM UTC+13, Andrew W wrote:
>>
>> Thanks.
>> That's what I did.  
>>
>> On Friday, November 16, 2012 11:56:49 PM UTC+13, Massimo Di Pierro wrote:
>>>
>>> No. You do not need it. You just cut and paste the link to the youtube 
>>> video page and it will embed the video automatically.
>>>
>>> On Thursday, 15 November 2012 22:32:17 UTC-6, Andrew W wrote:
>>>>
>>>>
>>>> Does the plugin_wiki syntax work in auth.wiki ? (I'll try it tonight). 
>>>>   From the book (plugins section):
>>>>
>>>> For example, to embed a YouTube video in a plugin_wiki page, you can do
>>>>
>>>> ``
>>>> name: youtube
>>>> code: l7AWnfFRc7g
>>>> ``:widget
>>>>
>>>> or to embed the same widget in a web2py view, you can do:
>>>>
>>>> {{=plugin_wiki.widget('youtube',code='l7AWnfFRc7g')}}
>>>>
>>>>
>>>>

-- 



<>

[web2py] Re: videos not working in auth.wiki page

2012-11-22 Thread Andrew W
Could you please confirm that it's working OK ?

thanks


On Saturday, November 17, 2012 10:37:14 AM UTC+13, Andrew W wrote:
>
> Thanks.
> That's what I did.  
>
> On Friday, November 16, 2012 11:56:49 PM UTC+13, Massimo Di Pierro wrote:
>>
>> No. You do not need it. You just cut and paste the link to the youtube 
>> video page and it will embed the video automatically.
>>
>> On Thursday, 15 November 2012 22:32:17 UTC-6, Andrew W wrote:
>>>
>>>
>>> Does the plugin_wiki syntax work in auth.wiki ? (I'll try it tonight).   
>>> From the book (plugins section):
>>>
>>> For example, to embed a YouTube video in a plugin_wiki page, you can do
>>>
>>> ``
>>> name: youtube
>>> code: l7AWnfFRc7g
>>> ``:widget
>>>
>>> or to embed the same widget in a web2py view, you can do:
>>>
>>> {{=plugin_wiki.widget('youtube',code='l7AWnfFRc7g')}}
>>>
>>>
>>>

-- 





[web2py] Re: The book updates and status

2012-11-22 Thread Andrew W
Thanks.

On Friday, November 23, 2012 2:39:41 PM UTC+13, villas wrote:
>
> Hi Andrew
> You can see the current state and updates here:
> https://github.com/mdipierro/web2py-book
>
>
> On Thursday, November 22, 2012 4:32:39 PM UTC, Andrew W wrote:
>>
>> The book has been at 4th edition for a while and I'm sure there have been 
>> updates since then.  The edition numbers may tick over at major updates,but 
>> is it possible to put a last update date on it to tell when it has changed.
>>
>> One thing we talked about before version 2 was getting the doco up to 
>> date ASAP, we even talked about delaying the release, or at least it's 
>> announcement till that was done.  I'm not sure if that has actually 
>> happened yet (completely)
>>
>> Eg.  Waiting to see updates around replacing plugin_wiki with auth.wiki 
>> (I think that's the strategy).  I would like to deploy an app soon using it 
>> but its not quite there yet.
>>
>> Happy to help too.
>> Thanks
>>
>>

-- 





[web2py] The book updates and status

2012-11-22 Thread Andrew W
The book has been at 4th edition for a while and I'm sure there have been 
updates since then.  The edition numbers may tick over at major updates,but is 
it possible to put a last update date on it to tell when it has changed.

One thing we talked about before version 2 was getting the doco up to date 
ASAP, we even talked about delaying the release, or at least it's announcement 
till that was done.  I'm not sure if that has actually happened yet (completely)

Eg.  Waiting to see updates around replacing plugin_wiki with auth.wiki (I 
think that's the strategy).  I would like to deploy an app soon using it but 
its not quite there yet.

Happy to help too.
Thanks

-- 





Re: default vs not-default (was Re: [web2py] perhaps a silly question about index)

2012-11-22 Thread Andrew W
Have you read the Overview chapter of the book?
To achieve what you want you would not put controllers in the model folder, 
they go in the controllers folder.   The default/index in the path refers to 
the file name and the function within the file name.
So green/eggs/ham.refers to the green app, the eggs controller file (in the 
controller folder), and the ham function.  Have as many controller files as you 
like, I use more than one.

The displayed URL you mention is achieved through routing, not by moving 
controller files.

-- 





[web2py] Re: auth.wiki( extra=dict() )

2012-11-17 Thread Andrew W
  


I'm assuming it works differently to the markmin document.I can see is 
adds a class called "custom", but I don't see the lambda function working 
as in:

  >>> markmin2html("‘‘aaa‘‘:custom", extra=dict(custom=lambda text: 
’x’+text+’x’
  
generates 
 
’xaaax’ 

(the ‘‘...‘‘:custom block is rendered by the custom=lambda function passed 
to render). 


-- 





[web2py] Re: videos not working in auth.wiki page

2012-11-16 Thread Andrew W
Thanks.
That's what I did.  

On Friday, November 16, 2012 11:56:49 PM UTC+13, Massimo Di Pierro wrote:
>
> No. You do not need it. You just cut and paste the link to the youtube 
> video page and it will embed the video automatically.
>
> On Thursday, 15 November 2012 22:32:17 UTC-6, Andrew W wrote:
>>
>>
>> Does the plugin_wiki syntax work in auth.wiki ? (I'll try it tonight).   
>> From the book (plugins section):
>>
>> For example, to embed a YouTube video in a plugin_wiki page, you can do
>>
>> ``
>> name: youtube
>> code: l7AWnfFRc7g
>> ``:widget
>>
>> or to embed the same widget in a web2py view, you can do:
>>
>> {{=plugin_wiki.widget('youtube',code='l7AWnfFRc7g')}}
>>
>>
>>

-- 





[web2py] Re: auth.wiki( extra=dict() )

2012-11-16 Thread Andrew W


Yes, it's broken: AttributeError: 'Wiki' object has no attribute 'extra'

I made the change below and it works.


On Saturday, November 17, 2012 12:54:14 AM UTC+13, villas wrote:
>
> Hi Massimo,  
> I've just been checking it.
> I think you need to change this...
>
> Wiki  __init__()
>
> This line:
>
> self.extra = self.extra or {}
>
> should be:
>
> self.extra = extra or {} 
>
>
>

-- 





[web2py] Re: videos not working in auth.wiki page

2012-11-15 Thread Andrew W

Does the plugin_wiki syntax work in auth.wiki ? (I'll try it tonight).   
>From the book (plugins section):

For example, to embed a YouTube video in a plugin_wiki page, you can do

``
name: youtube
code: l7AWnfFRc7g
``:widget

or to embed the same widget in a web2py view, you can do:

{{=plugin_wiki.widget('youtube',code='l7AWnfFRc7g')}}


-- 





[web2py] Re: videos not working in auth.wiki page

2012-11-15 Thread Andrew W
No, I was posting a link to a youtube video.

On Friday, November 16, 2012 2:41:01 PM UTC+13, Massimo Di Pierro wrote:
>
> what video type. Are the video hosted in the wiki?
>
> On Thursday, 15 November 2012 02:05:20 UTC-6, Andrew W wrote:
>>
>> Is anyone using video links with auth.wiki ?
>> I'm just getting the bottom bar with the Play button, but nothing else 
>> and nothing happens when I press Play.
>>
>> I did have success with plugin_wiki, but I would like to get it up and 
>> running with auth.wiki.  
>> I've tried with Chrome and Safari.
>>
>> Thanks
>>
>

-- 





[web2py] videos not working in auth.wiki page

2012-11-15 Thread Andrew W
Is anyone using video links with auth.wiki ?
I'm just getting the bottom bar with the Play button, but nothing else and 
nothing happens when I press Play.

I did have success with plugin_wiki, but I would like to get it up and 
running with auth.wiki.  
I've tried with Chrome and Safari.

Thanks

-- 





[web2py] Re: how to hide the [wiki] menu option in auth.wiki

2012-11-13 Thread Andrew W
Works great, thanks.   I've also sent Massimo a patch for tools.py to fix 
it in trunk.
I hope to deploy a website soon using auth.wiki and this was one of my last 
hurdles.

On Wednesday, November 7, 2012 12:25:44 AM UTC+13, villas wrote:
>
> I do not want the wiki menu to be displayed to anyone except an 'admin' 
> and I hope that this option will eventually become available.  
>
> Until then,  this is my workaround solution:
>
> Create a view for the wiki controller function.  Place inside that view 
> this script:
>
> {{if not auth.has_membership('admin'):}}
>   
>  $(document).ready(function() {
>$("a:contains('[Wiki]')").closest('li').remove();
>  });
>   
> {{pass}}
>
> Maybe this would work for you too.
>
>

-- 





[web2py] Re: how to hide the [wiki] menu option in auth.wiki

2012-11-06 Thread Andrew W

>
> Hello,

I still think the "[Wiki]" should not be displayed if you are not logged 
in.   A wiki administrator would be logged in.   The general public don't 
need to see it.

The change is a little more complicated than I first suggested.  There is 
more happening after the "if self.auth.user: " code block at tools.py, line 
5088 that I think should be inside the auth.user check.  Shouldn't "Manage 
Pages" appear only to authorised users ?

By the way,  why have "if True: "  (line 5085)  .  Wouldn't that happen all 
the time ?

I can post this to the developer group if more appropriate.

Thanks.



On Saturday, October 27, 2012 9:01:42 AM UTC+13, Andrew W wrote:
>
> Looking at the change, it looks like a non logged in person can still see 
> "[Wiki]".  
> Could I suggest that the append statement comes inside the if 
> self.auth.user test:
>
>
if self.auth.user:
> menu.append((current.T('[Wiki]'), None, None, submenu))
>
>
> On Friday, October 26, 2012 2:22:36 AM UTC+13, Massimo Di Pierro wrote:
>>
>> I agree. Changed the behavior in trunk.
>>
>> On Thursday, 25 October 2012 03:44:08 UTC-5, Andrew W wrote:
>>>
>>> the [wiki] menu option is good for the person maintaining the website, 
>>> but shouldn't be seen by others (at least those not logged in) .
>>> How do I hide it for unauthorised users ?
>>>
>>> Any update on when the book will contain auth.wiki information ?  I can 
>>> see plugin_wiki still there.
>>>
>>> Thanks
>>>
>>> Andrew W
>>>
>>

-- 





[web2py] Re: MS SQL server

2012-11-05 Thread Andrew W
Yes, there are a lot of advantages, but if your legacy tables can't be changed ?

Is it worth exploring The addition of PK support in forms and the grid?  Not 
the most optimised solution, but one that you may have to do.

-- 





[web2py] Re: extending dal

2012-10-30 Thread Andrew W
Is it a web service interface to ebay what you are after, and storing some 
details locally ?  If it is I'm not sure that extending the DAL is the 
right way to go.  If you just want to interface to query ebay, look 
at 
http://developer.ebay.com/DevZone/shopping/docs/Concepts/ShoppingAPIGuide.html


On Tuesday, October 30, 2012 1:08:24 PM UTC+13, howesc wrote:
>
> i'm not claiming to be an expert herebut
>
> each database connector is a class, for example, my current favorite:
>
> class GoogleDatastoreAdapter(NoSQLAdapter):
>
>
> so i suspect you can create an Adapter class and use it with the DAL with 
> little or no modifications to DAL.py.  I've not tried it myself, but i 
> suggest you look at the base adapters and try creating your custom class.  
> then see if you can plug it into the dal.
>
> good luck!
>
> cfh
>
> On Sunday, October 28, 2012 11:19:08 PM UTC-7, guruyaya wrote:
>>
>> Say I would like to create a project that uses eBay as a database. One of 
>> the things I'm dreaming of, is making ad hook storage engine, for the 
>> purpose of reading eBay listings. I'm not looking to hack DAL for this 
>> purpose (and make upgrades hard), but to extend DAL, and use it's built ins 
>> to search eBay. Is there a way to add a storage engine, without changing 
>> DAL code?
>>
>> Thanks in advance
>> YAYA
>>
>

-- 





  1   2   >