[web2py] Re: Current status of adapting OrientDB for web2py

2012-09-04 Thread luckysmack
I am curious if anyone has made any advancements with OrientDB. I only 
recently found out about it and Neo4j. I had been planning on using 
mongo/couch for my db backend, but based on the way the graph databases are 
made, it could be of great use. 

@TheSweetlink iv'e also noticed that your pasted example is no longer 
there, since it seems that paste service no longer exists. gist.github.com 
perhaps?

Thanks.

On Monday, February 13, 2012 9:54:05 AM UTC-8, Nolan Nichols wrote:
>
> I'm researching the nosql and graph database landscape for a web2py 
> application that will require the schema to evolve over time and 
> provide network/graph analysis metrics. 
>
> I started by looking at the Tinkerpop (http://tinkerpop.com/) stack 
> and the Bulbflow (http://bulbflow.com/) python library for interacting 
> with Tinkerpop graph databases like Neo4j and OrientDB. 
>
> It looks like there was interest a few months back in adapting 
> OrientDB's sql interface for web2py, and there is an open issue: 
>
> - http://code.google.com/p/web2py/issues/detail?id=407 
>
> A few questions: 
>
> What is the current status of an OrientDB/web2py adapter? 
> Is anyone currently using a graph database with web2py? 
> Any suggestions for using web2py DAI/templates with non-rdbms sources? 
>
> Cheers, 
>
> Nolan

-- 





[web2py] Re: web2py login and register forms as part of main page

2012-09-04 Thread Yebach
Thank you for your fast reply

With main page function you mean I include them in my mainpage.py contorler?


OR do I just do a check if user is logged in and show the proper one if he 
is?

thanx again


On Tuesday, September 4, 2012 4:30:48 PM UTC+2, Anthony wrote:
>
> auth.login() and auth.register() generate and process the login and 
> register forms, respectively. You main page function could return those 
> forms and include them in the view.
>
> Anthony
>
> On Tuesday, September 4, 2012 9:56:36 AM UTC-4, Yebach wrote:
>>
>> Hello
>>
>> I would like to create a login/register forms as part of a current page 
>> not to be redirected to a new page where you login or register and then be 
>> redirected back to the main page.
>>
>> Now I have auth.navbar() but that one takes you to a new page
>>
>> any suggestion??
>>
>> Thank you
>>
>

-- 





[web2py] Re: Code editor on the administrative interface

2012-09-04 Thread caps.i.sin
wow!
a few hours after my e-mail, the isue is already fixed
I'm new on Web2py and on this group but I'm really impressed by the 
reactivity.
Thank you very much Massimo

Le mardi 4 septembre 2012 22:53:07 UTC+2, Massimo Di Pierro a écrit :
>
> This is now fixed in trunk and I will post 2.0.7 later today. This was a 
> symptom of a more serious behavior as some features of components are 
> broken in 2.0.6 because of a typo. Now fixed.
>
> On Tuesday, 4 September 2012 12:06:02 UTC-5, caps.i.sin wrote:
>>
>>
>> Dear all,
>>
>> I have a question about the code editor on the administrative interface :
>>
>> When I edit a code (for example a controller) I save it with [Ctrl + S].
>> If there are any errors on my python code, the field "Last saved on" has 
>> a yellow background.
>> On my previous web2py version, when I had an error, a popup was displayed 
>> with the description of the python error.
>>
>> So currently if I make a mistake, I know there is an error (yellow 
>> background) but I have no more information about the problem.
>>
>> Is it a normal behaviour? or did I miss something?
>> Thank you, and sorry for my bad english
>>
>>
>> My configuration : Web2py 2.03 binaries on Windows 7 pro x64 and Mozilla 
>> Firefox 14.0.1
>>
>

-- 





[web2py] how to set js variable from session variable?

2012-09-04 Thread weheh
I imagine someone has asked this but couldn't find it from my searches. 
Anyway, I want to set a javascript variable to the current session variable 
at time of execution of the javascript, not at time when it's loaded. So I 
can't just do:


... blah ...
function() {
if ( certain_condition = True ) {
var myjsvar={{=session.myvar}};
alert(myjsvar);
}
}
... blah ...



because that will not be correct when the function executes.

I tried an ajax call to a controller callback, that in turn returns 
"$('#myjsvar').val('%d');" % session.myvar, based loosely on a thread I 
read here, but that didn't come close to working, either.

-- 





[web2py] jQuery UI in 2.0.7

2012-09-04 Thread Annet
I just upgraded to 2.0.7, this backward comaptibility issue still hasn't 
been fixed:

The issue has something to do with web2py.

In 1.99.7 
jQuery 1.7.1
jQuery UI 1.8.20

... the date and auto complete field do work:






In 2.0.6 
jQuery 1.7.1
jQuery UI 1.8.20

... (same code, different web2py version) the date and autocomplete field 
do not work when they are in the same form. The date field get the 
hasDatepicker class and works. The auto complete field isn't set.







I have no idea why.


Kind regards,

Annet

-- 





Re: [web2py] Re: [Announcement] web2py powered app Vocabilis.NET

2012-09-04 Thread Alexei Vinidiktov
Answered off-list.

On Wed, Sep 5, 2012 at 5:50 AM, Derek  wrote:

> It would be nice if I (as a language teacher) can invite students to a
> lesson. It looks as it is now, everyone must sign up and create their own
> databases. I'd love to have a student view where I can see where someone is
> in learning, as well as how they are in relation to their peers.
>
>
> On Tuesday, September 4, 2012 3:48:28 PM UTC-7, Derek wrote:
>>
>> Looks great, I plan on using this to setup English lessons for my wife
>> (whom is Russian). My only concern is that it's using Flash - she uses only
>> a Tablet computer - touchscreen android device. Html5 would have been a
>> better choice.
>>
>> Thanks,
>> Derek
>>
>> On Thursday, August 30, 2012 7:53:56 AM UTC-7, Alexei Vinidiktov wrote:
>>>
>>> Hi,
>>>
>>> I'm glad to announce the launch of my second web2py powered web
>>> application www.vocabilis.net.
>>>
>>> It's a flashcard vocabulary builder for language learners.
>>>
>>> On the front end I use Flex and on the back end I use web2py.
>>>
>>> To see the app in action you'll need to register on the site.
>>> Registration doesn't require email confirmation at the moment.
>>>
>>> I'd like to thank the web2py community for all the help I've gotten
>>> working on Vocabilis.NET.
>>>
>>> Massimo and all the contributors, thank you for creating such an
>>> indispensable tool!
>>>
>>> Thanks, guys!
>>>
>>> --
>>> Alexei Vinidiktov
>>>
>>  --
>
>
>
>



-- 
Alexei Vinidiktov

-- 





Re: [web2py] Re: [Announcement] web2py powered app Vocabilis.NET

2012-09-04 Thread Alexei Vinidiktov
Answered off-list.

On Tue, Sep 4, 2012 at 10:38 PM, wwwgong  wrote:

> Thanks for sharing your web site.
>
> I am interested in using it to teach Chinese.
>
> It would be good if you can post a youtube video on how to your site.
>
> Wen
>
>
> On Friday, August 31, 2012 8:52:01 AM UTC-4, Alexei Vinidiktov wrote:
>
>> That would be great! :)
>>
>> On Fri, Aug 31, 2012 at 3:04 AM, Massimo Di Pierro > > wrote:
>>
>>> My wife teaches Italian. Perhaps I get finally get her to use web2py. ;-)
>>>
>>>
>>> On Thursday, 30 August 2012 09:53:56 UTC-5, Alexei Vinidiktov wrote:

 Hi,

 I'm glad to announce the launch of my second web2py powered web
 application www.vocabilis.net.

 It's a flashcard vocabulary builder for language learners.

 On the front end I use Flex and on the back end I use web2py.

 To see the app in action you'll need to register on the site.
 Registration doesn't require email confirmation at the moment.

 I'd like to thank the web2py community for all the help I've gotten
 working on Vocabilis.NET.

 Massimo and all the contributors, thank you for creating such an
 indispensable tool!

 Thanks, guys!

 --
 Alexei Vinidiktov

>>>  --
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Alexei Vinidiktov
>>
>  --
>
>
>
>



-- 
Alexei Vinidiktov

-- 





Re: [web2py] Re: [Announcement] web2py powered app Vocabilis.NET

2012-09-04 Thread Alexei Vinidiktov
Thanks for your feedback, Derek.

I've started working on an interface for tablet devices which will utilize
the qooxdoo JavaScript framework.

On Wed, Sep 5, 2012 at 5:48 AM, Derek  wrote:

> Looks great, I plan on using this to setup English lessons for my wife
> (whom is Russian). My only concern is that it's using Flash - she uses only
> a Tablet computer - touchscreen android device. Html5 would have been a
> better choice.
>
> Thanks,
> Derek
>
>
> On Thursday, August 30, 2012 7:53:56 AM UTC-7, Alexei Vinidiktov wrote:
>>
>> Hi,
>>
>> I'm glad to announce the launch of my second web2py powered web
>> application www.vocabilis.net.
>>
>> It's a flashcard vocabulary builder for language learners.
>>
>> On the front end I use Flex and on the back end I use web2py.
>>
>> To see the app in action you'll need to register on the site.
>> Registration doesn't require email confirmation at the moment.
>>
>> I'd like to thank the web2py community for all the help I've gotten
>> working on Vocabilis.NET.
>>
>> Massimo and all the contributors, thank you for creating such an
>> indispensable tool!
>>
>> Thanks, guys!
>>
>> --
>> Alexei Vinidiktov
>>
>  --
>
>
>
>



-- 
Alexei Vinidiktov

-- 





Re: [web2py] Re: Twitter account for @web2py

2012-09-04 Thread Luther Goh Lu Feng
Page liked!

On Wednesday, September 5, 2012 3:54:26 AM UTC+8, rochacbruno wrote:
>
> www.facebook.com/web2py 

-- 





[web2py] Re: textarea syntax highlight

2012-09-04 Thread elvitto
Thank you Massimo.
Yes, I'm trying to use EditArea, but I can't figure out. I already have 
copy of the folder edit_area in my application and I have written a 
Textarea in the Controller, but i don´t know how to implement it...
I'm sorry, maybe my question is too basic, but I am pretty new in the 
programming world!
By the way, web2py has been really usefull to me so far !



El martes, 4 de septiembre de 2012 09:06:24 UTC-3, Massimo Di Pierro 
escribió:
>
> You need to use something like ace or codemirror or editarea. They have 
> plugins that understands various languages.
>
> On Tuesday, 4 September 2012 00:08:07 UTC-5, elvitto wrote:
>>
>> How to setup a TEXTAREA that allows python syntax highlight (real time) ?
>> Thanks !
>>
>>
>>
>>
>>

-- 





[web2py] Re: web2py 2.0.2 is out

2012-09-04 Thread Massimo Di Pierro
web2py 2.0.7 is not now.

Fixed a number of recent bugs and backward compatibility issues.
It also includes additional speed improvements when compared to 2.0.2.

Massimo

On Wednesday, 29 August 2012 22:41:34 UTC-5, Massimo Di Pierro wrote:
>
> After 5 months. It is done. This is the most waited and the most 
> feature-packed release.
>
> I am sure we'll find some corners that need to be ironed but it is 
> considerably better than 1.99.7. It adds lot of new features and improves 
> many existing ones:
>
> - 57,000 new lines of code and closed 279 issues since 1.99.7.
> - Retrieving data from DB should be faster, in particular 
> select(cacheable=True)
> - Has a new scheduler, a built-in wiki, new language and pluralization 
> system, better markmin with oembed support and better scaffolding app, 
> increased security.
> - Lots of experimental features including GIS support, mongodb support, 
> built-in auth.wiki(), and more.
>
> Should be 100% backward compatible. If you run into any issue let us know 
> ASAP.
>
> I personally want to thank the major contributors to this release (in 
> alphabetic order)
> Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, Iceberg, Jonathan, 
> Marc, Mariano, Marin, Martin, Mark, Michael, Michele, Niphlod, Patrick, 
> Vladyslav, 
> They spend many nights testing, coding, debugging at a very fast pace.
>
> Many many people have contributed.
>
> If your contribution has not been properly acknowledged please let us know 
> ASAP. It is probably an oversight.
>
>
> Massimo
>
>
> Detailed changelog
> ===
>
> ## 2.00.2
>
> ### DAL Improvements
>
> - Support for DAL(lazy_tables=True) and db.define_table(on_define=lambda 
> table:), thanks Jonathan
> - db(...).select(cacheable=True) make select 30% faster
> - db(...).select(cache=(cache.ram,3600)) now caches parsed data 100x faster
> - db(...).count(cache=(cache.ram,3600)) now supported
> - MongoDB support in DAL (experimental), thanks Mark Breedveld
> - geodal and spatialite, thanks Denes and Fran (experimental)
> - db.mytable._before_insert, _after_insert, _before_update, _after_update, 
> _before_delete. _after_delete (list of callbacks)
> - db(...).update_naive(...) same as update but ignores 
> table._before_update and table._after_update
> - DAL BIGINT support and DAL(...,bigint_id=True)
> - IS_IN_DB(..., distinct=True)
> - new syntax: db.mytable.insert(myuploadfield=open()), thank you 
> Iceberg
> - db(...).select(db.mytable.myfield.count(distinct=True))
> - db(db.a)._update(name=db(db.b.a==db.a.id).nested_select(db.b.id))
> - db.mytable.myfield.filter_in, filter_out
> - db.mytable._enable_record_versioning(db) adds versioning to this table
> - teradata adapter, thanks Andrew Willimott
> - experimental Sybase Adapter
> - added db.table.field.avg()
> - Support for Google App Engine projections, thanks Christian
> - Field(... 'upload', default=path) now accepts a path to a local file as 
> default value, if user does not upload a file. Relative path looks inside 
> current application folder, thanks Marin
> - executesql(...,fields=,columns=) allows parsing of results in Rows, 
> thanks Anthony
>
> ### Auth improvements
>
> - auth.enable_record_versioning(db)  adds full versioning to all tables
> - @auth.requires_login(otherwise=URL(...))
> - auth supports salt and compatible with third party data, thanks Dave 
> Stoll
> - CRYPT now defaults to pbkdf2(1000,20,sha1)
> - Built-in wiki with menu, tags, search, media, permissions. def index: 
> return auth.wiki()
> - auth.settings.everybody_group_id
> - allow storage of uploads on any PyFileSystem (including amazon)
>
> ### Form improvements
>
> - FORM.confirm('Are you sure?',{'Back':URL(...)})
> - SQLFORM.smartdictform(dict)
> - form.add_button(value,link)
> - SQLFORM.grid(groupby='...')
> - fixed security issue with SQLFORM.grid and SQLFORM.smartgrid
> - more export options in SQLFORM.grid and SQLFORM.smartgrid (html, xml, 
> csv, ...)
>
> ### Admin improvements
>
> - new admin pages: manage_students, bulk_regsiter, and progress reports
> - increased security in admin against CSRF
> - experimental Git integration
> - experimental OpenShift deployment
> - multi-language pluralization engine 
> - ace text web editor in admin
> - Ukrainian translations, thanks Vladyslav Kozlovskyy
> - Romanian translation for welcome, thanks ionel
> - support for mercurial 2.6, thanks Vlad
>
> ### Scheduler Improvements (thanks to niphlod, ykessler, dhx, toomim)
>
> - web2py.py -K myapp -X starts the myapp scheduler alongside the webserver
> - tasks are marked EXPIRED (if stop_time passed)
> - functions with no result don't end up in scheduler_run
> - more options: web2py.py -E -b -L
> - scheduler can now handle 10k tasks with 20 concurrent workers and with 
> no issues
> - new params:
> tasks can be found in the environment (no need to define the tasks 
> parameter)
> max_empty_runs kills the workers automatically if no new tasks are 
> found in queue (nice for "spikes

[web2py] Re: Error in DAL when creating indexes in web2py 2.0.6 with PostgreSQL

2012-09-04 Thread Massimo Di Pierro
Get 2.0.7 which is out now and fixes this issue among others.


On Tuesday, 4 September 2012 18:17:24 UTC-5, Juan Diego Romero González 
wrote:
>
> Hi. I'm having this error since I update to 2.0.2 when executing 
> executesql()
>  no results to fetch
>
> 7201.
> 7202.
> 7203.
> 7204.
> 7205.
> 7206.
>
> 7207.
> 7208.
> 7209.
> 7210.
>
> # will hold our finished resultset in a list
> data = adapter.cursor.fetchall()
> # convert the list for each row into a dictionary so it's
> # easier to work with. row['field_name'] rather than row[0]
> return [dict(zip(fields,row)) for row in data]
> data = adapter.cursor.fetchall()
>
> if fields:
> if not isinstance(fields, list):
> fields = [fields]
> extracted_fields = []
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
>
> # -*- coding: utf-8 -*-
>
> db.define_table('banks',
> Field ('abm_number', 
> 'integer', length=3, notnull=True),
> Field 
> ('institution_name', 
> 'string', notnull=True),
> Field ('short_name', 
> 'string', notnull=True),
> format='%(short_name)s'
> )
>
> db.executesql('CREATE INDEX idx_banks_name ON banks (abm_number, 
> (upper(short_name)));')
>
> I've fixed it adding a try for the statement in line 10 but why am I 
> getting this error? I don't think that's how it is supposed to work, of 
> maybe it is for PostgreSQL. 
>
> Thanks in advance :)
>
> J.
>
>

-- 





[web2py] Error in DAL when creating indexes in web2py 2.0.6 with PostgreSQL

2012-09-04 Thread Juan Diego Romero González
Hi. I'm having this error since I update to 2.0.2 when executing 
executesql()
 no results to fetch

7201.
7202.
7203.
7204.
7205.
7206.

7207.
7208.
7209.
7210.

# will hold our finished resultset in a list
data = adapter.cursor.fetchall()
# convert the list for each row into a dictionary so it's
# easier to work with. row['field_name'] rather than row[0]
return [dict(zip(fields,row)) for row in data]
data = adapter.cursor.fetchall()

if fields:
if not isinstance(fields, list):
fields = [fields]
extracted_fields = []

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

# -*- coding: utf-8 -*-

db.define_table('banks',
Field ('abm_number', 
'integer', length=3, notnull=True),
Field ('institution_name', 
'string', notnull=True),
Field ('short_name', 
'string', notnull=True),
format='%(short_name)s'
)

db.executesql('CREATE INDEX idx_banks_name ON banks (abm_number, 
(upper(short_name)));')

I've fixed it adding a try for the statement in line 10 but why am I 
getting this error? I don't think that's how it is supposed to work, of 
maybe it is for PostgreSQL. 

Thanks in advance :)

J.

-- 





[web2py] Re: Responsive website (my first one, built using web2py)

2012-09-04 Thread Neil Harding
The web2py modifications include the 

{{is_mobile=request.user_agent().is_mobile}}
{{def SKYPE(number,phone):}}
{{=number}}
{{return}}


So I can use SKYPE('xxx-xxx-','+1xx') which expands to  to handle that. I use it as 
follows {{=DEFER(URL('static/images','staff.jpg'),'Staff')}} and that 
generates code like

resizeImage(
"/welcome/static/images/","staff.jpg","Staff","") 

You can see the source for resizeImage at the website, but I wrap the image 
in a  tag which opens the full size version of the image (unless it was 
already full size), and loads the image from 1280/ 1024/ 960/ 800/ etc 
directories. This means that mobile devices can be served a lower size 
image to cut down on the bandwidth used, and also allows for the tweaks 
rather than just a straight size reduction such as cropping a particular 
image at lower resolutions.

I added the code for DEFER to html.py as

class DEFER(XmlComponent):


tag = 'IMG'


def __init__(self,url,alt=None,_class=None):
self.url = url
self.text = ' wrapping around the image.

Neil Harding

On Tuesday, September 4, 2012 5:15:47 AM UTC-7, Alan wrote:
>
> responsive layouts are pretty amazing, working through my own design at 
> the moment after following the guide below:
>
>
> http://webdesign.tutsplus.com/tutorials/complete-websites/building-a-responsive-layout-with-skeleton-navigation/
>
> might want to take a look so that the menu alters to a select dropdown to 
> be more mobile friendly.
>
> not sure i get what you mean on modifying web2py, the media screen part of 
> the above tutorial should come in handy for scaled images along with the 
> flexslider code - this is what i intend to do.
>
>

-- 





Re: [web2py] postgres problem at register user ?

2012-09-04 Thread Massimo Di Pierro
That bug was due to web2py and is not fixed in trunk but he seems to have 
another issue and I cannot quite et to the bottom of 
it. http://code.google.com/p/web2py/issues/detail?id=976

On Tuesday, 4 September 2012 16:56:50 UTC-5, Mariano Reingart wrote:
>
> Hi Bogdan: 
>
> It is strange, could you post some code to reproduce the issue? 
> Can you confirm this happens only with the pg8000 driver? 
> If so, please if you can move this to the pg8000 project site: 
>
> https://code.google.com/p/pg8000/issues/entry 
>
> Best regards, 
>
> Mariano Reingart 
> http://www.sistemasagiles.com.ar 
> http://reingart.blogspot.com 
>
>
> On Tue, Sep 4, 2012 at 1:47 PM, Bogdan Buneci > 
> wrote: 
> > Hi there, 
> > 
> > I tried to use postgresql driver pg8000 with postgresql-9.1 but 
> registration 
> > of a new user in the app failed with this error. 
> > 
> >  ('ERROR', 
> '42703', 
> > 'column "email_field" does not exist') 
> > 
> > the sql query that failed: 
> > 
> > 2012-09-04 19:33:48 EEST ERROR:  column "email_field" does not exist at 
> > character 227 
> > 
> > 2012-09-04 19:33:48 EEST STATEMENT:  SELECT  auth_user.id, 
> > auth_user.first_name, auth_user.last_name, auth_user.email, 
> > auth_user.password, auth_user.registration_key, 
> > auth_user.reset_password_key, auth_user.registration_id FROM auth_user 
> WHERE 
> > (auth_user.email = email...@asd.ro ) ORDER BY 
> > auth_user.idLIMIT 1 OFFSET 
> > 0; 
> > 
> > The simple quotes are missing. 
> > 
> > 
> > Thanks, 
> > 
> > Bogdan 
> > 
> > -- 
> > 
> > 
> > 
>

-- 





[web2py] need help testing google checkout with pos plugin

2012-09-04 Thread greaneym
Hello,

I would like to test the google_checkout_plugin and need some help, please.
This are the names of the plugin I downloaded:

web2py.plugin.google_checkout.w2p and web2py.app.PosOnlineStore.w2p

Does this first plugin provide the functionality (of what is described
in the Google developer documentation) of the XML API, which requires a 
"digital signature" and has
integration with the user's database? 

or does the plugin have functionality of the HTML API, with no 
dig.signature and which requires the user
to login to an account on google checkout and look at what purchases
have been made?

I have a sandbox account and am trying to test but get errors.

With the plugin installed and testing on the pos appliance/plugin,
I am not able to get to the google checkout sandbox.  Do I need some type
of digital signature?

Here is the button info that I think google wants people to use:

Here are the contents of my pos/default/index.html file, where I have 
substituted
numbers necessary.

<--pos index info-snip--->

https://checkout.google.com/buttons/buy.gif?merchant_id=digits_of_mysandbox_acctnumber&w=117&h=48&style=white&variant=text&loc=en_US'))}}"
 
/>

https://sandbox.google.com/checkout/api/checkout/v2/checkout/Merchant/mysandboxacctnumber";>

  
  

  
  http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=mysandboxdigitsacctnumber&w=180&h=46&style=white&variant=text&loc=en_US";
   height="46"
   width="180">


I do not see the image of the button, but I see the text "google fast 
checkout" and when I click on that I got a 503 error.
I've made sure that any long lines are continuous and not interrupted by 
spaces or carriage returns.

I appreciate any help. 

Thank you,
Margaret

-- 





Re: [web2py] Re: Checking for upgrades isn't working as I expected (1.99.7 installed)

2012-09-04 Thread Le Don X
Indeed ! ... Bruno is tha Man !

-- 





Re: [web2py] Re: web2py 2.0.2 is out

2012-09-04 Thread curiouslearn
Many thanks to Massimo for creating Web2py and to Massimo and other 
contributors for keeping it going and improving it. I am having fun working 
with it. 

Equally big thanks to Anthony for answering my questions here. I would most 
probably have given up on web2py, had Anthony not helped me with my 
problems.

I have been playing around with Web2py for the last few months and have 
been able to get things done with it. I have so far not used DAL, but now I 
will try and get into that.

Thanks again.


-- 





Re: [web2py] XML Webservice

2012-09-04 Thread Derek
It is XML, but it doesn't have a doctype. So, when it gets to this 
character:  *’*  it fails to validate against UTF-8. It should probably be 
this:  charset=ISO-8859-1 

On Tuesday, September 4, 2012 2:15:11 AM UTC-7, Hassan Alnatour wrote:
>
> Dear ALec , 
>
> when i go to the link i gave you before , i can see some XML data but i 
> dont understand what is the viewing problem you are talking about ? and why 
> wold a table filed interrupter Viewing as XML  as long as i am returning an 
> object that has all the date ?
>
> Best Regards,
>  
> On Sun, Sep 2, 2012 at 12:47 PM, hasan alnator 
> 
> > wrote:
>
>> Dear ALec , 
>>
>> when i go to the link i gave you before , i can see some XML data but i 
>> dont understand what is the viewing problem you are talking about ? and why 
>> wold a table filed interrupter Viewing as XML  as long as i am returning an 
>> object that has all the date ?
>>
>> Best Regards,
>>  
>>
>> On Sun, Sep 2, 2012 at 12:42 PM, Alec Taylor 
>> 
>> > wrote:
>>
>>> Hmm, try lower-case 'description'.
>>>
>>> Otherwise not sure what's causing the XML viewer problem.
>>>
>>> Also nowadays JSON is prefered over XML, as it's much less verbose;
>>> thus has a much lower overhead
>>>
>>> On Sun, Sep 2, 2012 at 7:39 PM, hasan alnator
>>> > wrote:
>>> > Dear Alec ,
>>> >
>>> > What Do you mean with  preprocessing ?
>>> >
>>> > this is my db.py :
>>> >
>>> > # -*- coding: utf-8 -*-
>>> >
>>> > 
>>> #
>>> > ## This scaffolding model makes your app work on Google App Engine too
>>> > ## File is released under public domain and you can use without 
>>> limitations
>>> > 
>>> #
>>> >
>>> > ## if SSL/HTTPS is properly configured and you want all HTTP requests 
>>> to
>>> > ## be redirected to HTTPS, uncomment the line below:
>>> > # request.requires_https()
>>> >
>>> > if not request.env.web2py_runtime_gae:
>>> > ## if NOT running on Google App Engine use SQLite or other DB
>>> > db = DAL('sqlite://storage.sqlite')
>>> > else:
>>> > ## connect to Google BigTable (optional 
>>> 'google:datastore://namespace')
>>> > db = DAL('google:datastore')
>>> > ## store sessions and tickets there
>>> > session.connect(request, response, db = db)
>>> > ## or store session in Memcache, Redis, etc.
>>> > ## from gluon.contrib.memdb import MEMDB
>>> > ## from google.appengine.api.memcache import Client
>>> > ## session.connect(request, response, db = MEMDB(Client()))
>>> >
>>> > ## by default give a view/generic.extension to all actions from 
>>> localhost
>>> > ## none otherwise. a pattern can be 'controller/function.extension'
>>> > response.generic_patterns = ['*'] if request.is_local else []
>>> > ## (optional) optimize handling of static files
>>> > # response.optimize_css = 'concat,minify,inline'
>>> > # response.optimize_js = 'concat,minify,inline'
>>> >
>>> > 
>>> #
>>> > ## Here is sample code if you need for
>>> > ## - email capabilities
>>> > ## - authentication (registration, login, logout, ... )
>>> > ## - authorization (role based authorization)
>>> > ## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)
>>> > ## - old style crud actions
>>> > ## (more options discussed in gluon/tools.py)
>>> > 
>>> #
>>> >
>>> > from gluon.tools import Auth, Crud, Service, PluginManager, prettydate
>>> > auth = Auth(db, hmac_key=Auth.get_or_create_key())
>>> > crud, service, plugins = Crud(db), Service(), PluginManager()
>>> >
>>> > ## create all tables needed by auth if not custom tables
>>> > auth.define_tables()
>>> >
>>> > ## configure email
>>> > mail=auth.settings.mailer
>>> > mail.settings.server = 'logging' or 'smtp.gmail.com:587'
>>> > mail.settings.sender = 'y...@gmail.com '
>>> > mail.settings.login = 'username:password'
>>> >
>>> > ## configure auth policy
>>> > auth.settings.registration_requires_verification = False
>>> > auth.settings.registration_requires_approval = False
>>> > auth.settings.reset_password_requires_verification = True
>>> >
>>> > ## if you need to use OpenID, Facebook, MySpace, Twitter, Linkedin, 
>>> etc.
>>> > ## register with janrain.com, write your domain:api_key in
>>> > private/janrain.key
>>> > from gluon.contrib.login_methods.rpx_account import use_janrain
>>> > use_janrain(auth,filename='private/janrain.key')
>>> >
>>> > 
>>> #
>>> > ## Define your tables below (or better in another model file) for 
>>> example
>>> > ##
>>> > ## >>> db.define_table('mytable',Field('myfield','string'))
>>> > ##
>>> > ## Fields can be 
>>> 'string','text','password','integer','double','boolean'
>>> > ##   'date','time','datetime','blob','upload', 'reference 
>>> TABLENAME'
>>> > ## There is a

[web2py] Re: [Announcement] web2py powered app Vocabilis.NET

2012-09-04 Thread Derek
It would be nice if I (as a language teacher) can invite students to a 
lesson. It looks as it is now, everyone must sign up and create their own 
databases. I'd love to have a student view where I can see where someone is 
in learning, as well as how they are in relation to their peers.

On Tuesday, September 4, 2012 3:48:28 PM UTC-7, Derek wrote:
>
> Looks great, I plan on using this to setup English lessons for my wife 
> (whom is Russian). My only concern is that it's using Flash - she uses only 
> a Tablet computer - touchscreen android device. Html5 would have been a 
> better choice.
>
> Thanks,
> Derek
>
> On Thursday, August 30, 2012 7:53:56 AM UTC-7, Alexei Vinidiktov wrote:
>>
>> Hi,
>>
>> I'm glad to announce the launch of my second web2py powered web 
>> application www.vocabilis.net.
>>
>> It's a flashcard vocabulary builder for language learners.
>>
>> On the front end I use Flex and on the back end I use web2py.
>>
>> To see the app in action you'll need to register on the site. 
>> Registration doesn't require email confirmation at the moment.
>>
>> I'd like to thank the web2py community for all the help I've gotten 
>> working on Vocabilis.NET.
>>
>> Massimo and all the contributors, thank you for creating such an 
>> indispensable tool! 
>>
>> Thanks, guys!
>>
>> -- 
>> Alexei Vinidiktov
>>  
>

-- 





[web2py] Re: [Announcement] web2py powered app Vocabilis.NET

2012-09-04 Thread Derek
Looks great, I plan on using this to setup English lessons for my wife 
(whom is Russian). My only concern is that it's using Flash - she uses only 
a Tablet computer - touchscreen android device. Html5 would have been a 
better choice.

Thanks,
Derek

On Thursday, August 30, 2012 7:53:56 AM UTC-7, Alexei Vinidiktov wrote:
>
> Hi,
>
> I'm glad to announce the launch of my second web2py powered web 
> application www.vocabilis.net.
>
> It's a flashcard vocabulary builder for language learners.
>
> On the front end I use Flex and on the back end I use web2py.
>
> To see the app in action you'll need to register on the site. Registration 
> doesn't require email confirmation at the moment.
>
> I'd like to thank the web2py community for all the help I've gotten 
> working on Vocabilis.NET.
>
> Massimo and all the contributors, thank you for creating such an 
> indispensable tool! 
>
> Thanks, guys!
>
> -- 
> Alexei Vinidiktov
>  

-- 





Re: [web2py] postgres problem at register user ?

2012-09-04 Thread Mariano Reingart
Hi Bogdan:

It is strange, could you post some code to reproduce the issue?
Can you confirm this happens only with the pg8000 driver?
If so, please if you can move this to the pg8000 project site:

https://code.google.com/p/pg8000/issues/entry

Best regards,

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com


On Tue, Sep 4, 2012 at 1:47 PM, Bogdan Buneci  wrote:
> Hi there,
>
> I tried to use postgresql driver pg8000 with postgresql-9.1 but registration
> of a new user in the app failed with this error.
>
>  ('ERROR', '42703',
> 'column "email_field" does not exist')
>
> the sql query that failed:
>
> 2012-09-04 19:33:48 EEST ERROR:  column "email_field" does not exist at
> character 227
>
> 2012-09-04 19:33:48 EEST STATEMENT:  SELECT  auth_user.id,
> auth_user.first_name, auth_user.last_name, auth_user.email,
> auth_user.password, auth_user.registration_key,
> auth_user.reset_password_key, auth_user.registration_id FROM auth_user WHERE
> (auth_user.email = email_fi...@asd.ro) ORDER BY auth_user.id LIMIT 1 OFFSET
> 0;
>
> The simple quotes are missing.
>
>
> Thanks,
>
> Bogdan
>
> --
>
>
>

-- 





[web2py] Re: Centos 5 script for Nginx with Uwsgi and Web2py

2012-09-04 Thread Christian Espinoza
I'm trying step to step now...and only was needed an little changes

El martes, 4 de septiembre de 2012 18:03:16 UTC-3, Christian Espinoza 
escribió:
>
> Hi Alan, I did test this script at a clean Centos 6, and the result is: 502 
> Bad Gateway
> Christian
>
>
> El viernes, 3 de agosto de 2012 20:23:21 UTC-3, Alan Etkin escribió:
>>
>> Updated the script to:
>>
>> - Write port 443 admin password
>> - Create welcome.w2p package (for solving admin create app feature error)
>> - Patch Python2.7.3 code for sqlite3 issue before installing
>>
>> It was tested with a clean CentOS 5.8 vbox and is working. Needs 
>> improvement: it stops a few times for user confirmation
>>
>> El jueves, 2 de agosto de 2012 13:16:18 UTC-3, peter escribió:
>>>
>>> Someone else has provided a script for centos 6. There are plenty of 
>>> webservers out there based on centos 5 I believe because of its stability. 
>>> So it is useful to have a script for Centos 5. Particularly as this seems 
>>> to be the most tricky Linux for web2py because it uses and needs python 2.4
>>> Massimo: it depends how long Alan will take to come up with a tested 
>>> script for python 2.7. A working python2.6 script is better than an almost 
>>> working 2.7 one.
>>>
>>>
>>> Peter
>>>
>>> On Thursday, 2 August 2012 15:22:27 UTC+1, Alan Etkin wrote:

 > The script I attached in my previous email is your script but with 
 python set to be 2.6. I tested this and it works.

 My concern is that 2.7 is said to be the last supported 2.x version of 
 Python. I agree that testing in a raw install saves time and all kinds of 
 issues. I will deploy in a virtual machine and debug the script so I can 
 come back with a working one.

 Shouldn't we provide the working script for the lastest CentOS 
 distribution (which I supposse is not what we are using), instead of 
 basing 
 in a previous one?



-- 





[web2py] Re: Centos 5 script for Nginx with Uwsgi and Web2py

2012-09-04 Thread Christian Espinoza
Hi Alan, I did test this script at a clean Centos 6, and the result is: 502 
Bad Gateway
Christian


El viernes, 3 de agosto de 2012 20:23:21 UTC-3, Alan Etkin escribió:
>
> Updated the script to:
>
> - Write port 443 admin password
> - Create welcome.w2p package (for solving admin create app feature error)
> - Patch Python2.7.3 code for sqlite3 issue before installing
>
> It was tested with a clean CentOS 5.8 vbox and is working. Needs 
> improvement: it stops a few times for user confirmation
>
> El jueves, 2 de agosto de 2012 13:16:18 UTC-3, peter escribió:
>>
>> Someone else has provided a script for centos 6. There are plenty of 
>> webservers out there based on centos 5 I believe because of its stability. 
>> So it is useful to have a script for Centos 5. Particularly as this seems 
>> to be the most tricky Linux for web2py because it uses and needs python 2.4
>> Massimo: it depends how long Alan will take to come up with a tested 
>> script for python 2.7. A working python2.6 script is better than an almost 
>> working 2.7 one.
>>
>>
>> Peter
>>
>> On Thursday, 2 August 2012 15:22:27 UTC+1, Alan Etkin wrote:
>>>
>>> > The script I attached in my previous email is your script but with 
>>> python set to be 2.6. I tested this and it works.
>>>
>>> My concern is that 2.7 is said to be the last supported 2.x version of 
>>> Python. I agree that testing in a raw install saves time and all kinds of 
>>> issues. I will deploy in a virtual machine and debug the script so I can 
>>> come back with a working one.
>>>
>>> Shouldn't we provide the working script for the lastest CentOS 
>>> distribution (which I supposse is not what we are using), instead of basing 
>>> in a previous one?
>>>
>>>

-- 





[web2py] Re: Code editor on the administrative interface

2012-09-04 Thread Massimo Di Pierro
This is now fixed in trunk and I will post 2.0.7 later today. This was a 
symptom of a more serious behavior as some features of components are 
broken in 2.0.6 because of a typo. Now fixed.

On Tuesday, 4 September 2012 12:06:02 UTC-5, caps.i.sin wrote:
>
>
> Dear all,
>
> I have a question about the code editor on the administrative interface :
>
> When I edit a code (for example a controller) I save it with [Ctrl + S].
> If there are any errors on my python code, the field "Last saved on" has a 
> yellow background.
> On my previous web2py version, when I had an error, a popup was displayed 
> with the description of the python error.
>
> So currently if I make a mistake, I know there is an error (yellow 
> background) but I have no more information about the problem.
>
> Is it a normal behaviour? or did I miss something?
> Thank you, and sorry for my bad english
>
>
> My configuration : Web2py 2.03 binaries on Windows 7 pro x64 and Mozilla 
> Firefox 14.0.1
>

-- 





[web2py] Re: Auth Decorator / Model Question.

2012-09-04 Thread Massimo Di Pierro
session[''store.mysite.com'] = session.get('store.mysite.com
',get_store_info('store.mysite.com'))


On Tuesday, 4 September 2012 15:03:10 UTC-5, Kevin C wrote:
>
> The users_id comes from the stores table, and is a foreign key to the 
> web2py users table.  Really the source of it is irrelevant.  
>
> What I need to know is what is the best practice for storing this type of 
> information?  In PHP, I would do something like the following in a global 
> include file:
>
>  if(empty($_SESSION['store.mysite.com'])) {
>   $_SESSION['store.mysite.com'] = get_store_info('store.mysite.com');
> }
> ?>
>
> This would make all of the store info (Including users_id) available to 
> the entire script through the PHP session.  I need to know how to do the 
> equivalent in web2py.  How do I execute a certain block on every page load 
> (IE to check if the store info has been retrieved and stored yet) and then 
> where should I store that info to make it accessible for the rest of the 
> script?
>
> In my limited experience with web2py, I'm thinking I should store the code 
> in a model file and have that code save the store info to a web2py session, 
> but I wanted to get a second opinion before continuing down that path.
>
> I hope I have explained it a little more clearly.
>
> Basically, how do I execute code on every page load and what is the best 
> practice for storing short term data like that?
>
> On Monday, September 3, 2012 10:43:10 PM UTC-5, Kevin C wrote:
>>
>> The title isn't very descriptive, but I hope this paragraph clears things 
>> up.
>>
>> Basically we are creating a basic SaaS app.  Users will log in at 
>> theirname.oursite.com to an administrative panel.  Each administrative 
>> panel is tied to a user ID from the auth table.  So basically here is what 
>> should happen:
>>
>> User visits theirname.oursite.com/admin
>> Web2py retrieves users_id field from stores table (This field assigns 
>> ownership of each store to a user id)
>> Web2py auth decorator should ensure that the logged in user ID is that of 
>> the store owner
>>
>> I understand how to write the decorator, but what is the best way to 
>> retrieve the users_id from the stores table and store it?  Sessions? 
>>  Temporary variable that is set on each page load?
>>
>> Please forgive my ignorance.  I am completely new to web2py and want to 
>> develop using best practices.  I appreciate any guidance you can offer.
>>
>> Thank you.
>>
>

-- 





Re: [web2py] Re: Auth Decorator / Model Question.

2012-09-04 Thread Anthony
Note, sessions are specific to individual users (clients). If you put 
something in session.store.mysite on a given request, it will only be 
available to that specific user, not to anyone who goes to the 
store.mysite.com URL. If you need data accessible to all users store-wide, 
you should put it in the cache.

Anthony

On Tuesday, September 4, 2012 4:26:02 PM UTC-4, Kevin C wrote:
>
> Every store has a unique URL (So store.mysite.com) which will be the key 
> we look up on.  This is why the session trick will work.  Because we are 
> storing the store data for store.site.com in session.store.mysite.com so 
> every store would have a unique session. 
>
> I guess the real question is - Should we just cache this query result or 
> should we store it in a session?  Which way is preferred for Python / 
> web2py development? 
>
> Kevin Cackler 
> Tech Daddies 
> 501-205-1512 
> http://www.techdaddies.com 
>
> On 9/4/2012 3:22 PM, Niphlod wrote: 
> > you can certainly do 
> > 
> > STORE_DETAILS = db(db.stores.user_id == auth.user_id).select() 
> > 
> > in models. 
> > You'd have the variable STORE_DETAILS available in all controllers and 
> > every time a user loads a page the data will be refreshed. 
> > 
> > In order to reduce the db pressure, you can 
> > 
> > STORE_DETAILS = db(db.stores.user_id == 
> > auth.user_id).select(cache=(cache.ram, 60)) 
> > 
> > Doing so, the 2nd select will be fired only if more than 60 seconds 
> > passed from the 1st (i.e. a new page requested by the same user within 
> > 60 seconds will be fetched from the cache and not from the db) 
> > 
> > What you are doing in php works for web2py also: if you are positive 
> > that once a user is logged-in he would get the same stores forever (so 
> > it's not necessary to fetch the data every time you load the page), 
> > you can cache it with a high number or simply store the store details 
> > in session, i.e. 
> > 
> > if not session.store_details: #so it will be fetched one time only, if 
> > no store_details "key" is found on session 
> >   store_details = db(db.stores.user_id == auth.user_id).select() 
> > 
> > Then you'd have to access this data as session.store_details 
> > 
> > That's all if I got it correctly: if I didn't understand please post 
> > more details. 
> > 
> > -- 
> > 
> > 
> > 
>
>

-- 





[web2py] Re: Auth.wiki(). Issue with wiki_page.html compute

2012-09-04 Thread Andrew W
Fixed in patch "fixed update with compute fields (again) and ecomponents in 
markmin"
Thanks Massimo.




On Wednesday, September 5, 2012 2:19:44 AM UTC+12, Andrew W wrote:
>
> (Starting a new post for this issue, mentioned in thread of a "simple 
> wiki")
>
> Issue: 
> On edit of an existing page, the wiki_page.body is being updated 
> correctly, but wiki_page.html does not change, it's compute function does 
> not get called.
>
> I've added some print statements and markmin_render() (the compute 
> functions for page.html) is called on the intial page create, but is not 
> called on subsequent updates - page.html is not getting updated when 
> editing an existing page.
>
> I've never used compute fields  before, I assume it should be automatic ?
>
> - show quoted text -
>
>

-- 





Re: [web2py] Re: Auth Decorator / Model Question.

2012-09-04 Thread Bruno Rocha
cache.ram or even better (memcached) is preferred! if you use session and
your sessions are stored on filesystem, if you have too much data it will
be hard to load on each request.

DATA = cache.ram(request.http_host, lambda: db(..).select(cacheable=True),
86400) # keeps for 24  hours.

Now, on every place where data is changed you can call
cache.ram.clear(regex=None) to reset that cache.

-- 





Re: [web2py] Re: Auth Decorator / Model Question.

2012-09-04 Thread Kevin Cackler
Every store has a unique URL (So store.mysite.com) which will be the key 
we look up on.  This is why the session trick will work.  Because we are 
storing the store data for store.site.com in session.store.mysite.com so 
every store would have a unique session.


I guess the real question is - Should we just cache this query result or 
should we store it in a session?  Which way is preferred for Python / 
web2py development?


Kevin Cackler
Tech Daddies
501-205-1512
http://www.techdaddies.com

On 9/4/2012 3:22 PM, Niphlod wrote:

you can certainly do

STORE_DETAILS = db(db.stores.user_id == auth.user_id).select()

in models.
You'd have the variable STORE_DETAILS available in all controllers and 
every time a user loads a page the data will be refreshed.


In order to reduce the db pressure, you can

STORE_DETAILS = db(db.stores.user_id == 
auth.user_id).select(cache=(cache.ram, 60))


Doing so, the 2nd select will be fired only if more than 60 seconds 
passed from the 1st (i.e. a new page requested by the same user within 
60 seconds will be fetched from the cache and not from the db)


What you are doing in php works for web2py also: if you are positive 
that once a user is logged-in he would get the same stores forever (so 
it's not necessary to fetch the data every time you load the page), 
you can cache it with a high number or simply store the store details 
in session, i.e.


if not session.store_details: #so it will be fetched one time only, if 
no store_details "key" is found on session

  store_details = db(db.stores.user_id == auth.user_id).select()

Then you'd have to access this data as session.store_details

That's all if I got it correctly: if I didn't understand please post 
more details.


--





--





[web2py] Re: Auth Decorator / Model Question.

2012-09-04 Thread Niphlod
you can certainly do

STORE_DETAILS = db(db.stores.user_id == auth.user_id).select()

in models.
You'd have the variable STORE_DETAILS available in all controllers and 
every time a user loads a page the data will be refreshed.

In order to reduce the db pressure, you can 

STORE_DETAILS = db(db.stores.user_id == 
auth.user_id).select(cache=(cache.ram, 60))

Doing so, the 2nd select will be fired only if more than 60 seconds passed 
from the 1st (i.e. a new page requested by the same user within 60 seconds 
will be fetched from the cache and not from the db)

What you are doing in php works for web2py also: if you are positive that 
once a user is logged-in he would get the same stores forever (so it's not 
necessary to fetch the data every time you load the page), you can cache it 
with a high number or simply store the store details in session, i.e.

if not session.store_details: #so it will be fetched one time only, if no 
store_details "key" is found on session
  store_details = db(db.stores.user_id == auth.user_id).select()

Then you'd have to access this data as session.store_details

That's all if I got it correctly: if I didn't understand please post more 
details.

-- 





Re: [web2py] Re: Auth Decorator / Model Question.

2012-09-04 Thread Kevin Cackler
Great, thanks.  I spent the first few days having web2py create our 
database tables from our models and now we're moving on to actual coding.


I am LOVING this framework!

Kevin Cackler
Tech Daddies
501-205-1512
http://www.techdaddies.com

On 9/4/2012 3:18 PM, Anthony wrote:


In my limited experience with web2py, I'm thinking I should store
the code in a model file and have that code save the store info to
a web2py session, but I wanted to get a second opinion before
continuing down that path.


Yes, that's exactly right.

Anthony
--





--





[web2py] Re: Auth Decorator / Model Question.

2012-09-04 Thread Anthony

>
> In my limited experience with web2py, I'm thinking I should store the code 
> in a model file and have that code save the store info to a web2py session, 
> but I wanted to get a second opinion before continuing down that path.
>

Yes, that's exactly right.

Anthony 

-- 





Re: [web2py] Web2Py with real time data

2012-09-04 Thread Shawn McElroy
No I was not. I'll check out the video and let you know. Thanks.
On Sep 4, 2012 12:41 PM, "Richard Vézina" 
wrote:

> Are you aware of comet_messaging.py in gluon/contrib?
>
> There is a video from Bruno that show how use it :
> http://vimeo.com/38972256
>
> It use websocket, so only work with up to date browser.
>
> Richard
>
> On Mon, Sep 3, 2012 at 9:13 PM, luckysmack  wrote:
>
>> I'm curious if anyone has done real time applications in their web apps
>> with web2py. either a whole project or even just components. With the
>> project I am working on, there are aspects of the app which will have close
>> to real time interactivity. Such as live database updates (say 100 users
>> are looking at a football stats page. and one user comments on that page.
>> once the comment saves to the database, the other 99 end users' displays
>> are then updated automagically updated with that new content.). I have seen
>> ways to do this such as twisted and socket,io.
>>
>> So i was hoping to see if anyone around here has done any real-time like
>> features for their apps, and was willing to share what they did to get
>> started.
>>
>> thanks
>>
>> --
>>
>>
>>
>>
>
>  --
>
>
>
>

-- 





[web2py] Re: Auth Decorator / Model Question.

2012-09-04 Thread Kevin C
The users_id comes from the stores table, and is a foreign key to the 
web2py users table.  Really the source of it is irrelevant.  

What I need to know is what is the best practice for storing this type of 
information?  In PHP, I would do something like the following in a global 
include file:



This would make all of the store info (Including users_id) available to the 
entire script through the PHP session.  I need to know how to do the 
equivalent in web2py.  How do I execute a certain block on every page load 
(IE to check if the store info has been retrieved and stored yet) and then 
where should I store that info to make it accessible for the rest of the 
script?

In my limited experience with web2py, I'm thinking I should store the block 
in a model file and store it to a web2py session, but I wanted to get a 
second opinion before continuing down that path.

I hope I have explained it a little more clearly.

Basically, how do I execute code on every page load and what is the best 
practice for storing short term data like that?

On Monday, September 3, 2012 10:43:10 PM UTC-5, Kevin C wrote:
>
> The title isn't very descriptive, but I hope this paragraph clears things 
> up.
>
> Basically we are creating a basic SaaS app.  Users will log in at 
> theirname.oursite.com to an administrative panel.  Each administrative 
> panel is tied to a user ID from the auth table.  So basically here is what 
> should happen:
>
> User visits theirname.oursite.com/admin
> Web2py retrieves users_id field from stores table (This field assigns 
> ownership of each store to a user id)
> Web2py auth decorator should ensure that the logged in user ID is that of 
> the store owner
>
> I understand how to write the decorator, but what is the best way to 
> retrieve the users_id from the stores table and store it?  Sessions? 
>  Temporary variable that is set on each page load?
>
> Please forgive my ignorance.  I am completely new to web2py and want to 
> develop using best practices.  I appreciate any guidance you can offer.
>
> Thank you.
>

-- 





[web2py] Re: Validating form fields manually

2012-09-04 Thread Anthony
For phone and sip address, you could use the IS_MATCH validator with an 
appropriate regular expression defined. Or you could create a custom 
validator.

Bruno covered your other question.

Anthony

On Tuesday, September 4, 2012 3:09:42 PM UTC-4, Daniel Gonzalez wrote:
>
> Hi,
>
> In my application I have a form with (among other data), the following two 
> fields:
>
>- channel: a set with three possible values: "voicemail", "sipaddress" 
>or "phone".
>- destination: a string, the meaningf of which depends on the value of 
>channel.
>
> I have the problem that I attach a validation rule ("require") to the 
> destination field, because the validation rule depends on the value of 
> "channel"
>
> What I would like to do is to leave the validation rule of the destination 
> empty, and then do a manual validation, depending on the value of "channel".
> The rest of the fields would be validated as usual, with form.process(), 
> but the destination would be validated manually.
>
> Something like this:
>
> if form.process().accepted:
> if request.var.channel == 'voicemail': validate requests.var.destination 
> as a mail address.
> elif request.var.channel == 'sipaddress' validate 
> requests.var.destination 
> as a sip address.
> elfi request.var.channel == 'phone' validate requests.var.destination 
> as a telephone number
>
>
> I have two questions:
>
>- has web2py suppot for validation of telephone numbers and sip 
>addresses?
>- how can I manually apply validation rules, so that I can apply 
>complex algorithms as the one described while validating?
>
> Thanks
> Daniel
>

-- 





[web2py] Re: web2py book on github

2012-09-04 Thread Niphlod
sections with code are h1,h2,h3,h4,h5,h6 contained in a div with class 
article containing a code tag.
assuming you want them styled as h1,h2,h3,h4,h5,h6 with no changes in style 
in respect of other h1,h2,h3,h4,h5,h6 the simplest thing is

.article h1 code, .article h2 code, .article h3 code, .article h4 code, 
.article 
h5 code, .article h6 code {
   display: block;
   color : #33;
   border: 0px;
   font-size: inherit;
   background: transparent;
}


On Monday, September 3, 2012 11:37:12 PM UTC+2, Massimo Di Pierro wrote:
>
> The book uses the default web2py style with bootstrap. The section titles, 
> if they contain code are not rendered properly. Could use some help 
> improving the css.
>
> massimo
>
> On Saturday, 1 September 2012 12:00:49 UTC-5, Massimo Di Pierro wrote:
>>
>> The web2py book app has been rewritten 
>>
>>http://www.web2py.com/book
>>
>> and the source of the app and the book itself is now on github
>>
>>https://github.com/mdipierro/web2py-book/tree/master/sources
>>
>> Hopefully this will make it easier to keep it updated. You can just send 
>> me patches. You can also try run it yourself and see how it looks. It is no 
>> more db based. it is file based. The syntax is markmin as documented in the 
>> bok itself. 
>>
>> Massimo
>>
>>
>>
>>
>>

-- 





Re: [web2py] Re: Twitter account for @web2py

2012-09-04 Thread Bruno Rocha
www.facebook.com/web2py

-- 





Re: [web2py] "Tweet this" and web2py forms. How do I design this?

2012-09-04 Thread Pystar
can you point me to any tips or hints? I really appreciate

On Tuesday, September 4, 2012 8:03:08 AM UTC+1, Alec Taylor wrote:
>
> Maybe what you're looking for is a self-populating javascript modal with a 
> "tweet this button".
>
> That should be trivial to implement by appending the write information to 
> the twitter URL. (see share code for correct URL)
> On 31/08/2012 6:42 AM, "Pystar" > wrote:
>
>> But I am only using web2py inbuilt Auth. Can I use Auth and still allow 
>> users grant permission to my app using OAuth? And does the twitter API cap 
>> limit of 100k users count if I do?
>>
>>
>> On Thursday, August 30, 2012 9:36:39 PM UTC+1, rochacbruno wrote:
>>>
>>> It is only possible if you have implemented OAuth and user gave access 
>>> permission for your application. 
>>
>>  -- 
>>  
>>  
>>  
>>
>

-- 





Re: [web2py] How to customize datepicker?

2012-09-04 Thread Richard Vézina
You have this alternative :
http://dev.s-cubism.com/plugin_anytime_widget

Not sure it does 2 months neither.

Richard

On Tue, Sep 4, 2012 at 1:57 AM, lyn2py  wrote:

> I would like to have the date picker display 2 months instead of the
> default 1 month.
> And optionally, change the CSS.
>
> May I know if there if a way to customize datepicker by default or will I
> have to write my own widget?
>
> Thanks!
>
> --
>
>
>
>

-- 





Re: [web2py] Web2Py with real time data

2012-09-04 Thread Richard Vézina
Are you aware of comet_messaging.py in gluon/contrib?

There is a video from Bruno that show how use it : http://vimeo.com/38972256

It use websocket, so only work with up to date browser.

Richard

On Mon, Sep 3, 2012 at 9:13 PM, luckysmack  wrote:

> I'm curious if anyone has done real time applications in their web apps
> with web2py. either a whole project or even just components. With the
> project I am working on, there are aspects of the app which will have close
> to real time interactivity. Such as live database updates (say 100 users
> are looking at a football stats page. and one user comments on that page.
> once the comment saves to the database, the other 99 end users' displays
> are then updated automagically updated with that new content.). I have seen
> ways to do this such as twisted and socket,io.
>
> So i was hoping to see if anyone around here has done any real-time like
> features for their apps, and was willing to share what they did to get
> started.
>
> thanks
>
> --
>
>
>
>

-- 





Re: [web2py] Re: Twitter account for @web2py

2012-09-04 Thread Pystar
whats the link to the web2py facebook page?

On Tuesday, September 4, 2012 8:13:20 PM UTC+1, rochacbruno wrote:
>
> There is a free option..
>
> I manage the web2py facebook page, (also Massimo and Anthony are added as 
> co-managers), facebook can tweet automatically from page --> twitter.
>
> So we can add more people to page management and all publications by page 
> will go to twitter.
>
> Just need to enter there, go to page admin and include web2py twitter 
> account. (Massimo you have admin permissions to do it on the facebook page)
>
> On Tue, Sep 4, 2012 at 4:08 PM, Luther Goh Lu Feng 
> 
> > wrote:
>
>> Oops I am so sorry Massimo. Seems that cotweet became a paid service 
>> earlier this year. Maybe someone can recommend a free alternative?
>>
>>
>> On Tuesday, September 4, 2012 11:57:31 PM UTC+8, Massimo Di Pierro wrote:
>>>
>>> Do not worry. 
>>>
>>> On Tuesday, 4 September 2012 10:26:52 UTC-5, David J wrote:

  Don't tweet commit messages, that is really very annoying.

 Releases are fine.



 On 9/4/12 11:21 AM, Massimo Di Pierro wrote:
  
 I cannot figure out how to sign up for cotweet. :-(

 On Monday, 3 September 2012 15:45:14 UTC-5, Luther Goh Lu Feng wrote: 
>
> I think it is also possible to give trusted and active members of the 
> community access to the twitter account via some service like cotweet.
>
> On Tuesday, September 4, 2012 4:14:02 AM UTC+8, rochacbruno wrote: 
>>
>> You can use 
>> http://feeds.feedburner.**com/web2pyslices
>>  as 
>> source for automatic posts... 
>> also it would be nice to include 
>> web2py.com/download/changelog.**rss(create
>>  it) and use as source to tweet automatically when change log gets 
>> updated.
>> It can also be done with github commits (you can integrate the 
>> account on github --< twitter)
>>
>>
>> On Mon, Sep 3, 2012 at 5:08 PM, Massimo Di Pierro <
>> massimo@gmail.com> wrote:
>>
>>> No particular reason. I am planning to get back to it. Any 
>>> suggestions on how to make it more active? 
>>>
>>>
>>> On Monday, 3 September 2012 14:32:23 UTC-5, Luther Goh Lu Feng 
>>> wrote: 

 I just noticed that the twitter account has been very inactive :o 

  Is there any reason for that? Anyway to improve the situation?

  https://twitter.com/web2py
  
>>> -- 
>>>  
>>>  
>>>  
>>>  
>>  
>>
>>   -- 
  
  
  


   -- 
>>  
>>  
>>  
>>
>
>
>

-- 





Re: [web2py] Updated cheatsheet

2012-09-04 Thread Niphlod
Watching the code, yes.
PS: you can inspect with cache.ram.storage the actual dict cache.

On Tuesday, September 4, 2012 8:33:53 PM UTC+2, rochacbruno wrote:
>
> So I assume cache.ram.clear() will do the job ? 

-- 





Re: [web2py] Validating form fields manually

2012-09-04 Thread Bruno Rocha
this:

def validate_my_form(form)
if form.vars.channel == "foo":
form.errors.channel = "This channel is not valid"

if form.process(onvalidation=validate_my_form).accepted:
# do whatever here




*Bruno Cezar Rocha** - @rochacbruno*
rochacbr...@gmail.com | Mobile: +55 (11) 99210-8821
www.CursoDePython.com.br | www.rochacbruno.com.br
Blog: Using Python to get all the external links from a
webpage
  Get a signature like this.

Click
here.



On Tue, Sep 4, 2012 at 4:09 PM, Daniel Gonzalez  wrote:

> Something like this:
>
> if form.process().accepted:
> if request.var.channel == 'voicemail': validate requests.var.destination
> as a mail address.
> elif request.var.channel == 'sipaddress' validate requests.var.destination
> as a sip address.
> elfi request.var.channel == 'phone' validate requests.var.destination
> as a telephone number
>
>
> I have two questions:
>

-- 





Re: [web2py] Re: Twitter account for @web2py

2012-09-04 Thread Bruno Rocha
There is a free option..

I manage the web2py facebook page, (also Massimo and Anthony are added as
co-managers), facebook can tweet automatically from page --> twitter.

So we can add more people to page management and all publications by page
will go to twitter.

Just need to enter there, go to page admin and include web2py twitter
account. (Massimo you have admin permissions to do it on the facebook page)

On Tue, Sep 4, 2012 at 4:08 PM, Luther Goh Lu Feng  wrote:

> Oops I am so sorry Massimo. Seems that cotweet became a paid service
> earlier this year. Maybe someone can recommend a free alternative?
>
>
> On Tuesday, September 4, 2012 11:57:31 PM UTC+8, Massimo Di Pierro wrote:
>>
>> Do not worry.
>>
>> On Tuesday, 4 September 2012 10:26:52 UTC-5, David J wrote:
>>>
>>>  Don't tweet commit messages, that is really very annoying.
>>>
>>> Releases are fine.
>>>
>>>
>>>
>>> On 9/4/12 11:21 AM, Massimo Di Pierro wrote:
>>>
>>> I cannot figure out how to sign up for cotweet. :-(
>>>
>>> On Monday, 3 September 2012 15:45:14 UTC-5, Luther Goh Lu Feng wrote:

 I think it is also possible to give trusted and active members of the
 community access to the twitter account via some service like cotweet.

 On Tuesday, September 4, 2012 4:14:02 AM UTC+8, rochacbruno wrote:
>
> You can use 
> http://feeds.feedburner.**com/web2pyslices
>  as
> source for automatic posts...
> also it would be nice to include 
> web2py.com/download/changelog.**rss(create
>  it) and use as source to tweet automatically when change log gets
> updated.
> It can also be done with github commits (you can integrate the account
> on github --< twitter)
>
>
> On Mon, Sep 3, 2012 at 5:08 PM, Massimo Di Pierro <
> massimo@gmail.com> wrote:
>
>> No particular reason. I am planning to get back to it. Any
>> suggestions on how to make it more active?
>>
>>
>> On Monday, 3 September 2012 14:32:23 UTC-5, Luther Goh Lu Feng wrote:
>>>
>>> I just noticed that the twitter account has been very inactive :o
>>>
>>>  Is there any reason for that? Anyway to improve the situation?
>>>
>>>  https://twitter.com/web2py
>>>
>> --
>>
>>
>>
>>
>
>
>   --
>>>
>>>
>>>
>>>
>>>
>>>   --
>
>
>
>

-- 





[web2py] Validating form fields manually

2012-09-04 Thread Daniel Gonzalez
Hi,

In my application I have a form with (among other data), the following two 
fields:

   - channel: a set with three possible values: "voicemail", "sipaddress" 
   or "phone".
   - destination: a string, the meaningf of which depends on the value of 
   channel.

I have the problem that I attach a validation rule ("require") to the 
destination field, because the validation rule depends on the value of 
"channel"

What I would like to do is to leave the validation rule of the destination 
empty, and then do a manual validation, depending on the value of "channel".
The rest of the fields would be validated as usual, with form.process(), 
but the destination would be validated manually.

Something like this:

if form.process().accepted:
if request.var.channel == 'voicemail': validate requests.var.destination 
as a mail address.
elif request.var.channel == 'sipaddress' validate requests.var.destination 
as a sip address.
elfi request.var.channel == 'phone' validate requests.var.destination asa 
telephone number


I have two questions:

   - has web2py suppot for validation of telephone numbers and sip 
   addresses?
   - how can I manually apply validation rules, so that I can apply complex 
   algorithms as the one described while validating?

Thanks
Daniel

-- 





Re: [web2py] Re: Twitter account for @web2py

2012-09-04 Thread Luther Goh Lu Feng
Oops I am so sorry Massimo. Seems that cotweet became a paid service 
earlier this year. Maybe someone can recommend a free alternative?

On Tuesday, September 4, 2012 11:57:31 PM UTC+8, Massimo Di Pierro wrote:
>
> Do not worry. 
>
> On Tuesday, 4 September 2012 10:26:52 UTC-5, David J wrote:
>>
>>  Don't tweet commit messages, that is really very annoying.
>>
>> Releases are fine.
>>
>>
>>
>> On 9/4/12 11:21 AM, Massimo Di Pierro wrote:
>>  
>> I cannot figure out how to sign up for cotweet. :-(
>>
>> On Monday, 3 September 2012 15:45:14 UTC-5, Luther Goh Lu Feng wrote: 
>>>
>>> I think it is also possible to give trusted and active members of the 
>>> community access to the twitter account via some service like cotweet.
>>>
>>> On Tuesday, September 4, 2012 4:14:02 AM UTC+8, rochacbruno wrote: 

 You can use http://feeds.feedburner.com/web2pyslices as source for 
 automatic posts... 
 also it would be nice to include web2py.com/download/changelog.rss(create 
 it) and use as source to tweet automatically when change log gets 
 updated.
 It can also be done with github commits (you can integrate the account 
 on github --< twitter)


 On Mon, Sep 3, 2012 at 5:08 PM, Massimo Di Pierro <
 massimo@gmail.com> wrote:

> No particular reason. I am planning to get back to it. Any suggestions 
> on how to make it more active? 
>
>
> On Monday, 3 September 2012 14:32:23 UTC-5, Luther Goh Lu Feng wrote: 
>>
>> I just noticed that the twitter account has been very inactive :o 
>>
>>  Is there any reason for that? Anyway to improve the situation?
>>
>>  https://twitter.com/web2py
>>  
> -- 
>  
>  
>  
>  
  

   -- 
>>  
>>  
>>  
>>
>>
>>  

-- 





[web2py] Re: internal error crash with newest 2.0.6 and old 1.99.2

2012-09-04 Thread lucas
yes, i mean ticket, sorry.  should i just delete the session manually or 
should i do it programmatically?

-- 





Re: [web2py] Updated cheatsheet

2012-09-04 Thread Bruno Rocha
So I assume cache.ram.clear() will do the job ?

-- 





[web2py] Re: internal error crash with newest 2.0.6 and old 1.99.2

2012-09-04 Thread Massimo Di Pierro
When you say crash you meat a ticket, right?  Try delete all of your 
session files.

On Tuesday, 4 September 2012 13:11:23 UTC-5, lucas wrote:
>
> well, i am still having this fatal crash after login.  i simplified my 
> code, especially in layout.html to remove all instances of db, auth, and 
> session.  or checking for not None if i must like in session.  i also 
> scanned and checked index() and other start up pages or functions.  are 
> there anymore possible areas of danger i should be looking for because this 
> instability is pretty bad?  also, i think it may happen when cookies are 
> clear or wrong, but i am not sure of this for sure.  lucas

-- 





Re: [web2py] Updated cheatsheet

2012-09-04 Thread Niphlod
regex is applied with "match". 
"clear all the keys", i.e., match everything, is achieved with ".*" (for 
the regex "undergrads", "." means anything, "*" means repeated >= times).
In the code there is a special case for clear(regex=None): it will delete 
all keys, without scanning all keys one by one and matching the regex (at 
least in cache.ram and cache.disk implementations)


On Tuesday, September 4, 2012 7:50:20 PM UTC+2, rochacbruno wrote:
>
>
> Small question..
>
> cache.ram.clear(regex='*')  will clear the whole cache?
>

-- 





[web2py] Re: Could we add testRunner capabilities to admin testing interface?

2012-09-04 Thread Massimo Di Pierro
Perhaps this can help. In your models:

if request.function == '_TEST':
   db = DAL('sqlite://testdb.sqlite')
else:
   db = DAL('sqlite://production.sqlite')


On Tuesday, 4 September 2012 12:08:26 UTC-5, Marek Mollin wrote:
>
> Hey,
> I really love testing in admin. I mean its out-of-thebox zero conf one 
> click doctesting. I love it.
> I dont have to get into massive unittest module(which is great, but for 
> differently scoped applications).
>
> However there is one thing I love in testRunner. The ability to replicate 
> a db and perform all operations with testing database. 
> I was wondering if there its an option to add it as deafult. I guess its a 
> safe convention to assume that you test things on cloned database.
>
> Right now I have to run testRunner solely for this purpose even though 
> doctest would suffice.
>
> I was outside patching web2py but this irritates me strongly enough so 
> that I might try to contribute.
> Just wondering if its an option or there is some backward-comp?
>

-- 





[web2py] Re: Code editor on the administrative interface

2012-09-04 Thread Massimo Di Pierro
Please open a ticket and we will try restore previous behavior


On Tuesday, 4 September 2012 12:06:02 UTC-5, caps.i.sin wrote:
>
>
> Dear all,
>
> I have a question about the code editor on the administrative interface :
>
> When I edit a code (for example a controller) I save it with [Ctrl + S].
> If there are any errors on my python code, the field "Last saved on" has a 
> yellow background.
> On my previous web2py version, when I had an error, a popup was displayed 
> with the description of the python error.
>
> So currently if I make a mistake, I know there is an error (yellow 
> background) but I have no more information about the problem.
>
> Is it a normal behaviour? or did I miss something?
> Thank you, and sorry for my bad english
>
>
> My configuration : Web2py 2.03 binaries on Windows 7 pro x64 and Mozilla 
> Firefox 14.0.1
>

-- 





[web2py] Re: web2py 2.0.6 getting table fields

2012-09-04 Thread Anthony
Even before 2.0, this probably would have been the preferred way to do it:

(db.foo[field] for field in db.foo.fields)

Anthony

On Tuesday, September 4, 2012 1:44:51 PM UTC-4, lcamara wrote:
>
> Hey,
>
> With 1.99.7 I was using this code to get all of the table fields:
>
> table_foo_fields = (db.foo.get(field) for field in db.foo.fields)
>
> I did this because I wanted to inspect the fields, to know if a field was 
> writable, etc.
>
> Now I get:
>
> AttributeError: 'Table' object has no attribute 'get'
>
>
> I realize web2py takes backwards compatibility very seriously so I'm sure 
> this will get fixed, but in the mean time if there's a new and better way 
> to do this, I wouldn't mind knowing about it.
>
> Thanks
>
>

-- 





[web2py] Re: Updated cheatsheet

2012-09-04 Thread apps in tables
We all respect your copyleft.

On Tuesday, September 4, 2012 6:12:03 PM UTC+3, Massimo Di Pierro wrote:
>
> http://web2py.com/examples/static/web2py_cheatsheet.pdf
>

-- 





[web2py] Re: internal error crash with newest 2.0.6 and old 1.99.2

2012-09-04 Thread lucas
well, i am still having this fatal crash after login.  i simplified my 
code, especially in layout.html to remove all instances of db, auth, and 
session.  or checking for not None if i must like in session.  i also 
scanned and checked index() and other start up pages or functions.  are 
there anymore possible areas of danger i should be looking for because this 
instability is pretty bad?  lucas

-- 





[web2py] Re: unique and notnull options not applies to foreign key field

2012-09-04 Thread Anthony

>
> db.define_table('contract',
> Field('num', unique=True, notnull=True'),
> ...
>
> db.define_table('student',
> Field('contract', db.contract, unique=True, notnull=True, 
> label='Договор'),
>
> But unique and notnull options doesnt reflects in database.
>
> In generally, how I can make one to one relation? I've tried the following 
> approach:
>
> db.student.contract.requires = IS_NOT_IN_DB(db, 'student.contract')
> db.student.contract.requires = IS_IN_DB(db, db.contract.id, '%(num)s')
>
> but the first requirements (IS_NOT_IN_DB) doesn't work.
>

Above, first you set the requires attribute to the IS_NOT_IN_DB validator, 
but then you change the attribute and instead set it to the IS_IN_DB 
validator. It's not that IS_NOT_IN_DB isn't working -- the problem is that 
it is no longer one of the field's validators. If you want multiple 
validators, put them in a list (see 
http://web2py.com/books/default/chapter/29/07#Validators).

Also, if there is only one student per contract and one contract per 
student, why not just put everything in one table?

Anthony
 

-- 





Re: [web2py] Re: Bootstrap and custom forms and widgets

2012-09-04 Thread Anthony
I don't think it's a bug. The submit button is in a div with class 
"form-actions", and bootstrap.css defines the background color of that 
class as whiteSmoke. You can override that with your own CSS rule for the 
"form-actions" class.

Anthony

On Tuesday, September 4, 2012 1:18:13 PM UTC-4, Alec Taylor wrote:
>
> Thanks, in that case I think I've found a bug in that formstyle setting.
>
> Around my submit button it has drawn a white rectangle; I've been able to 
> extract it into a test-case:  http://jsfiddle.net/AlecTaylor/7whPt/ 
>
> On Tue, Sep 4, 2012 at 11:09 PM, Anthony  >wrote:
>
>> Also, you can now create your own formstyle function, which should take 
>> the form object and a list of field tuples (each field tuple includes the 
>> id, label, controls, and comment for the field) and return the DOM you want 
>> displayed in the form (i.e., the part that goes inside ). 
>> Internally, this is how all the formstyles now work (each has its own 
>> function). To see how they work, check out the code: 
>> http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#651.
>>
>> Anthony
>>
>>
>> On Tuesday, September 4, 2012 7:49:45 AM UTC-4, Anthony wrote:
>>>
>>> For Crud, it's a setting:
>>>  
>>> crud.settings.formstyle = 'bootstrap'
>>>
>>> Anthony
>>>
>>> On Tuesday, September 4, 2012 5:36:55 AM UTC-4, Alec Taylor wrote:

 Unfortunately that didn't work:
  create() got an unexpected keyword 
 argument 'formstyle'  update() got an 
 unexpected keyword argument 'formstyle'

 On Tue, Sep 4, 2012 at 7:31 PM, Niphlod  wrote:

> should be formstyle='bootstrap', the same way you use formstyle=divs , 
> ul, etc
>
> Il giorno martedì 4 settembre 2012 10:34:07 UTC+2, Alec Taylor ha 
> scritto:
>>
>> Thanks, but I can't seem to find anything in the release about how to 
>> use bootstrap with forms:  https://groups.google.com/**foru**
>> m/#!topic/web2py/**0Uk5b34LUsc
>>  
>>
>> (Note that I'm using crud.create and crud.update)
>>
>> On Tue, Sep 4, 2012 at 5:45 PM, Niphlod  wrote:
>>
>>> the code is out there on 
>>> github.com/niphlod/w2p_**tvserie**s,
>>>  
>>> but included in web2py 2.0.6 there is other code for 
>>> bootstrap-compatible 
>>> forms
>>>
>>> Il giorno martedì 4 settembre 2012 05:03:59 UTC+2, Alec Taylor ha 
>>> scritto:
>>>
 Hi Niphlod,

 Now that web2py 2 has been released, could you release the code for 
 your form manipulation?

 Thanks a heap,

 Alec taylor

 On Sunday, May 20, 2012 2:48:57 AM UTC+10, Niphlod wrote:
>
> me too, but in a different way.
>
> I'm working on an app and waiting for web2py 2.0 to release it to 
> the public.
> It contains a function able to serialize form in "bootstrap" 
> styles (i.e. form-horizontal, form-vertical, form-inline) 
> With some additional work maybe that could be included to provide 
> more than the current 'table3cols', 'table2cols', 'divs', 'ul' styles 
> of 
> the forms.
>
> Right now it's called into the view, i.e.:
>
> {{=twitter_form(form, 'form-vertical')}}
>
> Il giorno sabato 19 maggio 2012 11:10:30 UTC+2, Pystar ha scritto:
>>
>> Hi matt,
>> I have been working extensively with bootstrap with web2py and I 
>> can say the approach you are taking is the best way. 
>>
>> This is my solution
>>
>> #controller###**#3
>>
>> form = SQLFORM(db.blahblah)
>> if form.accepts(request, session, hideerrror=True):
>> blahblah
>>
>> the hideerror=True is what does the magic.
>> It prevents your forms from displaying the error messages in the 
>> default position which is below the form field.
>>
>> In your views, you can now display your error messages by doing
>>
>> {{=form.**errors["post"]}}
>>  
>> make sure you put the above in a conditional IF, ElSE block or 
>> else the errors will be displayed whether you have errors in your 
>> form or 
>> not
>>
>> On Sunday, May 13, 2012 4:35:52 AM UTC+1, Matt wrote:
>>>
>>> Hi Everybody,
>>>
>>> I'm using bootstrap for a project with web2py.
>>>
>>> I want to create forms that mirror the standard approach taken 
>>> by the bootstrap framework.
>>>
>>>  They wrap each "control" like so:
>>>
>>>   
>>> Input with 
>>> error
>>> 
>>>   
>>>   Please correct the 

Re: [web2py] Updated cheatsheet

2012-09-04 Thread Bruno Rocha
Small question..

cache.ram.clear(regex='*')  will clear the whole cache?

-- 





[web2py] unique and notnull options not applies to foreign key field

2012-09-04 Thread Denis Rykov
I would like make one to one tables relation. For example:

db.define_table('contract',
Field('num', unique=True, notnull=True'),
...

db.define_table('student',
Field('contract', db.contract, unique=True, notnull=True, 
label='Договор'),

But unique and notnull options doesnt reflects in database.

In generally, how I can make one to one relation? I've tried the following 
approach:

db.student.contract.requires = IS_NOT_IN_DB(db, 'student.contract')
db.student.contract.requires = IS_IN_DB(db, db.contract.id, '%(num)s')

but the first requirements (IS_NOT_IN_DB) doesn't work.


-- 





[web2py] web2py 2.0.6 getting table fields

2012-09-04 Thread lcamara
Hey,

With 1.99.7 I was using this code to get all of the table fields:

table_foo_fields = (db.foo.get(field) for field in db.foo.fields)

I did this because I wanted to inspect the fields, to know if a field was 
writable, etc.

Now I get:

AttributeError: 'Table' object has no attribute 'get'


I realize web2py takes backwards compatibility very seriously so I'm sure 
this will get fixed, but in the mean time if there's a new and better way 
to do this, I wouldn't mind knowing about it.

Thanks

-- 





[web2py] required option in Field

2012-09-04 Thread Denis Rykov
I use the following Field definition:

Field('admin_unit', required=True, label='Region'),

But when I create new row through smartgrid interface and leave this field 
empty - validation error not appears and record creates in database. If see 
table in database you can see that 'admin_unit' field contains empty string 
(''). Is it correct? It looks like required options doesn't work properly.

-- 





[web2py] postgres problem at register user ?

2012-09-04 Thread Bogdan Buneci
 

Hi there,

I tried to use postgresql driver pg8000 with postgresql-9.1 but 
registration of a new user in the app failed with this error.

* ('ERROR', '42703', 
'column "email_field" does not exist')*

the sql query that failed:

2012-09-04 19:33:48 EEST ERROR:  column "email_field" does not exist at 
character 227

2012-09-04 19:33:48 EEST STATEMENT: * SELECT  auth_user.id, 
auth_user.first_name, auth_user.last_name, auth_user.email, 
auth_user.password, auth_user.registration_key, 
auth_user.reset_password_key, auth_user.registration_id FROM auth_user 
WHERE (auth_user.email = email_fi...@asd.ro) ORDER BY auth_user.id LIMIT 1 
OFFSET 0;*

The simple quotes are missing.


Thanks,

Bogdan

-- 





Re: [web2py] Re: Bootstrap and custom forms and widgets

2012-09-04 Thread Alec Taylor
Thanks, in that case I think I've found a bug in that formstyle setting.

Around my submit button it has drawn a white rectangle; I've been able to
extract it into a test-case:  http://jsfiddle.net/AlecTaylor/7whPt/

On Tue, Sep 4, 2012 at 11:09 PM, Anthony  wrote:

> Also, you can now create your own formstyle function, which should take
> the form object and a list of field tuples (each field tuple includes the
> id, label, controls, and comment for the field) and return the DOM you want
> displayed in the form (i.e., the part that goes inside ).
> Internally, this is how all the formstyles now work (each has its own
> function). To see how they work, check out the code:
> http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#651.
>
> Anthony
>
>
> On Tuesday, September 4, 2012 7:49:45 AM UTC-4, Anthony wrote:
>>
>> For Crud, it's a setting:
>>
>> crud.settings.formstyle = 'bootstrap'
>>
>> Anthony
>>
>> On Tuesday, September 4, 2012 5:36:55 AM UTC-4, Alec Taylor wrote:
>>>
>>> Unfortunately that didn't work:
>>>  create() got an unexpected keyword
>>> argument 'formstyle'  update() got an
>>> unexpected keyword argument 'formstyle'
>>>
>>> On Tue, Sep 4, 2012 at 7:31 PM, Niphlod  wrote:
>>>
 should be formstyle='bootstrap', the same way you use formstyle=divs ,
 ul, etc

 Il giorno martedì 4 settembre 2012 10:34:07 UTC+2, Alec Taylor ha
 scritto:
>
> Thanks, but I can't seem to find anything in the release about how to
> use bootstrap with forms:  https://groups.google.com/**foru**
> m/#!topic/web2py/**0Uk5b34LUsc
>
>
> (Note that I'm using crud.create and crud.update)
>
> On Tue, Sep 4, 2012 at 5:45 PM, Niphlod  wrote:
>
>> the code is out there on 
>> github.com/niphlod/w2p_**tvserie**s,
>> but included in web2py 2.0.6 there is other code for bootstrap-compatible
>> forms
>>
>> Il giorno martedì 4 settembre 2012 05:03:59 UTC+2, Alec Taylor ha
>> scritto:
>>
>>> Hi Niphlod,
>>>
>>> Now that web2py 2 has been released, could you release the code for
>>> your form manipulation?
>>>
>>> Thanks a heap,
>>>
>>> Alec taylor
>>>
>>> On Sunday, May 20, 2012 2:48:57 AM UTC+10, Niphlod wrote:

 me too, but in a different way.

 I'm working on an app and waiting for web2py 2.0 to release it to
 the public.
 It contains a function able to serialize form in "bootstrap" styles
 (i.e. form-horizontal, form-vertical, form-inline) 
 With some additional work maybe that could be included to provide
 more than the current 'table3cols', 'table2cols', 'divs', 'ul' styles 
 of
 the forms.

 Right now it's called into the view, i.e.:

 {{=twitter_form(form, 'form-vertical')}}

 Il giorno sabato 19 maggio 2012 11:10:30 UTC+2, Pystar ha scritto:
>
> Hi matt,
> I have been working extensively with bootstrap with web2py and I
> can say the approach you are taking is the best way.
>
> This is my solution
>
> #controller###**#3
>
> form = SQLFORM(db.blahblah)
> if form.accepts(request, session, hideerrror=True):
> blahblah
>
> the hideerror=True is what does the magic.
> It prevents your forms from displaying the error messages in the
> default position which is below the form field.
>
> In your views, you can now display your error messages by doing
>
> {{=form.**errors["post"]}}
>
> make sure you put the above in a conditional IF, ElSE block or
> else the errors will be displayed whether you have errors in your 
> form or
> not
>
> On Sunday, May 13, 2012 4:35:52 AM UTC+1, Matt wrote:
>>
>> Hi Everybody,
>>
>> I'm using bootstrap for a project with web2py.
>>
>> I want to create forms that mirror the standard approach taken by
>> the bootstrap framework.
>>
>>  They wrap each "control" like so:
>>
>>   
>> Input with
>> error
>> 
>>   
>>   Please correct the
>> error
>>   A comment for the field goes
>> here.
>> 
>>   
>>
>> Since this is custom code I using form.custom and form.fields for
>> output the HTML myself.
>>
>> One small problem I've run up against in that when I do the
>> following:
>>
>> {{= form.custom.widget.full_name }}
>>
>> If there is a form _error_ the following is output:
>>
>

Re: [web2py] Re: Checking for upgrades isn't working as I expected (1.99.7 installed)

2012-09-04 Thread Mandar Vaze
Bruno : Thanks for the tip.

The "upgrade" was broken (for me at least) on 2.0.2 
I didn't get notification to upgrade to 2.0.6 (It would remain stuck in 
"checking for upgrades")
Your suggestion worked well.

-Mandar

On Tuesday, September 4, 2012 4:45:27 AM UTC+5:30, rochacbruno wrote:
>
> If you have access to files (ssh or ftp) you can try to edit this line
>
>  File "...web2py/applications/admin/controllers/default.py" 
> , line 
> 113, in check_version
>
>
>
> + XML(' %s' % version_number)
>
>
>
> and change to
>
>
> + XML(' %s' % 
> str(version_number))
>
>
>
> Including str(version_number) and saving, now you can try to click on check 
> for upgrade and it will work!
>
>  

-- 





[web2py] Could we add testRunner capabilities to admin testing interface?

2012-09-04 Thread Marek Mollin
Hey,
I really love testing in admin. I mean its out-of-thebox zero conf one 
click doctesting. I love it.
I dont have to get into massive unittest module(which is great, but for 
differently scoped applications).

However there is one thing I love in testRunner. The ability to replicate a 
db and perform all operations with testing database. 
I was wondering if there its an option to add it as deafult. I guess its a 
safe convention to assume that you test things on cloned database.

Right now I have to run testRunner solely for this purpose even though 
doctest would suffice.

I was outside patching web2py but this irritates me strongly enough so that 
I might try to contribute.
Just wondering if its an option or there is some backward-comp?

-- 





[web2py] Code editor on the administrative interface

2012-09-04 Thread caps.i.sin

Dear all,

I have a question about the code editor on the administrative interface :

When I edit a code (for example a controller) I save it with [Ctrl + S].
If there are any errors on my python code, the field "Last saved on" has a 
yellow background.
On my previous web2py version, when I had an error, a popup was displayed 
with the description of the python error.

So currently if I make a mistake, I know there is an error (yellow 
background) but I have no more information about the problem.

Is it a normal behaviour? or did I miss something?
Thank you, and sorry for my bad english


My configuration : Web2py 2.03 binaries on Windows 7 pro x64 and Mozilla 
Firefox 14.0.1

-- 





[web2py] Re: Display Image

2012-09-04 Thread BlueShadow
Its working fine now. So I thought why not expand it create a thumbnail and 
displaying it. to reduce loading speed of the website.
So I used this nice code from web2py slices:

def makeThumbnail(dbtable,ImageID,size=(150,150)):
try:
thisImage=db(dbtable.id==ImageID).select()[0]
import os, uuid
from PIL import Image
except: return
im=Image.open(request.folder + 'uploads/' + thisImage.image)
im.thumbnail(size,Image.ANTIALIAS)
thumbName='uploads.thumb.%s.jpg' % (uuid.uuid4())
im.save(request.folder + 'uploads/' + thumbName,'jpeg')
thisImage.update_record(thumb=thumbName)
return 

def uploadimage():
dbtable = db.images  #images table name
if len(request.args):
records = db(dbtable.id==request.args[0]).select()
if len(request.args) and len(records):
form = SQLFORM(dbtable, records[0], deletable=True)
else:
form = SQLFORM(dbtable)
if form.accepts(request.vars, session): 
response.flash = 'form accepted'
makeThumbnail(dbtable,form.vars.id,(175,175))
elif form.errors:
response.flash = 'form has errors'
## Quick list just to demonstrate...
list = crud.select(dbtable)
return dict(form=form,list=list)
and I added: this to my Image table:
Field('thumb','upload',writable=False,readable=False),
The thumbnail appears in the folder upload as I expected the Image displays  
but when I want to display the thumbnail. I get no image at all even though the 
origianl displays the db entry for thumbnail is correct.
can anyone help I just have no clue why it wouldn't display.
to display I used 
{{=IMG(_src=URL('download',args=Article.TopImage.thumb),_style="display:block;")}}



-- 





[web2py] Re: Updated cheatsheet

2012-09-04 Thread stefaan
Very useful! Thanks.

(p.s. I noticed a small typo:  "VirutualHost" instead of "VirtualHost" in 
two places)

-- 





[web2py] Re: SQLFORM.grid CSS help

2012-09-04 Thread Niphlod
I'll try to work that out but it's gonna take more time.

Il giorno martedì 4 settembre 2012 17:19:16 UTC+2, Massimo Di Pierro ha 
scritto:
>
> People are not supposed to update static files in old apps, that is why 
> the grid contains alignment info but not other style info. On the other 
> side we do not guaranteed backward compatibility for the grid look and feel.
>
> It should be possible to generate a grid console with the right alignment 
> (perhaps not the right padding, colors, button) that works with every style.
>
> On Tuesday, 4 September 2012 02:40:42 UTC-5, Niphlod wrote:
>>
>> the thing here is: are web2py.css, web2py.js, appadmin.html, appadmin.py 
>> files that needs updating when you update the framework or not ? This kind 
>> of problem keeps popping up all the time because of styling incompatibility.
>>
>> Il giorno lunedì 3 settembre 2012 23:19:32 UTC+2, Massimo Di Pierro ha 
>> scritto:
>>>
>>> You are right but now I am running into another problem...
>>>
>>> I am using a grid on an older 1.99.7 apps using skeleton. The console is 
>>> messed up badly, even after replacing web2py.css. There should be a way to 
>>> make this work that does not break the 1.99.7 scaffolding apps.
>>>
>>> Massimo
>>>
>>> On Monday, 3 September 2012 14:44:26 UTC-5, Niphlod wrote:

 that should definitely not happen. tested on ff and chromium.
 that happened before I switched from
 .web2py_console form {
 width: 100%;
 display: inline;
 vertical-align: middle;
 margin: 0 0 0 5px;
 }
 to 
 .web2py_console form {
 width: 100%;
 display: inline-block;
 vertical-align: middle;
 margin: 0 0 0 5px;
 }
 Can you please check if "form" is displayed as inline-block ? (maybe 
 refresh your browser cache...)

 On Monday, September 3, 2012 9:39:58 PM UTC+2, Massimo Di Pierro wrote:
>
> When I click on the [input] search field, and the popup appears, the 
> [add] button moves to the right of the popup. :-(
>
>
> On Monday, 3 September 2012 14:24:26 UTC-5, Niphlod wrote:
>>
>> gotcha, but I can't do without modifyng sqlhtml.py
>>
>> Added also a few px of margin to align "search" and "clear" to the 
>> input, made it look similar to the "add, back & Co.", enlarged the 
>> search 
>> input a little bit (a requirement from all my users)
>>
>> On Monday, September 3, 2012 9:12:00 PM UTC+2, Massimo Di Pierro 
>> wrote:
>>>
>>> No always two rows, no cols but "records found" should be on the 
>>> same row as [add] but right-aligned.
>>>
>>> On Monday, 3 September 2012 13:54:18 UTC-5, Niphlod wrote:

 you mean "always two rows, with two columns every row", i.e. always:

 row1-col1: input  row1-col2:search clear
 row2-col1: addrow2-col2: records found

 ? 

 On Monday, September 3, 2012 8:17:51 PM UTC+2, Massimo Di Pierro 
 wrote:
>
> Right now the gird console (defined in sqlhtml.py) looks like
>
> [add] [input ] [search] [clear]
> [hidden popup]
> (records found ...)
>  
> but some times it shows up as
>
> [add]
> [input ...] [search] [clear]
> [hidden popup]
> (records found ...)
>
> I would like it to consistently look like this
>
> [input ...] [search] [clear]
> [hidden popup]
> [add]  (records found ...)
>
> always to cols with popup in between, never 3 cols.
>
> Can somebody help with this?
>
>
>

-- 





Re: [web2py] Re: Twitter account for @web2py

2012-09-04 Thread Massimo Di Pierro
Do not worry. 

On Tuesday, 4 September 2012 10:26:52 UTC-5, David J wrote:
>
>  Don't tweet commit messages, that is really very annoying.
>
> Releases are fine.
>
>
>
> On 9/4/12 11:21 AM, Massimo Di Pierro wrote:
>  
> I cannot figure out how to sign up for cotweet. :-(
>
> On Monday, 3 September 2012 15:45:14 UTC-5, Luther Goh Lu Feng wrote: 
>>
>> I think it is also possible to give trusted and active members of the 
>> community access to the twitter account via some service like cotweet.
>>
>> On Tuesday, September 4, 2012 4:14:02 AM UTC+8, rochacbruno wrote: 
>>>
>>> You can use http://feeds.feedburner.com/web2pyslices as source for 
>>> automatic posts... 
>>> also it would be nice to include web2py.com/download/changelog.rss(create 
>>> it) and use as source to tweet automatically when change log gets 
>>> updated.
>>> It can also be done with github commits (you can integrate the account 
>>> on github --< twitter)
>>>
>>>
>>> On Mon, Sep 3, 2012 at 5:08 PM, Massimo Di Pierro >> > wrote:
>>>
 No particular reason. I am planning to get back to it. Any suggestions 
 on how to make it more active? 


 On Monday, 3 September 2012 14:32:23 UTC-5, Luther Goh Lu Feng wrote: 
>
> I just noticed that the twitter account has been very inactive :o 
>
>  Is there any reason for that? Anyway to improve the situation?
>
>  https://twitter.com/web2py
>  
 -- 
  
  
  
  
>>>  
>>>
>>>   -- 
>  
>  
>  
>
>
>  

-- 





Re: [web2py] Re: web2py 2.0.6 and JqueryUI

2012-09-04 Thread Kevin Miller
Ok I found my problem that I spoke of earler. It was the version of jquery.
I was using jquery 1.7.2 before with no problems.
When I upgraded to web2py 2.0.6, it came with Jquery 1.8.0 and that was
causing the problem. So I just copied the older version jquery and all is
ok for now.
JQuery UI 1.8.16.

These versions were compatible for me, so you might want to check if all
versions are compatible.





On Tue, Sep 4, 2012 at 2:27 AM, Annet  wrote:

> The issue has something to do with web2py.
>
> In 1.99.7
> jQuery 1.7.1
> jQuery UI 1.8.20
>
> ... the date and auto complete field do work:
>
>  class="date hasDatepicker">
>
>  type="text" value="" name="locality" autocomplete="off" role="textbox"
> aria-autocomplete="list" aria-haspopup="true">
>
>
> In 2.0.6
> jQuery 1.7.1
> jQuery UI 1.8.20
>
> ... (same code, different web2py version) the date and autocomplete field
> do not work when they are in the same form.
>
>  class="date input-xlarge hasDatepicker">
>
>
>  class="input-xlarge string">
>
>
> I have no idea why.
>
>
> Kind regards,
>
> Annet
>
>
>
>
>
>
> On Tuesday, 4 September 2012 06:43:28 UTC+2, Annet wrote:
>>
>>
>> Version of jQuery bundled with web2py welcome app has changed between
>>> 1.99.x and 2.0.x, so if you're upgrading your existing app in any way, this
>>> might be a factor too.
>>>
>>
>> Thanks for your reply, you're right I had to update jQuery UI form 1.8.20
>> to 1.8..23 to fix the issue.
>>
>> I am having another issue with jQuery UI. When a form contains both a
>> date and an autocomplete field the calendar breaks the autocomplete, i.e.
>> none of the autocomplete fields are rendered as autocomplete:
>>
>> > class="input-xlarge string">
>>
>> ... where I expect:
>>
>> > class="input-xlarge string ui-autocomplete-input" autocomplete="off"
>> role="textbox" aria-autocomplete="list" aria-haspopup="true">
>>
>>
>> I know this is not related to web2py, but maybe you know whether there's
>> a fix for this issue.
>>
>>
>> Kind regards,
>>
>> Annet
>>
>>
>  --
>
>
>
>

-- 





Re: [web2py] Can't Import library

2012-09-04 Thread Anthony
The binary version of web2py includes its own Python interpreter, so it 
doesn't use your machine's Python and doesn't see any modules installed 
there. If you run web2py from source, you can take advantage of everything 
in your machine's Python installation.

Anthony

On Tuesday, September 4, 2012 11:15:22 AM UTC-4, BlueShadow wrote:
>
> the binary
>
> On Tuesday, September 4, 2012 4:42:21 PM UTC+2, Marin Pranjić wrote:
>>
>> Do you use web2py source code or windows binary?
>>
>> On Tue, Sep 4, 2012 at 4:33 PM, BlueShadow  wrote:
>>
>>> Hi,
>>> I like to import the PIL library in My web2py application. I did install 
>>> it under my windows mashine. when I open the Python(idle) guy i can write 
>>> import PIL withot an error.
>>>  but using this code in web2py:
>>>  try:
>>> from PIL import Image
>>> except:
>>> print "Error while Importing PIL library"
>>> raises the exception.
>>> what did I do wrong?
>>> Can I Integrate PIL into the application so the Application ships with 
>>> it?
>>> Thanks
>>>
>>> -- 
>>>  
>>>  
>>>  
>>>
>>
>>

-- 





Re: [web2py] Re: [Announcement] web2py powered app Vocabilis.NET

2012-09-04 Thread wwwgong
Thanks for sharing your web site. 

I am interested in using it to teach Chinese.

It would be good if you can post a youtube video on how to your site.

Wen

On Friday, August 31, 2012 8:52:01 AM UTC-4, Alexei Vinidiktov wrote:
>
> That would be great! :)
>
> On Fri, Aug 31, 2012 at 3:04 AM, Massimo Di Pierro 
> 
> > wrote:
>
>> My wife teaches Italian. Perhaps I get finally get her to use web2py. ;-)
>>
>>
>> On Thursday, 30 August 2012 09:53:56 UTC-5, Alexei Vinidiktov wrote:
>>>
>>> Hi,
>>>
>>> I'm glad to announce the launch of my second web2py powered web 
>>> application www.vocabilis.net.
>>>
>>> It's a flashcard vocabulary builder for language learners.
>>>
>>> On the front end I use Flex and on the back end I use web2py.
>>>
>>> To see the app in action you'll need to register on the site. 
>>> Registration doesn't require email confirmation at the moment.
>>>
>>> I'd like to thank the web2py community for all the help I've gotten 
>>> working on Vocabilis.NET.
>>>
>>> Massimo and all the contributors, thank you for creating such an 
>>> indispensable tool! 
>>>
>>> Thanks, guys!
>>>
>>> -- 
>>> Alexei Vinidiktov
>>>  
>>  -- 
>>  
>>  
>>  
>>
>
>
>
> -- 
> Alexei Vinidiktov
>

-- 





Re: [web2py] Re: [Announcement] web2py powered app Vocabilis.NET

2012-09-04 Thread Alexei Vinidiktov
Thanks, Alan!

At first I was planning on using Microsoft Translate API but they are not
currently accepting payments from residents of Russia. So I had to choose
something different. Currently I'm using the unofficial Google Text to
Speech API. If there are issues with the use of this unofficial API I may
later have to switch to a different tts provider.

On Tue, Sep 4, 2012 at 10:06 PM, Alan Etkin  wrote:

> Congratulations for a great work. The text-to-speech feature is very
> impressive also. Would you mind telling what technology did you use for
> that feature (in case there aren't comercial issues of course)
>
>
> On Tuesday, September 4, 2012 10:51:44 AM UTC-3, Alexei Vinidiktov wrote:
>
>> Hi David
>>
>> Thanks for your kind words. I'm glad you liked it. I'm using the standard
>> web2py html layout template for all parts of the site other than the page
>> where the actual application is located. For the latter I use the standard
>> Adobe Flex theme.
>>
>> By the way, I'm the sole creator of the project. Lumosity is just an ad
>> partner.
>>
>> On Tue, Sep 4, 2012 at 5:48 AM, villas  wrote:
>>
>>> Hi Alexei
>>>
>>> That looks really nice.  If I may ask... are you using a CSS framework,
>>> or did you make the styling from scratch?
>>>
>>> Whichever way,  it looks very good and professional,  so well done to
>>> you and Lumosity!
>>>
>>> David
>>>
>>>
>>>
>>>
>>> On Thursday, August 30, 2012 3:53:56 PM UTC+1, Alexei Vinidiktov wrote:

 Hi,

 I'm glad to announce the launch of my second web2py powered web
 application www.vocabilis.net.

 It's a flashcard vocabulary builder for language learners.

 On the front end I use Flex and on the back end I use web2py.

 To see the app in action you'll need to register on the site.
 Registration doesn't require email confirmation at the moment.

 I'd like to thank the web2py community for all the help I've gotten
 working on Vocabilis.NET.

 Massimo and all the contributors, thank you for creating such an
 indispensable tool!

 Thanks, guys!

 --
 Alexei Vinidiktov

>>>  --
>>>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Alexei Vinidiktov
>>
>  --
>
>
>
>



-- 
Alexei Vinidiktov

-- 





Re: [web2py] Re: Twitter account for @web2py

2012-09-04 Thread David | StyleFlare

Don't tweet commit messages, that is really very annoying.

Releases are fine.



On 9/4/12 11:21 AM, Massimo Di Pierro wrote:

I cannot figure out how to sign up for cotweet. :-(

On Monday, 3 September 2012 15:45:14 UTC-5, Luther Goh Lu Feng wrote:

I think it is also possible to give trusted and active members of
the community access to the twitter account via some service like
cotweet.

On Tuesday, September 4, 2012 4:14:02 AM UTC+8, rochacbruno wrote:

You can use http://feeds.feedburner.com/web2pyslices
 as source for
automatic posts...
also it would be nice to include
web2py.com/download/changelog.rss
 (create it) and use
as source to tweet automatically when change log gets updated.
It can also be done with github commits (you can integrate the
account on github --< twitter)


On Mon, Sep 3, 2012 at 5:08 PM, Massimo Di Pierro
 wrote:

No particular reason. I am planning to get back to it. Any
suggestions on how to make it more active?


On Monday, 3 September 2012 14:32:23 UTC-5, Luther Goh Lu
Feng wrote:

I just noticed that the twitter account has been very
inactive :o

Is there any reason for that? Anyway to improve the
situation?

https://twitter.com/web2py

-- 






--





--





Re: [web2py] Re: Twitter account for @web2py

2012-09-04 Thread Massimo Di Pierro
I cannot figure out how to sign up for cotweet. :-(

On Monday, 3 September 2012 15:45:14 UTC-5, Luther Goh Lu Feng wrote:
>
> I think it is also possible to give trusted and active members of the 
> community access to the twitter account via some service like cotweet.
>
> On Tuesday, September 4, 2012 4:14:02 AM UTC+8, rochacbruno wrote:
>>
>> You can use http://feeds.feedburner.com/web2pyslices as source for 
>> automatic posts...
>> also it would be nice to include web2py.com/download/changelog.rss(create 
>> it) and use as source to tweet automatically when change log gets 
>> updated.
>> It can also be done with github commits (you can integrate the account on 
>> github --< twitter)
>>
>>
>> On Mon, Sep 3, 2012 at 5:08 PM, Massimo Di Pierro 
>> wrote:
>>
>>> No particular reason. I am planning to get back to it. Any suggestions 
>>> on how to make it more active?
>>>
>>>
>>> On Monday, 3 September 2012 14:32:23 UTC-5, Luther Goh Lu Feng wrote:

 I just noticed that the twitter account has been very inactive :o

 Is there any reason for that? Anyway to improve the situation?

 https://twitter.com/web2py

>>>  -- 
>>>  
>>>  
>>>  
>>>
>>
>>
>>

-- 





[web2py] Re: SQLFORM.grid CSS help

2012-09-04 Thread Massimo Di Pierro
People are not supposed to update static files in old apps, that is why the 
grid contains alignment info but not other style info. On the other side we 
do not guaranteed backward compatibility for the grid look and feel.

It should be possible to generate a grid console with the right alignment 
(perhaps not the right padding, colors, button) that works with every style.

On Tuesday, 4 September 2012 02:40:42 UTC-5, Niphlod wrote:
>
> the thing here is: are web2py.css, web2py.js, appadmin.html, appadmin.py 
> files that needs updating when you update the framework or not ? This kind 
> of problem keeps popping up all the time because of styling incompatibility.
>
> Il giorno lunedì 3 settembre 2012 23:19:32 UTC+2, Massimo Di Pierro ha 
> scritto:
>>
>> You are right but now I am running into another problem...
>>
>> I am using a grid on an older 1.99.7 apps using skeleton. The console is 
>> messed up badly, even after replacing web2py.css. There should be a way to 
>> make this work that does not break the 1.99.7 scaffolding apps.
>>
>> Massimo
>>
>> On Monday, 3 September 2012 14:44:26 UTC-5, Niphlod wrote:
>>>
>>> that should definitely not happen. tested on ff and chromium.
>>> that happened before I switched from
>>> .web2py_console form {
>>> width: 100%;
>>> display: inline;
>>> vertical-align: middle;
>>> margin: 0 0 0 5px;
>>> }
>>> to 
>>> .web2py_console form {
>>> width: 100%;
>>> display: inline-block;
>>> vertical-align: middle;
>>> margin: 0 0 0 5px;
>>> }
>>> Can you please check if "form" is displayed as inline-block ? (maybe 
>>> refresh your browser cache...)
>>>
>>> On Monday, September 3, 2012 9:39:58 PM UTC+2, Massimo Di Pierro wrote:

 When I click on the [input] search field, and the popup appears, the 
 [add] button moves to the right of the popup. :-(


 On Monday, 3 September 2012 14:24:26 UTC-5, Niphlod wrote:
>
> gotcha, but I can't do without modifyng sqlhtml.py
>
> Added also a few px of margin to align "search" and "clear" to the 
> input, made it look similar to the "add, back & Co.", enlarged the search 
> input a little bit (a requirement from all my users)
>
> On Monday, September 3, 2012 9:12:00 PM UTC+2, Massimo Di Pierro wrote:
>>
>> No always two rows, no cols but "records found" should be on the same 
>> row as [add] but right-aligned.
>>
>> On Monday, 3 September 2012 13:54:18 UTC-5, Niphlod wrote:
>>>
>>> you mean "always two rows, with two columns every row", i.e. always:
>>>
>>> row1-col1: input  row1-col2:search clear
>>> row2-col1: addrow2-col2: records found
>>>
>>> ? 
>>>
>>> On Monday, September 3, 2012 8:17:51 PM UTC+2, Massimo Di Pierro 
>>> wrote:

 Right now the gird console (defined in sqlhtml.py) looks like

 [add] [input ] [search] [clear]
 [hidden popup]
 (records found ...)
  
 but some times it shows up as

 [add]
 [input ...] [search] [clear]
 [hidden popup]
 (records found ...)

 I would like it to consistently look like this

 [input ...] [search] [clear]
 [hidden popup]
 [add]  (records found ...)

 always to cols with popup in between, never 3 cols.

 Can somebody help with this?




-- 





Re: [web2py] Can't Import library

2012-09-04 Thread BlueShadow
the binary

On Tuesday, September 4, 2012 4:42:21 PM UTC+2, Marin Pranjić wrote:
>
> Do you use web2py source code or windows binary?
>
> On Tue, Sep 4, 2012 at 4:33 PM, BlueShadow 
> > wrote:
>
>> Hi,
>> I like to import the PIL library in My web2py application. I did install 
>> it under my windows mashine. when I open the Python(idle) guy i can write 
>> import PIL withot an error.
>>  but using this code in web2py:
>>  try:
>> from PIL import Image
>> except:
>> print "Error while Importing PIL library"
>> raises the exception.
>> what did I do wrong?
>> Can I Integrate PIL into the application so the Application ships with it?
>> Thanks
>>
>> -- 
>>  
>>  
>>  
>>
>
>

-- 





[web2py] Re: Auth Decorator / Model Question.

2012-09-04 Thread Massimo Di Pierro
Can you make a more concrete example. Not Sure I understand what users_id 
refers to.

On Monday, 3 September 2012 22:43:10 UTC-5, Kevin C wrote:
>
> The title isn't very descriptive, but I hope this paragraph clears things 
> up.
>
> Basically we are creating a basic SaaS app.  Users will log in at 
> theirname.oursite.com to an administrative panel.  Each administrative 
> panel is tied to a user ID from the auth table.  So basically here is what 
> should happen:
>
> User visits theirname.oursite.com/admin
> Web2py retrieves users_id field from stores table (This field assigns 
> ownership of each store to a user id)
> Web2py auth decorator should ensure that the logged in user ID is that of 
> the store owner
>
> I understand how to write the decorator, but what is the best way to 
> retrieve the users_id from the stores table and store it?  Sessions? 
>  Temporary variable that is set on each page load?
>
> Please forgive my ignorance.  I am completely new to web2py and want to 
> develop using best practices.  I appreciate any guidance you can offer.
>
> Thank you.
>

-- 





[web2py] Updated cheatsheet

2012-09-04 Thread Massimo Di Pierro
http://web2py.com/examples/static/web2py_cheatsheet.pdf

-- 





Re: [web2py] Re: [Announcement] web2py powered app Vocabilis.NET

2012-09-04 Thread Alan Etkin
Congratulations for a great work. The text-to-speech feature is very 
impressive also. Would you mind telling what technology did you use for 
that feature (in case there aren't comercial issues of course)

On Tuesday, September 4, 2012 10:51:44 AM UTC-3, Alexei Vinidiktov wrote:
>
> Hi David
>
> Thanks for your kind words. I'm glad you liked it. I'm using the standard 
> web2py html layout template for all parts of the site other than the page 
> where the actual application is located. For the latter I use the standard 
> Adobe Flex theme.
>
> By the way, I'm the sole creator of the project. Lumosity is just an ad 
> partner.
>
> On Tue, Sep 4, 2012 at 5:48 AM, villas >wrote:
>
>> Hi Alexei
>>
>> That looks really nice.  If I may ask... are you using a CSS framework,  
>> or did you make the styling from scratch?  
>>
>> Whichever way,  it looks very good and professional,  so well done to you 
>> and Lumosity!
>>
>> David
>>
>>
>>
>>
>> On Thursday, August 30, 2012 3:53:56 PM UTC+1, Alexei Vinidiktov wrote:
>>>
>>> Hi,
>>>
>>> I'm glad to announce the launch of my second web2py powered web 
>>> application www.vocabilis.net.
>>>
>>> It's a flashcard vocabulary builder for language learners.
>>>
>>> On the front end I use Flex and on the back end I use web2py.
>>>
>>> To see the app in action you'll need to register on the site. 
>>> Registration doesn't require email confirmation at the moment.
>>>
>>> I'd like to thank the web2py community for all the help I've gotten 
>>> working on Vocabilis.NET.
>>>
>>> Massimo and all the contributors, thank you for creating such an 
>>> indispensable tool! 
>>>
>>> Thanks, guys!
>>>
>>> -- 
>>> Alexei Vinidiktov
>>>  
>>  -- 
>>  
>>  
>>  
>>
>
>
>
> -- 
> Alexei Vinidiktov
>  

-- 





[web2py] administrative interface editor

2012-09-04 Thread caps.i.sin
Hello all

I have a question about the administrative interface editor : 
On my current web2py version (2.03), when I edit a file (for example a 
controller) I press [ctrl + S] to save it.
If there is an error, the background color of "Last saved on: " field is 
yellow instead of green. 
On the previous version, there was a popup message showing the python 
error. On the current version I just know that I have an error in my code 
(yellow background) but I don't know what is the exact error...
Is it a normal behaviour ?

FYI I have installed the binary version on windows 7 pro 64 bits

Thank you, and sorry for my awfull english, I hope my question will be 
quite clear anyway...

-- 





[web2py] Re: web2pyslices for Android

2012-09-04 Thread Eduardo Félix
Parabéns Bruno,
 
Ficou muito show!
 
Tenho um motorola xoom com android 4.02 e tá rodando perfeito!!!

Em segunda-feira, 3 de setembro de 2012 20h46min12s UTC-3, rochacbruno 
escreveu:

>
> Hi, I just published a beta version of web2pyslices reader for Android: 
> https://play.google.com/store/apps/details?id=com.webpyslices
>
> (do not expect too much, it just allow you to favorite some slices and 
> notify when a new slice is posted)
>
>
>
> *Bruno Cezar Rocha** - @rochacbruno*
> rocha...@gmail.com  | Mobile: +55 (11) 99210-8821
> www.CursoDePython.com.br | www.rochacbruno.com.br
> Blog: Using Python to get all the external links from a 
> webpage
>   Get a signature like this. 
> 
>  Click 
> here.
>
>
>  

-- 





Re: [web2py] Can't Import library

2012-09-04 Thread Marin Pranjić
Do you use web2py source code or windows binary?

On Tue, Sep 4, 2012 at 4:33 PM, BlueShadow  wrote:

> Hi,
> I like to import the PIL library in My web2py application. I did install
> it under my windows mashine. when I open the Python(idle) guy i can write
> import PIL withot an error.
>  but using this code in web2py:
>  try:
> from PIL import Image
> except:
> print "Error while Importing PIL library"
> raises the exception.
> what did I do wrong?
> Can I Integrate PIL into the application so the Application ships with it?
> Thanks
>
> --
>
>
>
>

-- 





Re: [web2py] Arrays and json

2012-09-04 Thread Jonathan Lundell
On 4 Sep 2012, at 7:04 AM, Hassan Alnatour  wrote:
> I am trying to use a data table called jtable , it uses arrays and return it 
> as json  .. now i have the php code for it  : 
> 
> //Get records from database
> $result = mysql_query("SELECT * FROM people;");
>  
> //Add all records to an array
> $rows = array();
> while($row = mysql_fetch_array($result))
> {
> $rows[] = $row;
> }
>  
> //Return result to jTable
> $jTableResult = array();
> $jTableResult['Result'] = "OK";
> $jTableResult['Records'] = $rows;
> print json_encode($jTableResult);
>   
>  and it 
> returns : 
>   
>   
>{
> "Result":"OK", "Records":[
>   {"PersonId":1,"Name":"Benjamin 
> Button","Age":17,"RecordDate":"\/Date(1320259705710)\/"},
>   {"PersonId":2,"Name":"Douglas 
> Adams","Age":42,"RecordDate":"\/Date(1320259705710)\/"},
>   {"PersonId":3,"Name":"Isaac 
> Asimov","Age":26,"RecordDate":"\/Date(1320259705710)\/"},
>   {"PersonId":4,"Name":"Thomas 
> More","Age":65,"RecordDate":"\/Date(1320259705710)\/"}
>  ]
> }
> now  i did it in web2py like this :
> def person():
> data = db().select(db.Person.ALL)
> mylist = {}
> mylist['Result'] = 'OK'
> mylist['Records']=[]
> for i in data:
>  i.name = {'ID':i.id,'Name': i.name,'Age': i.age}
>  mylist['Records'].append(i.name)
> return mylist
> 
> but there is still something wrong in the way i create the array , and its 
> making some problems for me in the edit/delete .. so is the function i did is 
> the same as the php code up there ..
> best regards,

It would be helpful to know what "something wrong" and "some problems" mean. 
FWIW, I'd recode at least this much:

def person():
data = db().select(db.Person.ALL)
mydict = dict(Result='OK', Records=[])
for i in data:
mydict['Records'].append(dict(ID=i.id, Name=i.name, Age=i.age))
return mydict

Part of my changes are only stylistic (I don't like naming a dict 'mylist'), 
and my version is more concise. But substantively, I'd be suspicious of 
assigning i.name to a dict containing a reference to i.name, not to mention 
that using a local variable is more efficient here.




-- 





[web2py] Can't Import library

2012-09-04 Thread BlueShadow
Hi,
I like to import the PIL library in My web2py application. I did install it 
under my windows mashine. when I open the Python(idle) guy i can write 
import PIL withot an error.
 but using this code in web2py:
 try:
from PIL import Image
except:
print "Error while Importing PIL library"
raises the exception.
what did I do wrong?
Can I Integrate PIL into the application so the Application ships with it?
Thanks

-- 





[web2py] Re: web2py login and register forms as part of main page

2012-09-04 Thread Anthony
auth.login() and auth.register() generate and process the login and 
register forms, respectively. You main page function could return those 
forms and include them in the view.

Anthony

On Tuesday, September 4, 2012 9:56:36 AM UTC-4, Yebach wrote:
>
> Hello
>
> I would like to create a login/register forms as part of a current page 
> not to be redirected to a new page where you login or register and then be 
> redirected back to the main page.
>
> Now I have auth.navbar() but that one takes you to a new page
>
> any suggestion??
>
> Thank you
>

-- 





[web2py] Auth.wiki(). Issue with wiki_page.html compute

2012-09-04 Thread Andrew W
(Starting a new post for this issue, mentioned in thread of a "simple wiki")

Issue: 
On edit of an existing page, the wiki_page.body is being updated correctly, but 
wiki_page.html does not change, it's compute function does not get called.

I've added some print statements and markmin_render() (the compute functions 
for page.html) is called on the intial page create, but is not called on 
subsequent updates - page.html is not getting updated when editing an existing 
page.

I've never used compute fields  before, I assume it should be automatic ?

- show quoted text -

-- 





[web2py] Re: Symlinked Application Issue

2012-09-04 Thread Alex H
Removing the '-' from the target name works.  Many thanks AP!

On Tuesday, September 4, 2012 5:01:03 PM UTC+10, amphisia pui wrote:
>
> Hi Alex,
>
> It works but try to remove the "-" character  from target application name:
>
> I met the same issue resolved changing 
>
> "./web2py/applications/web2py-book" in "./web2py/applications/web2py-book"
>
> AP
>
>
>   
>
> Il giorno martedì 4 settembre 2012 01:02:10 UTC+2, Alex H ha scritto:
>>
>> In my Applications directory, I have created a symlink to another 
>> directory, e.g. ...
>>
>> ln -s ~/dev/python/web2py-book web2py-book
>>
>> The created symlink operates correctly, however the web2py-book app 
>> doesn't show up as an application in the browser.  Is there some reason 
>> such a symlinked application wouldn't be recognized?
>>
>> -- Alex (Mac, 2.0.6)
>>
>

-- 





[web2py] Re: 2.02 Table name in smartgrid changed...

2012-09-04 Thread Jim S
I'm having the same issue as well with second level display

-Jim

On Friday, August 31, 2012 9:59:38 AM UTC-5, Adi wrote:
>
> trunk works for the first level, but doesn't when i drill down into the 
> second level... (image attached)
>
> also it used to display all breadcrumbs in the same line...
>
> old source code:
>  class="w2p_trap" href="/list_suppliers/supplier">Suppliers >  class="w2p_trap" href="
> /list_suppliers/supplier/view/supplier/21?_signature=3a9f06fff5edbc76efc140b8838b11063d1cd328
> ">Concept Laboratories, Inc. > Purchase orders
> 
>
> so far, all seems to work perfectly fine on 2 apps :) had a migration 
> problem to alter scheduler tables (usual back and forth), but got it 
> working as well... continuing testing...
>
> thanks again for the best framework!
>
>
> On Thursday, August 30, 2012 4:36:40 PM UTC-4, Massimo Di Pierro wrote:
>>
>> Got it. fixed in trunk. This was not intentional!
>>
>> On Thursday, 30 August 2012 10:29:25 UTC-5, Adi wrote:
>>>
>>> Smartgrid used to display the table name automatically. Is that supposed 
>>> to be as before?
>>>
>>

-- 





[web2py] web2py login and register forms as part of main page

2012-09-04 Thread Yebach
Hello

I would like to create a login/register forms as part of a current page not 
to be redirected to a new page where you login or register and then be 
redirected back to the main page.

Now I have auth.navbar() but that one takes you to a new page

any suggestion??

Thank you

-- 





Re: [web2py] Re: [Announcement] web2py powered app Vocabilis.NET

2012-09-04 Thread Alexei Vinidiktov
Hi David

Thanks for your kind words. I'm glad you liked it. I'm using the standard
web2py html layout template for all parts of the site other than the page
where the actual application is located. For the latter I use the standard
Adobe Flex theme.

By the way, I'm the sole creator of the project. Lumosity is just an ad
partner.

On Tue, Sep 4, 2012 at 5:48 AM, villas  wrote:

> Hi Alexei
>
> That looks really nice.  If I may ask... are you using a CSS framework,
> or did you make the styling from scratch?
>
> Whichever way,  it looks very good and professional,  so well done to you
> and Lumosity!
>
> David
>
>
>
>
> On Thursday, August 30, 2012 3:53:56 PM UTC+1, Alexei Vinidiktov wrote:
>>
>> Hi,
>>
>> I'm glad to announce the launch of my second web2py powered web
>> application www.vocabilis.net.
>>
>> It's a flashcard vocabulary builder for language learners.
>>
>> On the front end I use Flex and on the back end I use web2py.
>>
>> To see the app in action you'll need to register on the site.
>> Registration doesn't require email confirmation at the moment.
>>
>> I'd like to thank the web2py community for all the help I've gotten
>> working on Vocabilis.NET.
>>
>> Massimo and all the contributors, thank you for creating such an
>> indispensable tool!
>>
>> Thanks, guys!
>>
>> --
>> Alexei Vinidiktov
>>
>  --
>
>
>
>



-- 
Alexei Vinidiktov

-- 





Re: [web2py] Re: How to share static files between apps?

2012-09-04 Thread Michele Comitini
Anthony solution is preferable since it also helps client caching.

mic
 Il giorno 04/set/2012 15:20, "Jemes Hsu"  ha scritto:

> This solution will do. Thanks
>
> On Tuesday, September 4, 2012 8:46:44 PM UTC+8, Anthony wrote:
>>
>> Another option is to keep the shared static files in one of the apps and
>> just have URLs from the other app point there (e.g., if you have
>> /wiki/static/css/styles.css, in the blog app, use URL('wiki', 'static',
>> 'css/styles.css')).
>>
>> Anthony
>>
>> On Tuesday, September 4, 2012 8:03:42 AM UTC-4, Jemes Hsu wrote:
>>>
>>> What's the best way to share static files between apps?
>>>
>>> Let say I have 'wiki' and 'blog' applications both using the same css:
>>>
>>> \applications
>>> \wiki
>>> \blog
>>> \static
>>> \css\bootstrap.min.css
>>>
>>> if the css file is within an app I just use URL('static','css/bootstrap.
>>> **min.css') to get the css file.  What should be the URL() let say the
>>> css file is outside of app folders like in above?
>>>
>>>
>>>  --
>
>
>
>

-- 





[web2py] Re: How to share static files between apps?

2012-09-04 Thread Jemes Hsu
This solution will do. Thanks

On Tuesday, September 4, 2012 8:46:44 PM UTC+8, Anthony wrote:
>
> Another option is to keep the shared static files in one of the apps and 
> just have URLs from the other app point there (e.g., if you have 
> /wiki/static/css/styles.css, in the blog app, use URL('wiki', 'static', 
> 'css/styles.css')).
>
> Anthony
>
> On Tuesday, September 4, 2012 8:03:42 AM UTC-4, Jemes Hsu wrote:
>>
>> What's the best way to share static files between apps? 
>>
>> Let say I have 'wiki' and 'blog' applications both using the same css: 
>>
>> \applications
>> \wiki
>> \blog
>> \static
>> \css\bootstrap.min.css
>>
>> if the css file is within an app I just use 
>> URL('static','css/bootstrap.min.css') to get the css file.  What should be 
>> the URL() let say the css file is outside of app folders like in above?
>>
>>
>>

-- 





Re: [web2py] Re: Bootstrap and custom forms and widgets

2012-09-04 Thread Anthony
Also, you can now create your own formstyle function, which should take the 
form object and a list of field tuples (each field tuple includes the id, 
label, controls, and comment for the field) and return the DOM you want 
displayed in the form (i.e., the part that goes inside ). 
Internally, this is how all the formstyles now work (each has its own 
function). To see how they work, check out the code: 
http://code.google.com/p/web2py/source/browse/gluon/sqlhtml.py#651.

Anthony

On Tuesday, September 4, 2012 7:49:45 AM UTC-4, Anthony wrote:
>
> For Crud, it's a setting:
>  
> crud.settings.formstyle = 'bootstrap'
>
> Anthony
>
> On Tuesday, September 4, 2012 5:36:55 AM UTC-4, Alec Taylor wrote:
>>
>> Unfortunately that didn't work:
>>  create() got an unexpected keyword argument 
>> 'formstyle'  update() got an unexpected 
>> keyword argument 'formstyle'
>>
>> On Tue, Sep 4, 2012 at 7:31 PM, Niphlod  wrote:
>>
>>> should be formstyle='bootstrap', the same way you use formstyle=divs , 
>>> ul, etc
>>>
>>> Il giorno martedì 4 settembre 2012 10:34:07 UTC+2, Alec Taylor ha 
>>> scritto:

 Thanks, but I can't seem to find anything in the release about how to 
 use bootstrap with forms:  https://groups.google.com/**
 forum/#!topic/web2py/**0Uk5b34LUsc
  

 (Note that I'm using crud.create and crud.update)

 On Tue, Sep 4, 2012 at 5:45 PM, Niphlod  wrote:

> the code is out there on 
> github.com/niphlod/w2p_**tvseries,
>  
> but included in web2py 2.0.6 there is other code for bootstrap-compatible 
> forms
>
> Il giorno martedì 4 settembre 2012 05:03:59 UTC+2, Alec Taylor ha 
> scritto:
>
>> Hi Niphlod,
>>
>> Now that web2py 2 has been released, could you release the code for 
>> your form manipulation?
>>
>> Thanks a heap,
>>
>> Alec taylor
>>
>> On Sunday, May 20, 2012 2:48:57 AM UTC+10, Niphlod wrote:
>>>
>>> me too, but in a different way.
>>>
>>> I'm working on an app and waiting for web2py 2.0 to release it to 
>>> the public.
>>> It contains a function able to serialize form in "bootstrap" styles 
>>> (i.e. form-horizontal, form-vertical, form-inline) 
>>> With some additional work maybe that could be included to provide 
>>> more than the current 'table3cols', 'table2cols', 'divs', 'ul' styles 
>>> of 
>>> the forms.
>>>
>>> Right now it's called into the view, i.e.:
>>>
>>> {{=twitter_form(form, 'form-vertical')}}
>>>
>>> Il giorno sabato 19 maggio 2012 11:10:30 UTC+2, Pystar ha scritto:

 Hi matt,
 I have been working extensively with bootstrap with web2py and I 
 can say the approach you are taking is the best way. 

 This is my solution

 #controller####3

 form = SQLFORM(db.blahblah)
 if form.accepts(request, session, hideerrror=True):
 blahblah

 the hideerror=True is what does the magic.
 It prevents your forms from displaying the error messages in the 
 default position which is below the form field.

 In your views, you can now display your error messages by doing

 {{=form.**er**rors["post"]}}

 make sure you put the above in a conditional IF, ElSE block or else 
 the errors will be displayed whether you have errors in your form or 
 not

 On Sunday, May 13, 2012 4:35:52 AM UTC+1, Matt wrote:
>
> Hi Everybody,
>
> I'm using bootstrap for a project with web2py.
>
> I want to create forms that mirror the standard approach taken by 
> the bootstrap framework.
>
>  They wrap each "control" like so:
>
>   
> Input with 
> error
> 
>   
>   Please correct the error
>   A comment for the field goes 
> here.
> 
>   
>
> Since this is custom code I using form.custom and form.fields for 
> output the HTML myself.
>
> One small problem I've run up against in that when I do the 
> following:
>
> {{= form.custom.widget.full_name }}
>
> If there is a form _error_ the following is output:
>
>  type="text" value="">
> *please enter their full 
> name*
> *
> *
> Is there anyway to suppress the div or change it so that it can 
> become
>
> *please enter their full name***
> *
> *
> Instead?
>
> Any help or suggestion for this would be greatly appreciated.
>
> Than

[web2py] Re: Responsive website (my first one, built using web2py)

2012-09-04 Thread Anthony
There's also this: https://github.com/angeloc/web2py-responsivekit

On Tuesday, September 4, 2012 12:42:18 AM UTC-4, Neil Harding wrote:
>
> I just made my first website using responsive coding style, I modified 
> web2py so that I can use DEFER(URL(),"alt text") and it will load from 320/ 
> 480/ 640/ sub directories depending on the client resolution. It seems to 
> work ok, anyone got any feedback? I also added a SKYPE which does callto: 
> or tel: depending on whether it is desktop or mobile (callto: is used by 
> Skype, and tel: is common on mobile phones). You can see the site at 
> http://www.residenciapacifica.com It's a fairly simple website with 
> multiple columns on the index page, but the contact us page has responsive 
> layout, and the images can also be clicked to bring up the full resolution 
> automatically (unless you are running > 1280 pixels, in which case you are 
> seeing the full resolution for the images already).
>
> I can make the changes available, although I was using the previous of 
> web2py, so I want to upgrade to that first.
>
> Neil Harding
>

-- 





[web2py] Re: How to share static files between apps?

2012-09-04 Thread Anthony
Another option is to keep the shared static files in one of the apps and 
just have URLs from the other app point there (e.g., if you have 
/wiki/static/css/styles.css, in the blog app, use URL('wiki', 'static', 
'css/styles.css')).

Anthony

On Tuesday, September 4, 2012 8:03:42 AM UTC-4, Jemes Hsu wrote:
>
> What's the best way to share static files between apps? 
>
> Let say I have 'wiki' and 'blog' applications both using the same css: 
>
> \applications
> \wiki
> \blog
> \static
> \css\bootstrap.min.css
>
> if the css file is within an app I just use 
> URL('static','css/bootstrap.min.css') to get the css file.  What should be 
> the URL() let say the css file is outside of app folders like in above?
>
>
>

-- 





[web2py] Re: How to share static files between apps?

2012-09-04 Thread Massimo Di Pierro
In web2py apps should packable separately therefore each app should contain 
the files it needs. You can symlink the static folders to pretend you have 
two when you infact you have one.

On Tuesday, 4 September 2012 07:03:42 UTC-5, Jemes Hsu wrote:
>
> What's the best way to share static files between apps? 
>
> Let say I have 'wiki' and 'blog' applications both using the same css: 
>
> \applications
> \wiki
> \blog
> \static
> \css\bootstrap.min.css
>
> if the css file is within an app I just use 
> URL('static','css/bootstrap.min.css') to get the css file.  What should be 
> the URL() let say the css file is outside of app folders like in above?
>
>
>

-- 





[web2py] Re: web2pyslices for Android

2012-09-04 Thread Fabiano Faver
Esta rodando muito em no meu galaxy nexus. Android 4.1.1
Navegabilidade está bacana.

Em segunda-feira, 3 de setembro de 2012 20h46min12s UTC-3, rochacbruno 
escreveu:
>
>
> Hi, I just published a beta version of web2pyslices reader for Android: 
> https://play.google.com/store/apps/details?id=com.webpyslices
>
> (do not expect too much, it just allow you to favorite some slices and 
> notify when a new slice is posted)
>
>
>
> *Bruno Cezar Rocha** - @rochacbruno*
> rocha...@gmail.com  | Mobile: +55 (11) 99210-8821
> www.CursoDePython.com.br | www.rochacbruno.com.br
> Blog: Using Python to get all the external links from a 
> webpage
>   Get a signature like this. 
> 
>  Click 
> here.
>
>
>  

-- 





  1   2   >