[web2py] Ticket when trying to upload an image

2010-05-31 Thread weheh
I got the following ticket when trying to upload an image via the
appadmin:

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 178, in restricted
exec ccode in environment
  File "C:/web2py/applications/myapp/controllers/appadmin.py", line
410, in 
  File "C:\web2py\gluon\globals.py", line 96, in 
self._caller = lambda f: f()
  File "C:/web2py/applications/myapp/controllers/appadmin.py", line
275, in update
if form.accepts(request.vars, session):
  File "C:\web2py\gluon\sqlhtml.py", line 862, in accepts
if not request_vars.get(key,None) \
  File "C:\Program Files\Python25\Lib\cgi.py", line 633, in __len__
return len(self.keys())
  File "C:\Program Files\Python25\Lib\cgi.py", line 609, in keys
raise TypeError, "not indexable"
TypeError: not indexable


The image field is defined as follows:

  Field('avatar','upload',label=T('Image'),autodelete=True,
uploadfolder=PATH,
 
requires=(IS_NULL_OR(IS_IMAGE()),IS_NULL_OR(IS_LENGTH(10,10,

Any ideas?


[web2py] Re: new stuff in trunk...

2010-05-31 Thread Richard
paypal is definitely complex, but it is also popular!


On Jun 1, 12:16 pm, mdipierro  wrote:
> Turns out that one has dependencies. Some in zope code.
> This one seems a simpler option. Authorize.net is one of the best
> options anyway.
>
> Paypal and google have more complex workflow.
>
> On May 31, 8:28 pm, Richard  wrote:
>
> > sms handling and credit card payments - neat!
>
> > That onlinepayment API you linked earlier (http://pypi.python.org/pypi/
> > onlinepayment/1.0.0) offers more payment options, such as PayPal.
> > Would it be worth integrating that instead?
>
> > On May 31, 2:42 pm, mdipierro  wrote:
>
> > > 1)
> > > mail.settings.server='logging'
> > > will pretend it is sending emails and just log them instead with a
> > > warning.
>
> > > 2) from gluon.contrib.sms_utils import SMSCODES, sms_email
> > > sms_email(number,provider)
> > > will send an sms via an email (free) where provider is in the list of
> > > SMSCODES
>
> > > 3) gluon/contrib/AuthorizeNet.py
> > > look at the example at the bottom of the file. This is the easiest way
> > > to accept credit card payments. It uses authorize.net API. I did not
> > > write AuthorizeNet.py but adapted it from 
> > > thishttp://www.johnconde.net/blog/integrate-the-authorizenet-aim-api-with...
> > > and I am not sure what the license it. I think it is public domain,
> > > anyway I emailed the author for confirmation and I am waiting for an
> > > answer.


[web2py] Re: how to generate barcode label ?

2010-05-31 Thread Yarko Tymciurak

On Jun 1, 12:31 am, Iceberg  wrote:
> Thanks. Then what choices do you recommend to read barcodes? Both make
> and read are needed to complete any full solution, aren't they?

That depends on your application - for PyCon, we generate and print
the codes on user badges;  vendors and people interviewing
had their own scanners (handheld) to read the codes.

I'm not sure how these send the data, but I suspect it is much like
the ZXing web "scanner" which reads an image (i.e., sends the data
from the code).


>
> On Jun1, 11:17am, Jason Brower  wrote:
>
> > There are alot of functions that can make barcodes. I think google has a
> > web api for barcodes.  I made one that ran a script in the background to
> > make one.  Search for any program that can make barcodes on your
> > computer and you can use it.  Python scripts are powerful enough to do
> > just about anything.  The first program I ever made in web2py made 2d
> > barcodes.  It would be cool to have a plugin that could make all kinds
> > from all the libraries.
> > I think reportlab is another barcode maker, that ones a bit fancy but it
> > is all python. :D
> > Best Regards,
> > Jason Brower
>
> > On Mon, 2010-05-31 at 11:46 -0700, Yarko Tymciurak wrote:
> > > On May 31, 12:53 pm, ceriox  wrote:
> > > > like object...
>
> > > > i need to generate a label with barcode
>
> > > > anybody have an example?
>
> > > In general, you need to generate an image of some sort, based on data.
>
> > > To print images on badges, you could look at the mk_barcode() function
> > > in
> > >http://code.google.com/p/web2conf/source/browse/applications/register...
>
> > > Although I haven't tried this, you might also look at:
> > >http://javascript-library-tips.changblog.com/2009/12/jquery-barcode.html
>
> > > - Yarko
>
> > > > thanks


[web2py] new web2py TAG features

2010-05-31 Thread mdipierro
http://web2py.com/AlterEgo/default/show/266


[web2py] Re: An error occurred importing your passenger_wsgi.py

2010-05-31 Thread mdipierro
This is not a web2py file and it is not imported by web2py. I have
never seen this file before.

On Jun 1, 12:38 am, Avik Basu  wrote:
> I am running on web2py 1.78.3 on a shared server on Dreamhost and I am
> getting the following error:
>
> An error occurred importing your passenger_wsgi.py
>
> It seems like a PATH issue but I'm not sure.  Any ideas what might be
> causing this?
>
> Avik


[web2py] dependent drop down list

2010-05-31 Thread tracey
I am a beginner in web2py. I've been looked around in this group about
the dedpendent drop down list, I found one person had the same
question with me, but I still don't understand about using
$.ajax(.) where  is the code sends to server and the drop down
list will be computed based on the selected value from the above drop
down list.

Let say I have the following tables

db.define_table('Country',
  Field('country_name', 'string'))

db.define_table('State',
  Field('state_name', 'string'),
  Field('country_name', db.country))

In the controller I have:
def index():
  form=SQLFORM(db.State)
  return dict(form=form)

What should i need to have in index.html to display the corresponding
state in country.

 $('#country_state').change(function(){ $.ajax(  ) }


please explain, and thank you in advance



[web2py] An error occurred importing your passenger_wsgi.py

2010-05-31 Thread Avik Basu
I am running on web2py 1.78.3 on a shared server on Dreamhost and I am
getting the following error:

An error occurred importing your passenger_wsgi.py

It seems like a PATH issue but I'm not sure.  Any ideas what might be
causing this?

Avik


[web2py] Re: how to generate barcode label ?

2010-05-31 Thread Iceberg
Thanks. Then what choices do you recommend to read barcodes? Both make
and read are needed to complete any full solution, aren't they?

On Jun1, 11:17am, Jason Brower  wrote:
> There are alot of functions that can make barcodes. I think google has a
> web api for barcodes.  I made one that ran a script in the background to
> make one.  Search for any program that can make barcodes on your
> computer and you can use it.  Python scripts are powerful enough to do
> just about anything.  The first program I ever made in web2py made 2d
> barcodes.  It would be cool to have a plugin that could make all kinds
> from all the libraries.
> I think reportlab is another barcode maker, that ones a bit fancy but it
> is all python. :D
> Best Regards,
> Jason Brower
>
>
>
> On Mon, 2010-05-31 at 11:46 -0700, Yarko Tymciurak wrote:
> > On May 31, 12:53 pm, ceriox  wrote:
> > > like object...
>
> > > i need to generate a label with barcode
>
> > > anybody have an example?
>
> > In general, you need to generate an image of some sort, based on data.
>
> > To print images on badges, you could look at the mk_barcode() function
> > in
> >http://code.google.com/p/web2conf/source/browse/applications/register...
>
> > Although I haven't tried this, you might also look at:
> >http://javascript-library-tips.changblog.com/2009/12/jquery-barcode.html
>
> > - Yarko
>
> > > thanks


Re: [web2py] Re: how to generate barcode label ?

2010-05-31 Thread Jason Brower
There are alot of functions that can make barcodes. I think google has a
web api for barcodes.  I made one that ran a script in the background to
make one.  Search for any program that can make barcodes on your
computer and you can use it.  Python scripts are powerful enough to do
just about anything.  The first program I ever made in web2py made 2d
barcodes.  It would be cool to have a plugin that could make all kinds
from all the libraries.
I think reportlab is another barcode maker, that ones a bit fancy but it
is all python. :D
Best Regards,
Jason Brower

On Mon, 2010-05-31 at 11:46 -0700, Yarko Tymciurak wrote: 
> On May 31, 12:53 pm, ceriox  wrote:
> > like object...
> >
> > i need to generate a label with barcode
> >
> > anybody have an example?
> 
> In general, you need to generate an image of some sort, based on data.
> 
> To print images on badges, you could look at the mk_barcode() function
> in
> http://code.google.com/p/web2conf/source/browse/applications/register/controllers/badge.py?repo=pycon2010
> 
> Although I haven't tried this, you might also look at:
> http://javascript-library-tips.changblog.com/2009/12/jquery-barcode.html
> 
> - Yarko
> 
> >
> > thanks




[web2py] Re: gaehandler.py change

2010-05-31 Thread mdipierro
ok. in trunk. Thanks for checking.

On May 31, 8:48 pm, howesc  wrote:
> sorry i was not clear.  but i did just verify that
>
> env['PATH_INFO'] = env['PATH_INFO'].encode('utf8')
>
> appears to work just fine (in dev and prod.) with light testing.  I
> agree that it's a better solution than my hack.
>
> thanks!!
>
> christian
>
> On May 30, 7:25 pm, mdipierro  wrote:
>
> > To clarify. the following line works?
>
> > env['PATH_INFO'] = env['PATH_INFO'].encode('utf8')
>
> > On May 30, 7:13 pm, howesc  wrote:
>
> > > if i do type(...) on the variables it returns 'unicode'.  I'm not up
> > > on my encodings to know 100% the best way...i know that once i put the
> > > line above in that cookies and sessions work again.
>
> > > On May 29, 5:05 pm, mdipierro  wrote:
>
> > > > Before I add the line I need some diagnostic. Is env['PATH_INFO']
> > > > unicode? In this case shouldn't it be
>
> > > > env['PATH_INFO'] = env['PATH_INFO'].encode('utf8')
>
> > > > On May 29, 6:40 pm, howesc  wrote:
>
> > > > > Hi all,
>
> > > > > in order to use blobstore on google app engine we have to be able to
> > > > > handle redirection back from google's upload API.  when we are re-
> > > > > directed back all variables come from google in unicode.
>
> > > > > the fix i have is to add the following line just before the return
> > > > > from wsgiapp() in gaehandler.py (line 73):
> > > > >     #HACK to deal with utf-8 encoded info when redirected to URLs from
> > > > > GAE
> > > > >     env['PATH_INFO'] = str(env['PATH_INFO'])
>
> > > > > 2 questions:
> > > > >  - is this evil, and there is a better way to do it?
> > > > >  - any objections to adding it to trunk so that next time i upgrade i
> > > > > don't loose the change again? :)
>
> > > > > thanks!
>
> > > > > Christian


[web2py] new download page

2010-05-31 Thread mdipierro
http://web2py.com/examples/default/download


[web2py] Re: new stuff in trunk...

2010-05-31 Thread mdipierro
Turns out that one has dependencies. Some in zope code.
This one seems a simpler option. Authorize.net is one of the best
options anyway.

Paypal and google have more complex workflow.

On May 31, 8:28 pm, Richard  wrote:
> sms handling and credit card payments - neat!
>
> That onlinepayment API you linked earlier (http://pypi.python.org/pypi/
> onlinepayment/1.0.0) offers more payment options, such as PayPal.
> Would it be worth integrating that instead?
>
> On May 31, 2:42 pm, mdipierro  wrote:
>
> > 1)
> > mail.settings.server='logging'
> > will pretend it is sending emails and just log them instead with a
> > warning.
>
> > 2) from gluon.contrib.sms_utils import SMSCODES, sms_email
> > sms_email(number,provider)
> > will send an sms via an email (free) where provider is in the list of
> > SMSCODES
>
> > 3) gluon/contrib/AuthorizeNet.py
> > look at the example at the bottom of the file. This is the easiest way
> > to accept credit card payments. It uses authorize.net API. I did not
> > write AuthorizeNet.py but adapted it from 
> > thishttp://www.johnconde.net/blog/integrate-the-authorizenet-aim-api-with...
> > and I am not sure what the license it. I think it is public domain,
> > anyway I emailed the author for confirmation and I am waiting for an
> > answer.


[web2py] Re: gaehandler.py change

2010-05-31 Thread howesc
sorry i was not clear.  but i did just verify that

env['PATH_INFO'] = env['PATH_INFO'].encode('utf8')

appears to work just fine (in dev and prod.) with light testing.  I
agree that it's a better solution than my hack.

thanks!!

christian

On May 30, 7:25 pm, mdipierro  wrote:
> To clarify. the following line works?
>
> env['PATH_INFO'] = env['PATH_INFO'].encode('utf8')
>
> On May 30, 7:13 pm, howesc  wrote:
>
> > if i do type(...) on the variables it returns 'unicode'.  I'm not up
> > on my encodings to know 100% the best way...i know that once i put the
> > line above in that cookies and sessions work again.
>
> > On May 29, 5:05 pm, mdipierro  wrote:
>
> > > Before I add the line I need some diagnostic. Is env['PATH_INFO']
> > > unicode? In this case shouldn't it be
>
> > > env['PATH_INFO'] = env['PATH_INFO'].encode('utf8')
>
> > > On May 29, 6:40 pm, howesc  wrote:
>
> > > > Hi all,
>
> > > > in order to use blobstore on google app engine we have to be able to
> > > > handle redirection back from google's upload API.  when we are re-
> > > > directed back all variables come from google in unicode.
>
> > > > the fix i have is to add the following line just before the return
> > > > from wsgiapp() in gaehandler.py (line 73):
> > > >     #HACK to deal with utf-8 encoded info when redirected to URLs from
> > > > GAE
> > > >     env['PATH_INFO'] = str(env['PATH_INFO'])
>
> > > > 2 questions:
> > > >  - is this evil, and there is a better way to do it?
> > > >  - any objections to adding it to trunk so that next time i upgrade i
> > > > don't loose the change again? :)
>
> > > > thanks!
>
> > > > Christian


[web2py] Re: new stuff in trunk...

2010-05-31 Thread Richard
sms handling and credit card payments - neat!

That onlinepayment API you linked earlier (http://pypi.python.org/pypi/
onlinepayment/1.0.0) offers more payment options, such as PayPal.
Would it be worth integrating that instead?


On May 31, 2:42 pm, mdipierro  wrote:
> 1)
> mail.settings.server='logging'
> will pretend it is sending emails and just log them instead with a
> warning.
>
> 2) from gluon.contrib.sms_utils import SMSCODES, sms_email
> sms_email(number,provider)
> will send an sms via an email (free) where provider is in the list of
> SMSCODES
>
> 3) gluon/contrib/AuthorizeNet.py
> look at the example at the bottom of the file. This is the easiest way
> to accept credit card payments. It uses authorize.net API. I did not
> write AuthorizeNet.py but adapted it from 
> thishttp://www.johnconde.net/blog/integrate-the-authorizenet-aim-api-with...
> and I am not sure what the license it. I think it is public domain,
> anyway I emailed the author for confirmation and I am waiting for an
> answer.


Re: [web2py] Re: web2py Conference Management System

2010-05-31 Thread Mariano Reingart
The problem of "OperationalError: no such table: payment" is because
migrations are disabled by default for performance reasons.

You have to change line 8 of db.py

migrate = True

Sorry, my mistake, that why I prefer submitting complete app package,
you can download working version from here:

http://www.web2py.com.ar/welcome/static/web2py.app.flisol2010.w2p

It should round well with latest version of web2py (I remember of some
minor problems fixed)

Best regards,

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



On Mon, May 31, 2010 at 11:25 AM, KR  wrote:
> Hello,
>
> Thanks for the answers.
>
> I tried both versions and none of them works out of the box.
>
> Here is the trace for the Flisol (same as the PyCon) one:
>
> x...@box~/work/web2py/web2py$ python web2py.py -S web2confF -M
> web2py Enterprise Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2010
> Version 1.78.3 (2010-05-17 21:59:39)
> Database drivers available: SQLite3
> Traceback (most recent call last):
>  File "/home/xxx/work/web2py/web2py/gluon/restricted.py", line 178,
> in restricted
>    exec ccode in environment
>  File "applications/web2confF/models/db_cleanup.py", line 1, in
> 
>    db(db.payment.created_on (db.payment.status.lower()=='pre-processing').delete()
>  File "/home/xxx/work/web2py/web2py/gluon/sql.py", line 3247, in
> delete
>    self._db._execute(query)
>  File "/home/xxx/work/web2py/web2py/gluon/sql.py", line 899, in
> 
>    self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> OperationalError: no such table: payment
>
> If somebody has a simple way to make it work, I will do that.
> Otherwize, I will remove the payment stuffs (not sure to use it
> anyway). Help for doing that would be appreciate as well.
>
> Some info:
> - web2py Version 1.78.3 (2010-05-17 21:59:39) (if I need a previous
> version, which one and where to find it please ?)
> - I don't understand spanish (french is my mother tongue)
> - I need some CMS (or at least wiki) functionnality to manage the
> website
> - I deleted the databases folder and recreated it (empty)
> - The default "reingart-web2conf" works after having replaced
> db=SQLDB(DBURI,pools=DBPOOLS) by db=SQLDB(DBURI) and create the non
> existant databases folder. But they are other issues (balance is
> none ? making some requests failed) and it seems not to implement some
> CMS functionnalities.
>
> Thx already.
>
> On 27 mai, 07:23, Yarko Tymciurak  wrote:
>> Mariano -
>>
>> Thank you - I hadn't seen that you made a clone.
>>
>> FYI for others:  you can the list of clones 
>> at:http://code.google.com/p/web2conf/source/clones
>>
>> I will look over this in June, and look at merging back (there are
>> things in the base web2conf that need cleanup, updates - which looks
>> like Mariano made many).
>>
>> - Yarko
>>
>> On May 26, 2:32 pm, Mariano Reingart  wrote:
>>
>> > On Wed, May 26, 2010 at 2:19 PM, Yarko Tymciurak
>>
>> >  wrote:
>>
>> > > On May 26, 9:23 am, KR  wrote:
>> > >> Hello,
>>
>> > >> There is a Vimeo screencast (http://www.vimeo.com/1838049) about a
>> > >> web2py Conference Management System. Does anybody know wher I can
>> > >> download the soource code of that ?
>>
>> > > You can get the version used at PyCon-2010 at code.google.com/p/
>> > > web2conf
>>
>> > > There is also an older version, which was modified for FLISOL-2010
>> > > I'll have to find that (eventually, that should be merged back to
>> > > web2conf).
>>
>> > You can found them in flisol 2010 and pyday branches of my web2conf clone:
>>
>> >http://code.google.com/r/reingart-web2conf/
>>
>> > Flisol:http://code.google.com/r/reingart-web2conf/source/browse/?r=1d551738b...
>>
>> > PyDay:http://code.google.com/r/reingart-web2conf/source/browse/?r=0776772cb...
>>
>> > Running 
>> > sites:http://www.institutopascal.edu.ar/flisol2010?lang=eshttp://www.pyday
>>
>> > Sorry, I didn't have time to generalize them and merge back to the
>> > web2conf trunk.
>>
>> > > Right now, web2conf needs a few updates and refactorings (typically,
>> > > during the course of a registration cycle, things are fixed, added,
>> > > etc. and should be re-visited, cleaned).   For example this web2conf
>> > > is based on an older version of web2py.
>>
>> > I would be cleaning up some things, if there are any plans, please let me 
>> > know.
>>
>> > I'm thinking of:
>> >  * Spearate default.py into talks.py, registration.py statics.py, etc.
>> >  * Finish talk reviewing/voting
>> >  * Eliminate some T2 stuff
>> >  * Rewrite PDF generation (badge and attendance certificate) using
>> > PyFPDF (removing dependencies like dabo)
>> >  * Speed-up, caching, cleanup, easier configuration, etc.
>>
>> > Best regards,
>>
>> > Mariano 
>> > Reingarthttp://www.web2py.com.arhttp://www.sistemasagiles.com.arhttp://reinga...


[web2py] Re: how to generate barcode label ?

2010-05-31 Thread mdipierro
The jquery one and I click on the buttons a few times.

On May 31, 2:52 pm, Yarko Tymciurak 
wrote:
> On May 31, 2:43 pm, mdipierro  wrote:
>
> > tha last is cool but the demo just crashed by firefox. :-(
>
> Really?   Which?  The jquery one, or the ZXing one?  --- my firefox
> (3.6.3 OS-X; and safari, and chrome) dealt with them ok.
>
>
>
> > On May 31, 1:46 pm, Yarko Tymciurak 
> > wrote:
>
> > > On May 31, 12:53 pm, ceriox  wrote:
>
> > > > like object...
>
> > > > i need to generate a label with barcode
>
> > > > anybody have an example?
>
> > > In general, you need to generate an image of some sort, based on data.
>
> > > To print images on badges, you could look at the mk_barcode() function
> > > inhttp://code.google.com/p/web2conf/source/browse/applications/register...
>
> > > Although I haven't tried this, you might also look 
> > > at:http://javascript-library-tips.changblog.com/2009/12/jquery-barcode.html
>
> > > - Yarko
>
> > > > thanks


[web2py] Re: how to generate barcode label ?

2010-05-31 Thread Yarko Tymciurak

On May 31, 2:43 pm, mdipierro  wrote:
> tha last is cool but the demo just crashed by firefox. :-(

Really?   Which?  The jquery one, or the ZXing one?  --- my firefox
(3.6.3 OS-X; and safari, and chrome) dealt with them ok.

>
> On May 31, 1:46 pm, Yarko Tymciurak 
> wrote:
>
> > On May 31, 12:53 pm, ceriox  wrote:
>
> > > like object...
>
> > > i need to generate a label with barcode
>
> > > anybody have an example?
>
> > In general, you need to generate an image of some sort, based on data.
>
> > To print images on badges, you could look at the mk_barcode() function
> > inhttp://code.google.com/p/web2conf/source/browse/applications/register...
>
> > Although I haven't tried this, you might also look 
> > at:http://javascript-library-tips.changblog.com/2009/12/jquery-barcode.html
>
> > - Yarko
>
> > > thanks


[web2py] Re: Trouble starting web2py

2010-05-31 Thread szimszon
Okay. Works but

  requires=IS_DATE(format=T('%Y-%m-%d))),

works too :)

TNX.

On máj. 31, 21:42, mdipierro  wrote:
>                 Field('expire','date',
>                       label=T("Expire"),
>                       requires=IS_DATE(format='%Y.%m.%d)),
>
> The format appears in two places, the language file for the js
> calendar and the validator above.
>
> On May 31, 2:30 pm, szimszon  wrote:
>
> > Okay. Now the validator says:
>
> > enter date as 1963-08-28
>
> > The 2010.05.31 isn't valid. :(
>
> > But have a
> >   '%Y-%m-%d': '%Y.%m.%d'
> > in language file and the date picker is working correctly
>
> > On máj. 31, 21:17, mdipierro  wrote:
>
> > > h. I do not know. I need to see more about the app.
> > > Anyway
>
> > >                 Field('expire','date',
> > >                       label=T("Expire"),
> > >                       requires=IS_NOT_EMPTY()),
>
> > > should be
>
> > >                 Field('expire','date',
> > >                       label=T("Expire"),
> > >                       requires=IS_DATE()),
>
> > > this may be part of the problem.
>
> > > On May 31, 2:04 pm, szimszon  wrote:
>
> > > > I was able to start web2py.
>
> > > > But I have a problem I don't know if it's existed in before...
>
> > > > SQLite db:
>
> > > > In hu-hu.py:
>
> > > >     '%Y-%m-%d': '%Y.%m.%d',
>
> > > > In db.py:
>
> > > >     db.define_table('dnssec_zsk',
> > > >                 Field('dns_id',db.dns,
> > > >                       label=T('DNS config'),
> > > >                       requires=IS_IN_DB(db,'dns.id','%(name)s'),),
> > > >                 Field('dns_zones_id',db.dns_zones,
> > > >                       label=T("Zone"),
> > > >                       requires=IS_IN_DB(db,'dns_zones.id','%
> > > > (name)s')),
> > > >                 Field('name','string',
> > > >                       label=T('Name'),
> > > >                       requires=IS_NOT_EMPTY(),
> > > >                       comment=T("Kdomain_name+algorithm_id
> > > > +key_id.extension"),
> > > >                       ),
> > > >                 Field('public','text',
> > > >                       label=T("Public key"),
> > > >                       requires=IS_NOT_EMPTY()),
> > > >                 Field('private','text',
> > > >                       label=T("Private key"),
> > > >                       requires=IS_NOT_EMPTY()),
> > > >                 Field('expire','date',
> > > >                       label=T("Expire"),
> > > >                       requires=IS_NOT_EMPTY()),
> > > >                 )
>
> > > > I insert a record.
>
> > > > If I query the table I get:
>
> > > >   invalid literal for int() with base 10: '2011.05.11'
>
> > > > I have the following row:
>
> > > > "4",,"Koregpreshaz.eu.
> > > > +005+61200","..","..","2011.05.11.","1","1"
>
> > > > On máj. 31, 19:21, mdipierro  wrote:
>
> > > > > I think I fixed this. Following advice from Alexandre Andrade. Please
> > > > > check latest trunk.
>
> > > > > Massimo
>
> > > > > On May 31, 10:35 am, szimszon  wrote:
>
> > > > > > Any progress? Can I help somehow?
>
> > > > > > On ápr. 19, 22:58, mdipierro  wrote:
>
> > > > > > > Mind that this is not the end of the story. Thesimplejsonthat 
> > > > > > > ships
> > > > > > > with web2py was modified to handle date/datetime/time. By 
> > > > > > > replacing
> > > > > > > with the latest officialsimplejsonyou will may not be able to
> > > > > > > serialize DAL records.
>
> > > > > > > One option is to include latest web2py in web2py and re-apply the
> > > > > > > patch. we will do so in 1.77.x but it would be useful to get to 
> > > > > > > the
> > > > > > > bottom of why this problem arose in the first place.
>
> > > > > > > Masismo
>
> > > > > > > On Apr 19, 3:36 pm, szimszon  wrote:
>
> > > > > > > > Okay, copy "/usr/share/pyshared/simplejson" to gluon/contrib 
> > > > > > > > seems to
> > > > > > > > work for me.
>
> > > > > > > > BigTNX. (1.77.2 :)
>
> > > > > > > > On ápr. 19, 22:25, mdipierro  wrote:
>
> > > > > > > > > try copysimplejsoninto gluon/contrib/simplejsonfor now.
>
> > > > > > > > > On Apr 19, 3:23 pm, szimszon  wrote:
>
> > > > > > > > > > I can't run it (1.77.1) even if I installed 
> > > > > > > > > > thesimplejson1.9.2 in
> > > > > > > > > > virtualenv:
>
> > > > > > > > > > >>> sys.path
>
> > > > > > > > > > ['', 
> > > > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > > > > > setuptools-0.6c11-py2.5.egg', 
> > > > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/
> > > > > > > > > > python2.5/site-packages/simplejson-1.9.2-py2.5.egg'...
>
> > > > > > > > > > On ápr. 19, 13:58, szimszon  wrote:
>
> > > > > > > > > > > I got the some traceback as before :(
>
> > > > > > > > > > > >>> sys.path
>
> > > > > > > > > > > ['', 
> > > > > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > > > > > > setuptools-0.6c11-py2.5.egg', 
> > > > > > > > > > > '/usr/lib/pymodules/python2.5', '/home/
> > > > > > > > > > > sz

[web2py] Re: how to generate barcode label ?

2010-05-31 Thread mdipierro
tha last is cool but the demo just crashed by firefox. :-(

On May 31, 1:46 pm, Yarko Tymciurak 
wrote:
> On May 31, 12:53 pm, ceriox  wrote:
>
> > like object...
>
> > i need to generate a label with barcode
>
> > anybody have an example?
>
> In general, you need to generate an image of some sort, based on data.
>
> To print images on badges, you could look at the mk_barcode() function
> inhttp://code.google.com/p/web2conf/source/browse/applications/register...
>
> Although I haven't tried this, you might also look 
> at:http://javascript-library-tips.changblog.com/2009/12/jquery-barcode.html
>
> - Yarko
>
>
>
> > thanks


[web2py] Re: Trouble starting web2py

2010-05-31 Thread mdipierro
Field('expire','date',
  label=T("Expire"),
  requires=IS_DATE(format='%Y.%m.%d)),

The format appears in two places, the language file for the js
calendar and the validator above.

On May 31, 2:30 pm, szimszon  wrote:
> Okay. Now the validator says:
>
> enter date as 1963-08-28
>
> The 2010.05.31 isn't valid. :(
>
> But have a
>   '%Y-%m-%d': '%Y.%m.%d'
> in language file and the date picker is working correctly
>
> On máj. 31, 21:17, mdipierro  wrote:
>
> > h. I do not know. I need to see more about the app.
> > Anyway
>
> >                 Field('expire','date',
> >                       label=T("Expire"),
> >                       requires=IS_NOT_EMPTY()),
>
> > should be
>
> >                 Field('expire','date',
> >                       label=T("Expire"),
> >                       requires=IS_DATE()),
>
> > this may be part of the problem.
>
> > On May 31, 2:04 pm, szimszon  wrote:
>
> > > I was able to start web2py.
>
> > > But I have a problem I don't know if it's existed in before...
>
> > > SQLite db:
>
> > > In hu-hu.py:
>
> > >     '%Y-%m-%d': '%Y.%m.%d',
>
> > > In db.py:
>
> > >     db.define_table('dnssec_zsk',
> > >                 Field('dns_id',db.dns,
> > >                       label=T('DNS config'),
> > >                       requires=IS_IN_DB(db,'dns.id','%(name)s'),),
> > >                 Field('dns_zones_id',db.dns_zones,
> > >                       label=T("Zone"),
> > >                       requires=IS_IN_DB(db,'dns_zones.id','%
> > > (name)s')),
> > >                 Field('name','string',
> > >                       label=T('Name'),
> > >                       requires=IS_NOT_EMPTY(),
> > >                       comment=T("Kdomain_name+algorithm_id
> > > +key_id.extension"),
> > >                       ),
> > >                 Field('public','text',
> > >                       label=T("Public key"),
> > >                       requires=IS_NOT_EMPTY()),
> > >                 Field('private','text',
> > >                       label=T("Private key"),
> > >                       requires=IS_NOT_EMPTY()),
> > >                 Field('expire','date',
> > >                       label=T("Expire"),
> > >                       requires=IS_NOT_EMPTY()),
> > >                 )
>
> > > I insert a record.
>
> > > If I query the table I get:
>
> > >   invalid literal for int() with base 10: '2011.05.11'
>
> > > I have the following row:
>
> > > "4",,"Koregpreshaz.eu.
> > > +005+61200","..","..","2011.05.11.","1","1"
>
> > > On máj. 31, 19:21, mdipierro  wrote:
>
> > > > I think I fixed this. Following advice from Alexandre Andrade. Please
> > > > check latest trunk.
>
> > > > Massimo
>
> > > > On May 31, 10:35 am, szimszon  wrote:
>
> > > > > Any progress? Can I help somehow?
>
> > > > > On ápr. 19, 22:58, mdipierro  wrote:
>
> > > > > > Mind that this is not the end of the story. Thesimplejsonthat ships
> > > > > > with web2py was modified to handle date/datetime/time. By replacing
> > > > > > with the latest officialsimplejsonyou will may not be able to
> > > > > > serialize DAL records.
>
> > > > > > One option is to include latest web2py in web2py and re-apply the
> > > > > > patch. we will do so in 1.77.x but it would be useful to get to the
> > > > > > bottom of why this problem arose in the first place.
>
> > > > > > Masismo
>
> > > > > > On Apr 19, 3:36 pm, szimszon  wrote:
>
> > > > > > > Okay, copy "/usr/share/pyshared/simplejson" to gluon/contrib 
> > > > > > > seems to
> > > > > > > work for me.
>
> > > > > > > BigTNX. (1.77.2 :)
>
> > > > > > > On ápr. 19, 22:25, mdipierro  wrote:
>
> > > > > > > > try copysimplejsoninto gluon/contrib/simplejsonfor now.
>
> > > > > > > > On Apr 19, 3:23 pm, szimszon  wrote:
>
> > > > > > > > > I can't run it (1.77.1) even if I installed 
> > > > > > > > > thesimplejson1.9.2 in
> > > > > > > > > virtualenv:
>
> > > > > > > > > >>> sys.path
>
> > > > > > > > > ['', 
> > > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > > > > setuptools-0.6c11-py2.5.egg', 
> > > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/
> > > > > > > > > python2.5/site-packages/simplejson-1.9.2-py2.5.egg'...
>
> > > > > > > > > On ápr. 19, 13:58, szimszon  wrote:
>
> > > > > > > > > > I got the some traceback as before :(
>
> > > > > > > > > > >>> sys.path
>
> > > > > > > > > > ['', 
> > > > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > > > > > setuptools-0.6c11-py2.5.egg', 
> > > > > > > > > > '/usr/lib/pymodules/python2.5', '/home/
> > > > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5', '/home/
> > > > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/plat-linux2', 
> > > > > > > > > > '/home/
> > > > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-tk', '/home/
> > > > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-dynload', 
> > > > > > > > > > '/usr/lib/
> > > > > > > > > > 

[web2py] Re: Trouble starting web2py

2010-05-31 Thread szimszon
Okay. Now the validator says:

enter date as 1963-08-28

The 2010.05.31 isn't valid. :(

But have a
  '%Y-%m-%d': '%Y.%m.%d'
in language file and the date picker is working correctly


On máj. 31, 21:17, mdipierro  wrote:
> h. I do not know. I need to see more about the app.
> Anyway
>
>                 Field('expire','date',
>                       label=T("Expire"),
>                       requires=IS_NOT_EMPTY()),
>
> should be
>
>                 Field('expire','date',
>                       label=T("Expire"),
>                       requires=IS_DATE()),
>
> this may be part of the problem.
>
> On May 31, 2:04 pm, szimszon  wrote:
>
> > I was able to start web2py.
>
> > But I have a problem I don't know if it's existed in before...
>
> > SQLite db:
>
> > In hu-hu.py:
>
> >     '%Y-%m-%d': '%Y.%m.%d',
>
> > In db.py:
>
> >     db.define_table('dnssec_zsk',
> >                 Field('dns_id',db.dns,
> >                       label=T('DNS config'),
> >                       requires=IS_IN_DB(db,'dns.id','%(name)s'),),
> >                 Field('dns_zones_id',db.dns_zones,
> >                       label=T("Zone"),
> >                       requires=IS_IN_DB(db,'dns_zones.id','%
> > (name)s')),
> >                 Field('name','string',
> >                       label=T('Name'),
> >                       requires=IS_NOT_EMPTY(),
> >                       comment=T("Kdomain_name+algorithm_id
> > +key_id.extension"),
> >                       ),
> >                 Field('public','text',
> >                       label=T("Public key"),
> >                       requires=IS_NOT_EMPTY()),
> >                 Field('private','text',
> >                       label=T("Private key"),
> >                       requires=IS_NOT_EMPTY()),
> >                 Field('expire','date',
> >                       label=T("Expire"),
> >                       requires=IS_NOT_EMPTY()),
> >                 )
>
> > I insert a record.
>
> > If I query the table I get:
>
> >   invalid literal for int() with base 10: '2011.05.11'
>
> > I have the following row:
>
> > "4",,"Koregpreshaz.eu.
> > +005+61200","..","..","2011.05.11.","1","1"
>
> > On máj. 31, 19:21, mdipierro  wrote:
>
> > > I think I fixed this. Following advice from Alexandre Andrade. Please
> > > check latest trunk.
>
> > > Massimo
>
> > > On May 31, 10:35 am, szimszon  wrote:
>
> > > > Any progress? Can I help somehow?
>
> > > > On ápr. 19, 22:58, mdipierro  wrote:
>
> > > > > Mind that this is not the end of the story. Thesimplejsonthat ships
> > > > > with web2py was modified to handle date/datetime/time. By replacing
> > > > > with the latest officialsimplejsonyou will may not be able to
> > > > > serialize DAL records.
>
> > > > > One option is to include latest web2py in web2py and re-apply the
> > > > > patch. we will do so in 1.77.x but it would be useful to get to the
> > > > > bottom of why this problem arose in the first place.
>
> > > > > Masismo
>
> > > > > On Apr 19, 3:36 pm, szimszon  wrote:
>
> > > > > > Okay, copy "/usr/share/pyshared/simplejson" to gluon/contrib seems 
> > > > > > to
> > > > > > work for me.
>
> > > > > > BigTNX. (1.77.2 :)
>
> > > > > > On ápr. 19, 22:25, mdipierro  wrote:
>
> > > > > > > try copysimplejsoninto gluon/contrib/simplejsonfor now.
>
> > > > > > > On Apr 19, 3:23 pm, szimszon  wrote:
>
> > > > > > > > I can't run it (1.77.1) even if I installed thesimplejson1.9.2 
> > > > > > > > in
> > > > > > > > virtualenv:
>
> > > > > > > > >>> sys.path
>
> > > > > > > > ['', 
> > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > > > setuptools-0.6c11-py2.5.egg', 
> > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/
> > > > > > > > python2.5/site-packages/simplejson-1.9.2-py2.5.egg'...
>
> > > > > > > > On ápr. 19, 13:58, szimszon  wrote:
>
> > > > > > > > > I got the some traceback as before :(
>
> > > > > > > > > >>> sys.path
>
> > > > > > > > > ['', 
> > > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > > > > setuptools-0.6c11-py2.5.egg', '/usr/lib/pymodules/python2.5', 
> > > > > > > > > '/home/
> > > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5', '/home/
> > > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/plat-linux2', 
> > > > > > > > > '/home/
> > > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-tk', '/home/
> > > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-dynload', 
> > > > > > > > > '/usr/lib/
> > > > > > > > > python2.5', '/usr/lib/python2.5/plat-linux2', 
> > > > > > > > > '/usr/lib/python2.5/lib-
> > > > > > > > > tk', 
> > > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages',
> > > > > > > > > '/usr/local/lib/python2.5/site-packages', 
> > > > > > > > > '/usr/lib/python2.5/site-
> > > > > > > > > packages', '/usr/lib/python2.5/site-packages/PIL', 
> > > > > > > > > '/usr/lib/python2.5/
> > > > > > > > > site-packages/gst-0.10', 
> > > > > > > > > '/usr/

[web2py] Re: Trouble starting web2py

2010-05-31 Thread mdipierro
h. I do not know. I need to see more about the app.
Anyway

Field('expire','date',
  label=T("Expire"),
  requires=IS_NOT_EMPTY()),

should be

Field('expire','date',
  label=T("Expire"),
  requires=IS_DATE()),

this may be part of the problem.

On May 31, 2:04 pm, szimszon  wrote:
> I was able to start web2py.
>
> But I have a problem I don't know if it's existed in before...
>
> SQLite db:
>
> In hu-hu.py:
>
>     '%Y-%m-%d': '%Y.%m.%d',
>
> In db.py:
>
>     db.define_table('dnssec_zsk',
>                 Field('dns_id',db.dns,
>                       label=T('DNS config'),
>                       requires=IS_IN_DB(db,'dns.id','%(name)s'),),
>                 Field('dns_zones_id',db.dns_zones,
>                       label=T("Zone"),
>                       requires=IS_IN_DB(db,'dns_zones.id','%
> (name)s')),
>                 Field('name','string',
>                       label=T('Name'),
>                       requires=IS_NOT_EMPTY(),
>                       comment=T("Kdomain_name+algorithm_id
> +key_id.extension"),
>                       ),
>                 Field('public','text',
>                       label=T("Public key"),
>                       requires=IS_NOT_EMPTY()),
>                 Field('private','text',
>                       label=T("Private key"),
>                       requires=IS_NOT_EMPTY()),
>                 Field('expire','date',
>                       label=T("Expire"),
>                       requires=IS_NOT_EMPTY()),
>                 )
>
> I insert a record.
>
> If I query the table I get:
>
>   invalid literal for int() with base 10: '2011.05.11'
>
> I have the following row:
>
> "4",,"Koregpreshaz.eu.
> +005+61200","..","..","2011.05.11.","1","1"
>
> On máj. 31, 19:21, mdipierro  wrote:
>
> > I think I fixed this. Following advice from Alexandre Andrade. Please
> > check latest trunk.
>
> > Massimo
>
> > On May 31, 10:35 am, szimszon  wrote:
>
> > > Any progress? Can I help somehow?
>
> > > On ápr. 19, 22:58, mdipierro  wrote:
>
> > > > Mind that this is not the end of the story. Thesimplejsonthat ships
> > > > with web2py was modified to handle date/datetime/time. By replacing
> > > > with the latest officialsimplejsonyou will may not be able to
> > > > serialize DAL records.
>
> > > > One option is to include latest web2py in web2py and re-apply the
> > > > patch. we will do so in 1.77.x but it would be useful to get to the
> > > > bottom of why this problem arose in the first place.
>
> > > > Masismo
>
> > > > On Apr 19, 3:36 pm, szimszon  wrote:
>
> > > > > Okay, copy "/usr/share/pyshared/simplejson" to gluon/contrib seems to
> > > > > work for me.
>
> > > > > BigTNX. (1.77.2 :)
>
> > > > > On ápr. 19, 22:25, mdipierro  wrote:
>
> > > > > > try copysimplejsoninto gluon/contrib/simplejsonfor now.
>
> > > > > > On Apr 19, 3:23 pm, szimszon  wrote:
>
> > > > > > > I can't run it (1.77.1) even if I installed thesimplejson1.9.2 in
> > > > > > > virtualenv:
>
> > > > > > > >>> sys.path
>
> > > > > > > ['', 
> > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > > setuptools-0.6c11-py2.5.egg', 
> > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/
> > > > > > > python2.5/site-packages/simplejson-1.9.2-py2.5.egg'...
>
> > > > > > > On ápr. 19, 13:58, szimszon  wrote:
>
> > > > > > > > I got the some traceback as before :(
>
> > > > > > > > >>> sys.path
>
> > > > > > > > ['', 
> > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > > > setuptools-0.6c11-py2.5.egg', '/usr/lib/pymodules/python2.5', 
> > > > > > > > '/home/
> > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5', '/home/
> > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/plat-linux2', '/home/
> > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-tk', '/home/
> > > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-dynload', 
> > > > > > > > '/usr/lib/
> > > > > > > > python2.5', '/usr/lib/python2.5/plat-linux2', 
> > > > > > > > '/usr/lib/python2.5/lib-
> > > > > > > > tk', 
> > > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages',
> > > > > > > > '/usr/local/lib/python2.5/site-packages', 
> > > > > > > > '/usr/lib/python2.5/site-
> > > > > > > > packages', '/usr/lib/python2.5/site-packages/PIL', 
> > > > > > > > '/usr/lib/python2.5/
> > > > > > > > site-packages/gst-0.10', 
> > > > > > > > '/usr/lib/pymodules/python2.5/gtk-2.0', '/usr/
> > > > > > > > lib/python2.5/site-packages/wx-2.6-gtk2-unicode']
>
> > > > > > > > On ápr. 19, 13:30, Mathieu Clabaut  
> > > > > > > > wrote:
>
> > > > > > > > > I use 
> > > > > > > > > virtualenvwrapperhttp://www.doughellmann.com/docs/virtualenvwrapper/which
> > > > > > > > > seems to work like a charm.
>
> > > > > > > > > export WORKON_HOME=$HOME/.virtualenvs
> > > > > > > > > source /usr/bin/virtualenvwrapper.sh # put those 2

[web2py] Re: Trouble starting web2py

2010-05-31 Thread szimszon
I was able to start web2py.

But I have a problem I don't know if it's existed in before...

SQLite db:

In hu-hu.py:

'%Y-%m-%d': '%Y.%m.%d',

In db.py:

db.define_table('dnssec_zsk',
Field('dns_id',db.dns,
  label=T('DNS config'),
  requires=IS_IN_DB(db,'dns.id','%(name)s'),),
Field('dns_zones_id',db.dns_zones,
  label=T("Zone"),
  requires=IS_IN_DB(db,'dns_zones.id','%
(name)s')),
Field('name','string',
  label=T('Name'),
  requires=IS_NOT_EMPTY(),
  comment=T("Kdomain_name+algorithm_id
+key_id.extension"),
  ),
Field('public','text',
  label=T("Public key"),
  requires=IS_NOT_EMPTY()),
Field('private','text',
  label=T("Private key"),
  requires=IS_NOT_EMPTY()),
Field('expire','date',
  label=T("Expire"),
  requires=IS_NOT_EMPTY()),
)

I insert a record.

If I query the table I get:

  invalid literal for int() with base 10: '2011.05.11'

I have the following row:

"4",,"Koregpreshaz.eu.
+005+61200","..","..","2011.05.11.","1","1"



On máj. 31, 19:21, mdipierro  wrote:
> I think I fixed this. Following advice from Alexandre Andrade. Please
> check latest trunk.
>
> Massimo
>
> On May 31, 10:35 am, szimszon  wrote:
>
> > Any progress? Can I help somehow?
>
> > On ápr. 19, 22:58, mdipierro  wrote:
>
> > > Mind that this is not the end of the story. Thesimplejsonthat ships
> > > with web2py was modified to handle date/datetime/time. By replacing
> > > with the latest officialsimplejsonyou will may not be able to
> > > serialize DAL records.
>
> > > One option is to include latest web2py in web2py and re-apply the
> > > patch. we will do so in 1.77.x but it would be useful to get to the
> > > bottom of why this problem arose in the first place.
>
> > > Masismo
>
> > > On Apr 19, 3:36 pm, szimszon  wrote:
>
> > > > Okay, copy "/usr/share/pyshared/simplejson" to gluon/contrib seems to
> > > > work for me.
>
> > > > BigTNX. (1.77.2 :)
>
> > > > On ápr. 19, 22:25, mdipierro  wrote:
>
> > > > > try copysimplejsoninto gluon/contrib/simplejsonfor now.
>
> > > > > On Apr 19, 3:23 pm, szimszon  wrote:
>
> > > > > > I can't run it (1.77.1) even if I installed thesimplejson1.9.2 in
> > > > > > virtualenv:
>
> > > > > > >>> sys.path
>
> > > > > > ['', 
> > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > setuptools-0.6c11-py2.5.egg', 
> > > > > > '/home/szimszon/.virtualenvs/web2py/lib/
> > > > > > python2.5/site-packages/simplejson-1.9.2-py2.5.egg'...
>
> > > > > > On ápr. 19, 13:58, szimszon  wrote:
>
> > > > > > > I got the some traceback as before :(
>
> > > > > > > >>> sys.path
>
> > > > > > > ['', 
> > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > > setuptools-0.6c11-py2.5.egg', '/usr/lib/pymodules/python2.5', 
> > > > > > > '/home/
> > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5', '/home/
> > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/plat-linux2', '/home/
> > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-tk', '/home/
> > > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-dynload', 
> > > > > > > '/usr/lib/
> > > > > > > python2.5', '/usr/lib/python2.5/plat-linux2', 
> > > > > > > '/usr/lib/python2.5/lib-
> > > > > > > tk', 
> > > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages',
> > > > > > > '/usr/local/lib/python2.5/site-packages', 
> > > > > > > '/usr/lib/python2.5/site-
> > > > > > > packages', '/usr/lib/python2.5/site-packages/PIL', 
> > > > > > > '/usr/lib/python2.5/
> > > > > > > site-packages/gst-0.10', '/usr/lib/pymodules/python2.5/gtk-2.0', 
> > > > > > > '/usr/
> > > > > > > lib/python2.5/site-packages/wx-2.6-gtk2-unicode']
>
> > > > > > > On ápr. 19, 13:30, Mathieu Clabaut  
> > > > > > > wrote:
>
> > > > > > > > I use 
> > > > > > > > virtualenvwrapperhttp://www.doughellmann.com/docs/virtualenvwrapper/which
> > > > > > > > seems to work like a charm.
>
> > > > > > > > export WORKON_HOME=$HOME/.virtualenvs
> > > > > > > > source /usr/bin/virtualenvwrapper.sh # put those 2 lines in your
> > > > > > > > $HOME/.bashrc
> > > > > > > > mkvirtualenv web2py
>
> > > > > > > > From here, you just have to type :
> > > > > > > > workon web2py
>
> > > > > > > > berfore launching web2py.
>
> > > > > > > > It is not a web2py solution, but it may help in the meanwhile.
>
> > > > > > > > -Mathieu
>
> > > > > > > > On Mon, Apr 19, 2010 at 13:15, szimszon  
> > > > > > > > wrote:
> > > > > > > > > Is there now a quick way to start web2py without 
> > > > > > > > > removingsimplejson
> > > > > > > > > from debian?
>
> > > > > > > > > Tnx.
>
> > > > > > > > > On ápr. 11, 16:23, mdip

[web2py] Re: how to generate barcode label ?

2010-05-31 Thread Yarko Tymciurak

On May 31, 12:53 pm, ceriox  wrote:
> like object...
>
> i need to generate a label with barcode
>
> anybody have an example?

In general, you need to generate an image of some sort, based on data.

To print images on badges, you could look at the mk_barcode() function
in
http://code.google.com/p/web2conf/source/browse/applications/register/controllers/badge.py?repo=pycon2010

Although I haven't tried this, you might also look at:
http://javascript-library-tips.changblog.com/2009/12/jquery-barcode.html

- Yarko

>
> thanks


[web2py] how to generate barcode label ?

2010-05-31 Thread ceriox
like object...

i need to generate a label with barcode

anybody have an example?

thanks


[web2py] Re: Trouble starting web2py

2010-05-31 Thread mdipierro
I think I fixed this. Following advice from Alexandre Andrade. Please
check latest trunk.

Massimo

On May 31, 10:35 am, szimszon  wrote:
> Any progress? Can I help somehow?
>
> On ápr. 19, 22:58, mdipierro  wrote:
>
> > Mind that this is not the end of the story. Thesimplejsonthat ships
> > with web2py was modified to handle date/datetime/time. By replacing
> > with the latest officialsimplejsonyou will may not be able to
> > serialize DAL records.
>
> > One option is to include latest web2py in web2py and re-apply the
> > patch. we will do so in 1.77.x but it would be useful to get to the
> > bottom of why this problem arose in the first place.
>
> > Masismo
>
> > On Apr 19, 3:36 pm, szimszon  wrote:
>
> > > Okay, copy "/usr/share/pyshared/simplejson" to gluon/contrib seems to
> > > work for me.
>
> > > BigTNX. (1.77.2 :)
>
> > > On ápr. 19, 22:25, mdipierro  wrote:
>
> > > > try copysimplejsoninto gluon/contrib/simplejsonfor now.
>
> > > > On Apr 19, 3:23 pm, szimszon  wrote:
>
> > > > > I can't run it (1.77.1) even if I installed thesimplejson1.9.2 in
> > > > > virtualenv:
>
> > > > > >>> sys.path
>
> > > > > ['', '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > setuptools-0.6c11-py2.5.egg', '/home/szimszon/.virtualenvs/web2py/lib/
> > > > > python2.5/site-packages/simplejson-1.9.2-py2.5.egg'...
>
> > > > > On ápr. 19, 13:58, szimszon  wrote:
>
> > > > > > I got the some traceback as before :(
>
> > > > > > >>> sys.path
>
> > > > > > ['', 
> > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > > setuptools-0.6c11-py2.5.egg', '/usr/lib/pymodules/python2.5', 
> > > > > > '/home/
> > > > > > szimszon/.virtualenvs/web2py/lib/python2.5', '/home/
> > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/plat-linux2', '/home/
> > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-tk', '/home/
> > > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-dynload', '/usr/lib/
> > > > > > python2.5', '/usr/lib/python2.5/plat-linux2', 
> > > > > > '/usr/lib/python2.5/lib-
> > > > > > tk', 
> > > > > > '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages',
> > > > > > '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-
> > > > > > packages', '/usr/lib/python2.5/site-packages/PIL', 
> > > > > > '/usr/lib/python2.5/
> > > > > > site-packages/gst-0.10', '/usr/lib/pymodules/python2.5/gtk-2.0', 
> > > > > > '/usr/
> > > > > > lib/python2.5/site-packages/wx-2.6-gtk2-unicode']
>
> > > > > > On ápr. 19, 13:30, Mathieu Clabaut  
> > > > > > wrote:
>
> > > > > > > I use 
> > > > > > > virtualenvwrapperhttp://www.doughellmann.com/docs/virtualenvwrapper/which
> > > > > > > seems to work like a charm.
>
> > > > > > > export WORKON_HOME=$HOME/.virtualenvs
> > > > > > > source /usr/bin/virtualenvwrapper.sh # put those 2 lines in your
> > > > > > > $HOME/.bashrc
> > > > > > > mkvirtualenv web2py
>
> > > > > > > From here, you just have to type :
> > > > > > > workon web2py
>
> > > > > > > berfore launching web2py.
>
> > > > > > > It is not a web2py solution, but it may help in the meanwhile.
>
> > > > > > > -Mathieu
>
> > > > > > > On Mon, Apr 19, 2010 at 13:15, szimszon  
> > > > > > > wrote:
> > > > > > > > Is there now a quick way to start web2py without 
> > > > > > > > removingsimplejson
> > > > > > > > from debian?
>
> > > > > > > > Tnx.
>
> > > > > > > > On ápr. 11, 16:23, mdipierro  wrote:
> > > > > > > > > What's your advice about this?
>
> > > > > > > > > Out r version ofsimplejsonis patched to serialize dates. We 
> > > > > > > > > could
> > > > > > > > > upgrade to the latest and re-patch and for now this problem 
> > > > > > > > > will go
> > > > > > > > > away but this is not a long term solution. Clearly we must 
> > > > > > > > > change
> > > > > > > > > something in the waysimplejsonis imported to avoid conflict.
>
> > > > > > > > > Massimo
>
> > > > > > > > > On Apr 11, 4:30 am, muybay  wrote:
>
> > > > > > > > > > I have the issue also. I am going to try this suggestion 
> > > > > > > > > > and possibly
> > > > > > > > > > diff the two versions (upgraded vs web2pysimplejson).
>
> > > > > > > > > > On Apr 8, 8:00 am, mdipierro  
> > > > > > > > > > wrote:
>
> > > > > > > > > > > One solution is to upgrade thesimplejsonthat comes with 
> > > > > > > > > > > web2py. The
> > > > > > > > > > > problem is that the one we use has been modified to 
> > > > > > > > > > > handle dates.
>
> > > > > > > > > > > On Apr 8, 4:27 am, Johann Spies  
> > > > > > > > > > > wrote:
>
> > > > > > > > > > > > Removing Debian's python-simplejsonhelped me to start 
> > > > > > > > > > > > web2py again
> > > > > > > > -
> > > > > > > > > > > > and broke some other stuff on Debian.
>
> > > > > > > > > > > > Regards
> > > > > > > > > > > > Johann
> > > > > > > > > > > > --
> > > > > > > > > > > >        "Every good gift and every perfect gift is from 
> > > > > > > > > > > > above,
> > > > > > > > > > > >       and cometh down from the Father of lights, wit

[web2py] Re: web2py Conference Management System

2010-05-31 Thread Yarko Tymciurak

On May 31, 12:10 pm, Yarko Tymciurak 
wrote:
> On May 31, 11:49 am, mdipierro  wrote:
>
> > On May 31, 11:33 am, Yarko Tymciurak 
> > wrote:
>
> > > web2conf from 2010 will not run with web2py 1.78.3;
> > > If you checkout from the pycon2010 repository, which includes the
> > > version of
> > > web2py.
>
> > Why? Is this is a backward compatibility issue?
>
> Sorry - it was out of habit - I have just tried, and it seems to work
> on current RC web2py.
>
> Looking at the repository, I see I pushed a models/
> 0_private_example.py into the pycon repository, but not the main
> repository.
>
> You need to define the items you see 
> inhttp://code.google.com/p/web2conf/source/browse/applications/register...
>
> web2conf should then run.
>
> - Yarko

The link to the raw file is:
http://pycon2010.web2conf.googlecode.com/hg/applications/register/models/0_private_example.py

>
>
>
> > Attention. hevw requires trunk.


[web2py] Re: web2py Conference Management System

2010-05-31 Thread Yarko Tymciurak
On May 31, 11:49 am, mdipierro  wrote:
> On May 31, 11:33 am, Yarko Tymciurak 
> wrote:
>
> > web2conf from 2010 will not run with web2py 1.78.3;
> > If you checkout from the pycon2010 repository, which includes the
> > version of
> > web2py.
>
> Why? Is this is a backward compatibility issue?

Sorry - it was out of habit - I have just tried, and it seems to work
on current RC web2py.

Looking at the repository, I see I pushed a models/
0_private_example.py into the pycon repository, but not the main
repository.

You need to define the items you see in
http://code.google.com/p/web2conf/source/browse/applications/register/models/0_private_example.py?repo=pycon2010

web2conf should then run.

- Yarko

>
> Attention. hevw requires trunk.


[web2py] Re: web2py Conference Management System

2010-05-31 Thread mdipierro

On May 31, 11:33 am, Yarko Tymciurak 
wrote:

> web2conf from 2010 will not run with web2py 1.78.3;
> If you checkout from the pycon2010 repository, which includes the
> version of
> web2py.

Why? Is this is a backward compatibility issue?

Attention. hevw requires trunk.


[web2py] Re: python 2.4 support

2010-05-31 Thread Cory Coager
Sorry I should have been more clear, its a shared web host running
python 2.4.  I do not have root access.  Will this still be possible?


[web2py] Re: web2py Conference Management System

2010-05-31 Thread Yarko Tymciurak
Hello KR -

I have just tried both the flisol version, and Massimo's hevw with the
current RC2 version of web2py.
I had the same issue w/ pools argument;Besides the issue w/
"balance"  (I have not reviewed the flisol version, but know that
experience w/ PyCon called for refactoring the way payments are
structured) -- I also see fhe flisol version has remnants of PyCon
table structure (e.g., payments to PSF, and so forth).

web2conf from 2010 will not run with web2py 1.78.3;
If you checkout from the pycon2010 repository, which includes the
version of
web2py.

The hevw version does not seem to (yet) include payment / registration
fee handling.

As for wiki, this is something you could integrate a simple wiki, to
suite your needs - try, for eample, http://web2py.com/appliances/default/show/55

I too see the issues with balance...   since 2 years of experience w/
PyCon showed the basic approach to payments in web2py needing
refactoring, I am not likely to look at this issue w/ the flisol
branch.

Payments are too tied to a person, rather than an admittance; too many
companies and sponsors wanted to buy blocks of "tickets" to hand out
to employees, but payment was tied to people - we had to ask for
registrations before we'd sell blocks, and it turned out to be too
problematic;  I ended making a batch registration tool, and asked
sponsors for minimal info:  name / email list.  Even that was asking
too much - often, they did not know names when they were ready to pay,
so the basic refactoring that is called for is clear to me.   This may
not be a problem where you do not have business and sponsors, but the
approach of "admittance tickets" bought, and then assigned to people
should work in all cases, and has clear advantages for what we see at
PyCon.

Massimo seems to have made some progress on paper review in hevw.

Besides wiki like content management, you may also want to consider
schedules, room allocation and assignments - the functionalities of
the sort in PyCon-Tech (a django app used for years of PyCons).
This too has been a lot of maintenance work, and as far as I
understand, and alternative approach is being considered for those
aspects of PyCon (although I do not know the details).

- Yarko


On May 31, 9:25 am, KR  wrote:
> Hello,
>
> Thanks for the answers.
>
> I tried both versions and none of them works out of the box.
>
> Here is the trace for the Flisol (same as the PyCon) one:
>
> x...@box~/work/web2py/web2py$ python web2py.py -S web2confF -M
> web2py Enterprise Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2010
> Version 1.78.3 (2010-05-17 21:59:39)
> Database drivers available: SQLite3
> Traceback (most recent call last):
>   File "/home/xxx/work/web2py/web2py/gluon/restricted.py", line 178,
> in restricted
>     exec ccode in environment
>   File "applications/web2confF/models/db_cleanup.py", line 1, in
> 
>     db(db.payment.created_on (db.payment.status.lower()=='pre-processing').delete()
>   File "/home/xxx/work/web2py/web2py/gluon/sql.py", line 3247, in
> delete
>     self._db._execute(query)
>   File "/home/xxx/work/web2py/web2py/gluon/sql.py", line 899, in
> 
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> OperationalError: no such table: payment
>
> If somebody has a simple way to make it work, I will do that.
> Otherwize, I will remove the payment stuffs (not sure to use it
> anyway). Help for doing that would be appreciate as well.
>
> Some info:
> - web2py Version 1.78.3 (2010-05-17 21:59:39) (if I need a previous
> version, which one and where to find it please ?)
> - I don't understand spanish (french is my mother tongue)
> - I need some CMS (or at least wiki) functionnality to manage the
> website
> - I deleted the databases folder and recreated it (empty)
> - The default "reingart-web2conf" works after having replaced
> db=SQLDB(DBURI,pools=DBPOOLS) by db=SQLDB(DBURI) and create the non
> existant databases folder. But they are other issues (balance is
> none ? making some requests failed) and it seems not to implement some
> CMS functionnalities.
>
> Thx already.
>
> On 27 mai, 07:23, Yarko Tymciurak  wrote:
>
>
>
> > Mariano -
>
> > Thank you - I hadn't seen that you made a clone.
>
> > FYI for others:  you can the list of clones 
> > at:http://code.google.com/p/web2conf/source/clones
>
> > I will look over this in June, and look at merging back (there are
> > things in the base web2conf that need cleanup, updates - which looks
> > like Mariano made many).
>
> > - Yarko
>
> > On May 26, 2:32 pm, Mariano Reingart  wrote:
>
> > > On Wed, May 26, 2010 at 2:19 PM, Yarko Tymciurak
>
> > >  wrote:
>
> > > > On May 26, 9:23 am, KR  wrote:
> > > >> Hello,
>
> > > >> There is a Vimeo screencast (http://www.vimeo.com/1838049) about a
> > > >> web2py Conference Management System. Does anybody know wher I can
> > > >> download the soource code of that ?
>
> > > > You can get the version used at PyCon-2010 at code.google.com/p/
> > > > web2conf
>
> >

[web2py] Re: python 2.4 support

2010-05-31 Thread Cory Coager
I just found this documentation on AlterEgo, is this all thats needed?

http://web2py.com/AlterEgo/default/show/231


[web2py] Re: Trouble starting web2py

2010-05-31 Thread szimszon
Any progress? Can I help somehow?

On ápr. 19, 22:58, mdipierro  wrote:
> Mind that this is not the end of the story. Thesimplejsonthat ships
> with web2py was modified to handle date/datetime/time. By replacing
> with the latest officialsimplejsonyou will may not be able to
> serialize DAL records.
>
> One option is to include latest web2py in web2py and re-apply the
> patch. we will do so in 1.77.x but it would be useful to get to the
> bottom of why this problem arose in the first place.
>
> Masismo
>
> On Apr 19, 3:36 pm, szimszon  wrote:
>
> > Okay, copy "/usr/share/pyshared/simplejson" to gluon/contrib seems to
> > work for me.
>
> > BigTNX. (1.77.2 :)
>
> > On ápr. 19, 22:25, mdipierro  wrote:
>
> > > try copysimplejsoninto gluon/contrib/simplejsonfor now.
>
> > > On Apr 19, 3:23 pm, szimszon  wrote:
>
> > > > I can't run it (1.77.1) even if I installed thesimplejson1.9.2 in
> > > > virtualenv:
>
> > > > >>> sys.path
>
> > > > ['', '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > setuptools-0.6c11-py2.5.egg', '/home/szimszon/.virtualenvs/web2py/lib/
> > > > python2.5/site-packages/simplejson-1.9.2-py2.5.egg'...
>
> > > > On ápr. 19, 13:58, szimszon  wrote:
>
> > > > > I got the some traceback as before :(
>
> > > > > >>> sys.path
>
> > > > > ['', '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages/
> > > > > setuptools-0.6c11-py2.5.egg', '/usr/lib/pymodules/python2.5', '/home/
> > > > > szimszon/.virtualenvs/web2py/lib/python2.5', '/home/
> > > > > szimszon/.virtualenvs/web2py/lib/python2.5/plat-linux2', '/home/
> > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-tk', '/home/
> > > > > szimszon/.virtualenvs/web2py/lib/python2.5/lib-dynload', '/usr/lib/
> > > > > python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-
> > > > > tk', '/home/szimszon/.virtualenvs/web2py/lib/python2.5/site-packages',
> > > > > '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-
> > > > > packages', '/usr/lib/python2.5/site-packages/PIL', 
> > > > > '/usr/lib/python2.5/
> > > > > site-packages/gst-0.10', '/usr/lib/pymodules/python2.5/gtk-2.0', 
> > > > > '/usr/
> > > > > lib/python2.5/site-packages/wx-2.6-gtk2-unicode']
>
> > > > > On ápr. 19, 13:30, Mathieu Clabaut  wrote:
>
> > > > > > I use 
> > > > > > virtualenvwrapperhttp://www.doughellmann.com/docs/virtualenvwrapper/which
> > > > > > seems to work like a charm.
>
> > > > > > export WORKON_HOME=$HOME/.virtualenvs
> > > > > > source /usr/bin/virtualenvwrapper.sh # put those 2 lines in your
> > > > > > $HOME/.bashrc
> > > > > > mkvirtualenv web2py
>
> > > > > > From here, you just have to type :
> > > > > > workon web2py
>
> > > > > > berfore launching web2py.
>
> > > > > > It is not a web2py solution, but it may help in the meanwhile.
>
> > > > > > -Mathieu
>
> > > > > > On Mon, Apr 19, 2010 at 13:15, szimszon  wrote:
> > > > > > > Is there now a quick way to start web2py without 
> > > > > > > removingsimplejson
> > > > > > > from debian?
>
> > > > > > > Tnx.
>
> > > > > > > On ápr. 11, 16:23, mdipierro  wrote:
> > > > > > > > What's your advice about this?
>
> > > > > > > > Out r version ofsimplejsonis patched to serialize dates. We 
> > > > > > > > could
> > > > > > > > upgrade to the latest and re-patch and for now this problem 
> > > > > > > > will go
> > > > > > > > away but this is not a long term solution. Clearly we must 
> > > > > > > > change
> > > > > > > > something in the waysimplejsonis imported to avoid conflict.
>
> > > > > > > > Massimo
>
> > > > > > > > On Apr 11, 4:30 am, muybay  wrote:
>
> > > > > > > > > I have the issue also. I am going to try this suggestion and 
> > > > > > > > > possibly
> > > > > > > > > diff the two versions (upgraded vs web2pysimplejson).
>
> > > > > > > > > On Apr 8, 8:00 am, mdipierro  wrote:
>
> > > > > > > > > > One solution is to upgrade thesimplejsonthat comes with 
> > > > > > > > > > web2py. The
> > > > > > > > > > problem is that the one we use has been modified to handle 
> > > > > > > > > > dates.
>
> > > > > > > > > > On Apr 8, 4:27 am, Johann Spies  
> > > > > > > > > > wrote:
>
> > > > > > > > > > > Removing Debian's python-simplejsonhelped me to start 
> > > > > > > > > > > web2py again
> > > > > > > -
> > > > > > > > > > > and broke some other stuff on Debian.
>
> > > > > > > > > > > Regards
> > > > > > > > > > > Johann
> > > > > > > > > > > --
> > > > > > > > > > >        "Every good gift and every perfect gift is from 
> > > > > > > > > > > above,
> > > > > > > > > > >       and cometh down from the Father of lights, with whom
> > > > > > > > > > >       is no variableness, neither shadow of turning."
> > > > > > > > > > >                              James 1:17
>
> > > > > > > --
> > > > > > > Subscription settings:
> > > > > > >http://groups.google.com/group/web2py/subscribe?hl=en
>
>


[web2py] Re: "Belongs" Issues

2010-05-31 Thread mdipierro
Your code shoudl wrok except that I would replace

(db.MyLogs.iteration_max.belongs(finished_tasks)).__invert__()

with

~(db.MyLogs.iteration_max.belongs(finished_tasks))

what error do you get?

On May 31, 8:37 am, till  wrote:
> Hi all,
>
> I having some issues using the "belongs" function of the DAL.
>
> I'm trying to get the entry of the logs that has had no entry with
> logtype==3 yet on the current "iteration_max", but only one or more
> entries with logtype==10 and a timestamp that is older than the
> timeout in seconds, given with "myTimeout".
>
> Is there any way to get this working?
>
> thanks in advance!
>
> [code]
> myID=0 # some dummy ID...
> finished_tasks = db((db.MyLogs.run== myID) &
> (db.MyLogs.logtype==3))._select(db.MyLogs.iteration_max)
> import datetime
> timeout = datetime.datetime.now()
> timeout = timeout-datetime.timedelta(seconds=myTimeout)
> unfinished_tasks = db((db.MyLogs.run== myID) &
> (db.MyLogs.timestamp>timeout) &(db.MyLogs.logtype==10) &
> ((db.MyLogs.iteration_max.belongs(finished_tasks)).__invert__()  ) 
> ).select(db.MyLogs.iteration_max,orderby=db.MyLogs.iteration_max,limitby=(0,1))
> [/code]


[web2py] "Belongs" Issues

2010-05-31 Thread till
Hi all,

I having some issues using the "belongs" function of the DAL.

I'm trying to get the entry of the logs that has had no entry with
logtype==3 yet on the current "iteration_max", but only one or more
entries with logtype==10 and a timestamp that is older than the
timeout in seconds, given with "myTimeout".

Is there any way to get this working?

thanks in advance!

[code]
myID=0 # some dummy ID...
finished_tasks = db((db.MyLogs.run== myID) &
(db.MyLogs.logtype==3))._select(db.MyLogs.iteration_max)
import datetime
timeout = datetime.datetime.now()
timeout = timeout-datetime.timedelta(seconds=myTimeout)
unfinished_tasks = db((db.MyLogs.run== myID) &
(db.MyLogs.timestamp>timeout) &(db.MyLogs.logtype==10) &
((db.MyLogs.iteration_max.belongs(finished_tasks)).__invert__()  ) 
).select(db.MyLogs.iteration_max,orderby=db.MyLogs.iteration_max,limitby=(0,1))
[/code]


[web2py] Re: uniqueness Constraint

2010-05-31 Thread mdipierro
Why whitout unique=True. What happens when you have unique=True?

On May 31, 9:50 am, Neveen Adel  wrote:
> Thanks a lot NetAdmin, it works fine with me but without unique=True.


[web2py] Re: web2py Conference Management System

2010-05-31 Thread mdipierro
Perhaps this will be helpful.

http://www.vimeo.com/12157148

On May 31, 9:25 am, KR  wrote:
> Hello,
>
> Thanks for the answers.
>
> I tried both versions and none of them works out of the box.
>
> Here is the trace for the Flisol (same as the PyCon) one:
>
> x...@box~/work/web2py/web2py$ python web2py.py -S web2confF -M
> web2py Enterprise Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2010
> Version 1.78.3 (2010-05-17 21:59:39)
> Database drivers available: SQLite3
> Traceback (most recent call last):
>   File "/home/xxx/work/web2py/web2py/gluon/restricted.py", line 178,
> in restricted
>     exec ccode in environment
>   File "applications/web2confF/models/db_cleanup.py", line 1, in
> 
>     db(db.payment.created_on (db.payment.status.lower()=='pre-processing').delete()
>   File "/home/xxx/work/web2py/web2py/gluon/sql.py", line 3247, in
> delete
>     self._db._execute(query)
>   File "/home/xxx/work/web2py/web2py/gluon/sql.py", line 899, in
> 
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> OperationalError: no such table: payment
>
> If somebody has a simple way to make it work, I will do that.
> Otherwize, I will remove the payment stuffs (not sure to use it
> anyway). Help for doing that would be appreciate as well.
>
> Some info:
> - web2py Version 1.78.3 (2010-05-17 21:59:39) (if I need a previous
> version, which one and where to find it please ?)
> - I don't understand spanish (french is my mother tongue)
> - I need some CMS (or at least wiki) functionnality to manage the
> website
> - I deleted the databases folder and recreated it (empty)
> - The default "reingart-web2conf" works after having replaced
> db=SQLDB(DBURI,pools=DBPOOLS) by db=SQLDB(DBURI) and create the non
> existant databases folder. But they are other issues (balance is
> none ? making some requests failed) and it seems not to implement some
> CMS functionnalities.
>
> Thx already.
>
> On 27 mai, 07:23, Yarko Tymciurak  wrote:
>
> > Mariano -
>
> > Thank you - I hadn't seen that you made a clone.
>
> > FYI for others:  you can the list of clones 
> > at:http://code.google.com/p/web2conf/source/clones
>
> > I will look over this in June, and look at merging back (there are
> > things in the base web2conf that need cleanup, updates - which looks
> > like Mariano made many).
>
> > - Yarko
>
> > On May 26, 2:32 pm, Mariano Reingart  wrote:
>
> > > On Wed, May 26, 2010 at 2:19 PM, Yarko Tymciurak
>
> > >  wrote:
>
> > > > On May 26, 9:23 am, KR  wrote:
> > > >> Hello,
>
> > > >> There is a Vimeo screencast (http://www.vimeo.com/1838049) about a
> > > >> web2py Conference Management System. Does anybody know wher I can
> > > >> download the soource code of that ?
>
> > > > You can get the version used at PyCon-2010 at code.google.com/p/
> > > > web2conf
>
> > > > There is also an older version, which was modified for FLISOL-2010
> > > > I'll have to find that (eventually, that should be merged back to
> > > > web2conf).
>
> > > You can found them in flisol 2010 and pyday branches of my web2conf clone:
>
> > >http://code.google.com/r/reingart-web2conf/
>
> > > Flisol:http://code.google.com/r/reingart-web2conf/source/browse/?r=1d551738b...
>
> > > PyDay:http://code.google.com/r/reingart-web2conf/source/browse/?r=0776772cb...
>
> > > Running 
> > > sites:http://www.institutopascal.edu.ar/flisol2010?lang=eshttp://www.pyday
>
> > > Sorry, I didn't have time to generalize them and merge back to the
> > > web2conf trunk.
>
> > > > Right now, web2conf needs a few updates and refactorings (typically,
> > > > during the course of a registration cycle, things are fixed, added,
> > > > etc. and should be re-visited, cleaned).   For example this web2conf
> > > > is based on an older version of web2py.
>
> > > I would be cleaning up some things, if there are any plans, please let me 
> > > know.
>
> > > I'm thinking of:
> > >  * Spearate default.py into talks.py, registration.py statics.py, etc.
> > >  * Finish talk reviewing/voting
> > >  * Eliminate some T2 stuff
> > >  * Rewrite PDF generation (badge and attendance certificate) using
> > > PyFPDF (removing dependencies like dabo)
> > >  * Speed-up, caching, cleanup, easier configuration, etc.
>
> > > Best regards,
>
> > > Mariano 
> > > Reingarthttp://www.web2py.com.arhttp://www.sistemasagiles.com.arhttp://reinga...


[web2py] Re: uniqueness Constraint

2010-05-31 Thread Neveen Adel
Thanks a lot NetAdmin, it works fine with me but without unique=True.


[web2py] cancel button in update and create work differently

2010-05-31 Thread annet
I have a function to update opening hours:

@auth.requires_membership('homepage_manager')
def update_openinghours():
openinghours=db(db.openinghours.company_id==auth.user.company_id)\
.select(db.openinghours.ALL)
form=[]
if not openinghours or request.vars.x:
if not response.init_flash: response.init_flash='Insert
opening hour'
message='Opening hour inserted'
 
form=create_form(db.openinghours,'update_openingshours',message=message)
else:
if not request.args:
if not response.init_flash: response.init_flash='Opening
hours in database'
else:
if not response.init_flash: response.init_flash='Update
opening hour'
message='Opening hour updated'
 
form=update_form(db.openinghours,request.args[0],'update_openinghours',
\
message=message,deletable=True)
return dict(openinghours=openinghours,form=form)


In the create_form and update_form functions I add a cancel button to
the form which redirects to the current page:

def create_form(table,next,message):
 
form=crud.create(table=table,next=(URL(r=request,f=next)),message=message)
form[0][-1][1].append(INPUT(_type="button",_value="Cancel",\
_onclick="window.location='%s';"%URL(r=request,f=next)))
return form


def update_form(table,record,next,message,deletable):
 
form=crud.update(table=table,record=record,next=(URL(r=request,f=next)),message=message,deletable=deletable)
form[0][-1][1].append(INPUT(_type="button",_value="Cancel",\
_onclick="window.location='%s';"%URL(r=request,f=next)))
return form


In the view I have a link "insert record":

{{=A('Insert
record',_onmouseover="this.style.cursor='pointer';",\
_href=URL(r=request,f='update_openinghours',vars={'x':1}))}}


and the days are links:

 {{=A(record.dag,_onmouseover="this.style.cursor='pointer';",\
_href=URL(r=request,f='update_openinghours',args=[record.id]))}}



The problem is everything works accept for the cancel button in the
create_form, which results in an invalid function error when clicked.
This I don't understand, while the url's of the cancel buttons in both
the create_form and the update_form read the same, the cancel button
in the update_form works, the form above the table containing the
opening hours disappears and just the table is displayed.

I hope one of you knows why this happens and how I can fix this
problem.


Kind regards,

Annet.


[web2py] Re: web2py Conference Management System

2010-05-31 Thread KR
Hello,

Thanks for the answers.

I tried both versions and none of them works out of the box.

Here is the trace for the Flisol (same as the PyCon) one:

x...@box~/work/web2py/web2py$ python web2py.py -S web2confF -M
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2010
Version 1.78.3 (2010-05-17 21:59:39)
Database drivers available: SQLite3
Traceback (most recent call last):
  File "/home/xxx/work/web2py/web2py/gluon/restricted.py", line 178,
in restricted
exec ccode in environment
  File "applications/web2confF/models/db_cleanup.py", line 1, in

db(db.payment.created_on
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
OperationalError: no such table: payment

If somebody has a simple way to make it work, I will do that.
Otherwize, I will remove the payment stuffs (not sure to use it
anyway). Help for doing that would be appreciate as well.

Some info:
- web2py Version 1.78.3 (2010-05-17 21:59:39) (if I need a previous
version, which one and where to find it please ?)
- I don't understand spanish (french is my mother tongue)
- I need some CMS (or at least wiki) functionnality to manage the
website
- I deleted the databases folder and recreated it (empty)
- The default "reingart-web2conf" works after having replaced
db=SQLDB(DBURI,pools=DBPOOLS) by db=SQLDB(DBURI) and create the non
existant databases folder. But they are other issues (balance is
none ? making some requests failed) and it seems not to implement some
CMS functionnalities.

Thx already.

On 27 mai, 07:23, Yarko Tymciurak  wrote:
> Mariano -
>
> Thank you - I hadn't seen that you made a clone.
>
> FYI for others:  you can the list of clones 
> at:http://code.google.com/p/web2conf/source/clones
>
> I will look over this in June, and look at merging back (there are
> things in the base web2conf that need cleanup, updates - which looks
> like Mariano made many).
>
> - Yarko
>
> On May 26, 2:32 pm, Mariano Reingart  wrote:
>
> > On Wed, May 26, 2010 at 2:19 PM, Yarko Tymciurak
>
> >  wrote:
>
> > > On May 26, 9:23 am, KR  wrote:
> > >> Hello,
>
> > >> There is a Vimeo screencast (http://www.vimeo.com/1838049) about a
> > >> web2py Conference Management System. Does anybody know wher I can
> > >> download the soource code of that ?
>
> > > You can get the version used at PyCon-2010 at code.google.com/p/
> > > web2conf
>
> > > There is also an older version, which was modified for FLISOL-2010
> > > I'll have to find that (eventually, that should be merged back to
> > > web2conf).
>
> > You can found them in flisol 2010 and pyday branches of my web2conf clone:
>
> >http://code.google.com/r/reingart-web2conf/
>
> > Flisol:http://code.google.com/r/reingart-web2conf/source/browse/?r=1d551738b...
>
> > PyDay:http://code.google.com/r/reingart-web2conf/source/browse/?r=0776772cb...
>
> > Running 
> > sites:http://www.institutopascal.edu.ar/flisol2010?lang=eshttp://www.pyday
>
> > Sorry, I didn't have time to generalize them and merge back to the
> > web2conf trunk.
>
> > > Right now, web2conf needs a few updates and refactorings (typically,
> > > during the course of a registration cycle, things are fixed, added,
> > > etc. and should be re-visited, cleaned).   For example this web2conf
> > > is based on an older version of web2py.
>
> > I would be cleaning up some things, if there are any plans, please let me 
> > know.
>
> > I'm thinking of:
> >  * Spearate default.py into talks.py, registration.py statics.py, etc.
> >  * Finish talk reviewing/voting
> >  * Eliminate some T2 stuff
> >  * Rewrite PDF generation (badge and attendance certificate) using
> > PyFPDF (removing dependencies like dabo)
> >  * Speed-up, caching, cleanup, easier configuration, etc.
>
> > Best regards,
>
> > Mariano 
> > Reingarthttp://www.web2py.com.arhttp://www.sistemasagiles.com.arhttp://reinga...


[web2py] Re: uniqueness Constraint

2010-05-31 Thread Neveen Adel
Thanks a lot NetAdmin, it works fine with me but without unique=True.


[web2py] Re: uniqueness Constraint

2010-05-31 Thread NetAdmin
Try something like this.

db.define_table('companies',
Field('name', length=512, default='', unique=True),
Field('oncontract', 'boolean', default=False)
)

db.person.name.requires = [IS_NOT_EMPTY(),
   IS_NOT_IN_DB(db, 'person.name')]


On May 31, 7:30 am, Neveen Adel  wrote:
> Hello,
>
> How can i add uniqueness constraint  to SQLField ?
>
> Thanks in Advance


Re: [web2py] Re: help with auth.requires_login()

2010-05-31 Thread Mathieu Clabaut
I did a quick test which seems to work :

class Essai(object):

def requires_login(self, next=None, message="login required" ):

"""

decorator that prevents access to action if not logged in

"""


> def decorator(action):


> def f(*a, **b):

*pnext = next*

self.flash = message

if not pnext:

pnext = "defaulturl"

print pnext, self.flash

return action(*a, **b)

f.__doc__ = action.__doc__

f.__name__ = action.__name__

f.__dict__.update(action.__dict__)

return f


> return decorator


>
> e=Essai()


> @e.requires_login()

def myfunc(x,y):

print "myfunc",x,y


> @e.requires_login(next="other_next", message = "failed")

def myfunc2(x,y):

print "myfunc2",x,y


> myfunc(0,"c")

myfunc2(1,"a")


Which output :

> defaulturl login required

myfunc 0 c

other_next failed

myfunc2 1 a


 But you're right, we have to be careful with the variable scope. Without
copying the decorator parameter into the local scope (see pnext), I
get UnboundLocalError: local variable 'next' referenced before
assignment

-Mathieu


On Sun, May 30, 2010 at 01:57, mdipierro  wrote:

> I need to try this. there is a potential issue wich scope of
> variables.
>
> On May 29, 11:09 am, Mathieu Clabaut 
> wrote:
> > Did i miss something ot the following would be ok ?
> >
> > def requires_login(self, next=None,
> message=self.message.access_denied
> > ):
> > """
> > decorator that prevents access to action if not logged in
> > """
> >
> > def decorator(action):
> >
> > def f(*a, **b):
> >
> > if not self.basic() and not self.is_logged_in():
> > request = self.environment.request
> > self.environment.session.flash = message
> > if not next:
> > next = self.settings.login_url + '?_next=' + \
> >
> >  urllib.quote(URL(r=request,args=request.args,
> > vars=request.get_vars))
> > redirect(next)
> > return action(*a, **b)
> > f.__doc__ = action.__doc__
> > f.__name__ = action.__name__
> > f.__dict__.update(action.__dict__)
> > return f
> >
> > return decorator
> >
> > On Tue, May 25, 2010 at 01:07, Massimo Di Pierro <
> mdipie...@cs.depaul.edu>wrote:
> >
> > > It would be nice to be able to pass the following arguments to
> >
> > > @auth.requires_login(next=URL(...),message=T(...))
> >
> > > where next is the url to redirect to in case of no login. message is
> the
> > > message to be displayed.
> > > If somebody has time and wants to take a crack at it, let me know. It
> > > should be possible by modifying only the requires_login method.
> > > The problem is passing the arguments from the decorator to the function
> > > being returned.
> >
> > > Once the problem is solved we can add the feature to
> requires_membership
> > > and requires_permissions.
> >
> > > Massimo
>


[web2py] uniqueness Constraint

2010-05-31 Thread Neveen Adel
Hello,

How can i add uniqueness constraint  to SQLField ?


Thanks in Advance


[web2py] [patch] search pattern for '{{extend}}'

2010-05-31 Thread ont.rif
Pattern in gluon/myregex.py must be compiled with MULTILINE option:

regex_extend = re.compile(\
'^\s*(?P\{\{\s*extend\s+[\'"](?P[^\'"]+)[\'"]\s*\}\})',
re.MULTILINE )

When {{extend ''}} not in first line of file it doesn't be shown
in admin page.


[web2py] Re: Email "perfect" regex

2010-05-31 Thread blackthorne
:)

On May 31, 5:59 am, mdipierro  wrote:
> I agree with Jonathan on this one but I would not oppose something
> like
>
> IS_EMAIL(strict=True)?
>
> Massimo
>
> On May 30, 9:47 pm, blackthorne  wrote:
>
>
>
> > My point is... why do you use IS_EMAIL() validator? because you want
> > to know if that email address is valid or not. why? probably because
> > you want your app to send the user an email, so to prevent it not to
> > arrive to its destiny it becomes important to make sure, that email
> > address is valid.
> > If the validator considers 'a...@d_-f.us' invalid, I would call it
> > success because that is not a valid email address, probably a typo.
>
> > Yes, we can never be sure that the inserted address is correct but in
> > many cases, we can determine with certainty, that the address is wrong
> > and prevent further errors. You probably agree with me that we should
> > do what we can to improve even if we can't solve a problem in all its
> > extent. If this is isn't obvious, I give you an example: all passwords
> > can be guessed and its hashes cracked, so what do you about it? do you
> > choose a short and simple password just because the system is not
> > perfect and all passwords can be guessed/all hashing mechanisms
> > cracked? don't think so, you choose a strong password, you do what you
> > can...
>
> > how about making a IS_REAL_EMAIL()?
>
> > On May 30, 7:16 am, mdipierro  wrote:
>
> > > +1
>
> > > On May 30, 1:12 am, Jonathan Lundell  wrote:
>
> > > > On May 29, 2010, at 9:39 PM, mdipierro wrote:
>
> > > > > The one your propose fails two of our tests:
> > > > > Failed example:
> > > > >    IS_EMAIL()('a...@d_-f.us')
> > > > > Expected:
> > > > >    ('a...@d_-f.us', None)
> > > > > Got:
> > > > >    ('a...@d_-f.us', 'enter a valid email address')
>
> > > > Underscores are not allowed, but we accept them because they've been 
> > > > used historically and there's no compelling reason (in a validator) to 
> > > > reject them. If we were actually allocating domain names, there'd be a 
> > > > reason do so, but we're not.
>
> > > > We should also keep in mind that there's no way we can guarantee that 
> > > > the address that gets typed in is correct (in the sense of not having a 
> > > > typo, even if it's syntactically correct). Mainly, we want to check 
> > > > that it "looks like" an email address, and err on the side of 
> > > > permissiveness.
>
> > > > > **
> > > > > File "gluon/validators.py", line 859, in __main__.IS_EMAIL
> > > > > Failed example:
> > > > >    IS_EMAIL()('local...@localhost')       # localhost as domain
> > > > > Expected:
> > > > >    ('local...@localhost', None)
> > > > > Got:
> > > > >    ('local...@localhost', 'enter a valid email address')
> > > > > **
>
> > > > > On May 29, 9:36 pm, blackthorne  wrote:
> > > > >>http://fightingforalostcause.net/misc/2006/compare-email-regex.php
>
> > > > >> Take it as a suggestion for a better email regex validator...