[web2py] Re: migrate existing GAE list fields to new web2py list types

2010-11-17 Thread howesc
i upgraded from 1.74.5 to 1.88.2 (so a little bit out of date as of
this week).

an example model with the problem is below.  the media field is the
problem.

db.define_table('song',
#...@todo: add proper requires for each field
Field('duration', 'integer',
  requires=IS_NULL_OR(IS_INT_IN_RANGE(0,36001))),
Field('last_modified', 'datetime', default=now, update=now),
Field('title', 'string', length=256, requires=IS_NOT_EMPTY()),
Field('artist', 'string', length=256,
  requires=IS_IN_DB(db, db.artist.name, '%(name)s')),
Field('genre', 'string',
  requires=IS_IN_DB(db, db.genre.name, '%(name)s')),
Field('song_key', 'string',
  requires=IS_NULL_OR(IS_IN_DB(db, db.song_key.name, '%
(name)s'))),
Field('song_scale', 'string',
  requires=IS_NULL_OR(IS_IN_DB(db, db.song_scale.name, '%
(name)s'))),
Field('publisher_song_code', 'string', length=100),
Field('label', 'string',
  requires=IS_IN_DB(db, db.label.name, '%(name)s')),
#...@todo: not sure that i like this string of ID's seperated by |
Field('media', 'string', length=2048,
  requires=IS_IN_DB(db, db.media.id, '%(url)s',
multiple=True)),
Field('isrc', 'string', length=12, unique=True),
Field('orig_publish_year', 'integer',
  requires=IS_NULL_OR(IS_INT_IN_RANGE(1800, 2100))),
Field('tempo', 'integer',
  requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 250))),
Field('written_by', 'string'),
#...@todo: add optional parameters
#keywords, description, status,thumbnail,name
migrate=migrate)


thanks,

cfh

On Nov 16, 7:20 pm, mdipierro  wrote:
> Which version did you upgrade from?
> Can you show the model that causes problem?
>
> On Nov 16, 8:42 pm, howesc  wrote:
>
> > Hi all,
>
> > sorry if i missed the discussion on this, but i was just bitten by an
> > upgrade issue that i'm not sure the best way to solve.
>
> > i have an existing app running on the google app engine that uses
> > several String fields with IS_IN_DB(... multiple=True).  I upgraded
> > web2py and now those fields are not working properly (the forms don't
> > see the existing data, and then they update the field incorrectly
> > based on the old pipe-delimited string).  This is wrecking havoc in
> > the system.
>
> > as far as i can tell the best solution is:
> >  - change the field type to 'list:reference ' since they
> > are references
> >  - update my code that expects the pipe-delimited string and make it
> > expect a list of IDs (yea!!)
> >  - write a task that i can run in the GAE task-queue to query each row
> > (around 200,000 of them at least), parse the string, convert it to the
> > list, and write back the new entry.
>
> > is this correct?  has anyone else done this and have a better
> > suggestion?
>
> > thanks!
>
> > christian
>
>


[web2py] list:reference and orderby

2010-11-17 Thread Johann Spies
How can I get an ordered list in the dropdown when using list:reference
(something like IS_IN_DB's orderby = ...)?

Regards
Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] Re: Trouble automatically updating dynamically generated image

2010-11-17 Thread G
Hello,
This looks like an interesting idea, I am interested in using
something like this in the future. For my immediate needs, I don't
mind having the client poll the server at regular intervals (every 10
seconds for example). As a last resort, I am using a  statement, but it seems like there must
be a better way with ajax/jquery load and setInterval.
Thanks for the pointer,
G

On Nov 16, 11:35 pm, dederocks  wrote:
> Hello,
>
> I guess this could be solved by implementing the APE (ajax-push)
> technology mentionned the other day by 
> Michele:http://www.ape-project.org/ajax-push.html.
> I'm working on it to see if this can be used to remotely control a
> webcam and send back pictures in real time.
> BR, André
>
> On 16 nov, 22:19, G  wrote:
>
> > Hello,
> > I read the slides and checked out the app, and it's great to see more
> > matplotlib/web2py examples. However, this does not address my use of
> > web2py for dynamically monitoring a system, which I am having some
> > trouble with. For example, suppose you wanted to create a "master
> > view" for your double-slit application, which would present a page
> > where each time someone ran a new double slit experiment with the
> > application, the page would update and show some plots from the result
> > of the double slit. Or perhaps some real-time statistics about all of
> > the experiments run so far. How would you implement something like
> > that? The code I posted below seems like it should work for this sort
> > of real time monitoring, but as I mentioned, I cannot get the images
> > to dynamically update.
>
> > I appreciate any suggestions anyone has.
> > Thanks,
> > G
>
> > On Nov 16, 10:17 am, mdipierro  wrote:
>
> > > I just gave a talk at Supercomputing about it. I will post the app and
> > > slides later today.
>
> > > On Nov 16, 10:06 am, G  wrote:
>
> > > > Hello again,
> > > > Is anyone else using matplotlib to generate dynamic plots for use with
> > > > web2py. Any pointers on a better way to do it that will allow dynamic
> > > > refreshing?
> > > > Thanks for any help,
> > > > G
>
> > > > On Nov 14, 3:42 pm, G  wrote:
>
> > > > > Hello,
> > > > > I am using web2py to monitor and control an instrument. I am
> > > > > dynamically generating plots using matplotlib following the DNA
> > > > > application example from SC2009 
> > > > > (http://www.web2py.com/examples/static/
> > > > > sc/sc_dna_talk.pdf)
>
> > > > > I was able to get the basic aspects working based on that example.
> > > > > However, I want to automatically display new plots as new data is
> > > > > available. I am using the following code in the view:
>
> > > > > 
> > > > > var auto_refresh = setInterval(
> > > > > function()
> > > > > {
> > > > > $('#loaddiv').load('statusbox.load');
> > > > > $('#threshpng').html(' > > > > src="/myapp/default/dataThreshPlot.png">');}, 5000);
>
> > > > > 
> > > > > loading...
> > > > > png loading
>
> > > > > The statusbox.load generates a table with some statistics about the
> > > > > data, and this successfully updates every 5 seconds as desired.
> > > > > However, the dataThreshPlot never gets refreshed, only the initial
> > > > > version is displayed. (a timestamp is written to the plot when it is
> > > > > generated so I can verify this fact).
>
> > > > > If I simply browse to localhost:8000/myapp/default/dataThreshPlot.png
> > > > > the plot is properly generated and displayed each time I refresh the
> > > > > page.
>
> > > > > I have tried adding this code to the dataThreshPlot function in the
> > > > > controller:
>
> > > > > response.headers['Expires'] = time.strftime("%a, %d %b %Y %H:%M:%S
> > > > > +", time.gmtime(time.time()+1))
>
> > > > > to try to avoid caching, but still no luck.
>
> > > > > I also tried making a very simple controller function as follows:
>
> > > > > def dataThreshPage():
> > > > >     return dict(threshim= URL(r=request,f=dataThreshPlot))
>
> > > > > and view:
> > > > > 
>
> > > > > and tested that localhost:8000/myapp/default/dataThreshPage  presents
> > > > > the plot as expected.
>
> > > > > I then modified the jquery refresh code to:
>
> > > > > 
> > > > > var auto_refresh = setInterval(
> > > > > function()
> > > > > {
> > > > > $('#loaddiv').load('statusbox.load');
> > > > > $('#threshpng').load('/myapp/default/dataThreshPage');}, 5000);
>
> > > > > 
> > > > > loading...
> > > > > png loading
>
> > > > > but still no luck.
>
> > > > > Any suggestions for how to get these plots to refresh?
> > > > > Thank you,
> > > > > G
>
>


[web2py] crud.create(db.table) issues error ticket

2010-11-17 Thread annet
I set up a mock app to help someone solve a problem.

In db.py I defined these two tables after all the mail, auth and crud
stuff:

db.define_table('mockbio',
 
Field('unique_id',type='integer',unique=True,writable=False,readable=True),
Field('first_name',length=24),
Field('last_name',length=72),
migrate='mockbio.table')

db.mockbio.unique_id.default=auth.user_id
db.mockbio.unique_id.requires=IS_NOT_IN_DB(db,db.bio.unique_id)
db.mockbio.unique_id.label=T('Unique_id')


Using web2py's administrative interface I am able to enter a record
for each user I created, when I enter a second record for a user I get
an error on the unique_id field: value already in database or empty.



I also defined two functions in default.py:

@auth.requires_login()
def create_mockbio_first():
form=crud.create(table=db.mockbio)
return dict(form=form)


@auth.requires_login()
def create_mockbio_second():
form=SQLFORM(db.mockbio)
if form.accepts(request.vars, session):
session.flash = 'form accepted'
elif form.errors:
response.flash = 'form has errors'
else:
response.flash = 'please fill the form'
return dict(form=form)


When I expose the functions, I can create a record for the logged in
user once, when I try to create a second record for the same user an
error ticket is issued: IntegrityError: column unique_id is not unique

Why do I get an error ticket instead of an error message in the form?


Kind regards,

Annet


[web2py] Re: Validate dynamically generated select SQLFORM.factory

2010-11-17 Thread DenesL


On Nov 16, 3:49 pm, Kostas M  wrote:
> I tried this in a controller and worked fine:
>
> def factory():
>     options = ['a','b','c']
>     form = SQLFORM.factory(Field('Optimizers',
> requires=IS_IN_SET(options,multiple='multiple')))
>     if form.accepts(request.vars, session):
>         response.flash = 'form accepted'
>     elif form.errors:
>         response.flash = 'form has errors'
>     return dict(form = form, form_options = form.vars.Optimizers)
>
> Note that according to the web2py book: "The elements of the set must
> always be strings unless this validator is preceded by IS_INT_IN_RANGE
> (which converts the value to int) or IS_FLOAT_IN_RANGE (which converts
> the value to float)"
>
> I have also 2 questions though if somebody can help:
>    1. If nothing is selected why the form is accepted?

Because multiple is not False, but I am not sure about the logic.
No selection should still fail because it is not in the set,
i.e. multiple should mean 1 or more, not zero or more.

>    2. If I try to use multiple validators in requires=[] of the
> SQLFORM.factory, only the last validator of the 'requires' list is
> enforced. Is this a bug? The tried code is:
>
> form=SQLFORM.factory(Field('Optimizers',requires=[IS_IN_SET(options,multiple='multiple'),
> IS_NOT_EMPTY()] ))

This is just a side effect of the above case.
Both validators are being enforced but IS_IN_SET is accepting an empty
input.



[web2py] Re: Validate dynamically generated select SQLFORM.factory

2010-11-17 Thread villas
Hi Lorin

I don't know whether it makes any difference (because I didn't look at
the source), but the optional argument multiple='multiple' would be
normally:

multiple=True  or  multiple=False

-D

On Nov 15, 6:28 pm, Lorin Rivers  wrote:
> Thanks for all the help so far. I have made tons of progress on my app, and 
> now I'm trying to add a little polish.
>
> I have this code:
>
>   # Loops through the MAC Addresses and puts them in a list
>   # MAC Addresses is from a prior query
>   options=[str(my_macaddr[i].MacAddr) for i in range(len(my_macaddr))]
>
>   #creates the form for choosing which Optimizers, from which time frame
>   
> form=SQLFORM.factory(Field('Optimizers',requires=IS_IN_SET(options,multiple='multiple')))
>
> My app throws an error if you click the submit button without selecting an 
> item from the list in the form.
>
> I have tried adding 'zero=T('Choose one')', both with and without adding the 
> string 'Choose one' to the list 'options'. What would the best way to 
> validate this be?
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


[web2py] Re: crud.create(db.table) issues error ticket

2010-11-17 Thread DenesL

Hi Annet,

because of the writable=False on unique_id.

When you do that then the field is not included in the form and it is
not checked on a request, so the form is accepted based on the other
fields and the error is the result of the enforcement of unique=True
at the DB level on the auto insert.

Denes.


On Nov 17, 3:35 am, annet  wrote:
> I set up a mock app to help someone solve a problem.
>
> In db.py I defined these two tables after all the mail, auth and crud
> stuff:
>
> db.define_table('mockbio',
>
> Field('unique_id',type='integer',unique=True,writable=False,readable=True),
>     Field('first_name',length=24),
>     Field('last_name',length=72),
>     migrate='mockbio.table')
>
> db.mockbio.unique_id.default=auth.user_id
> db.mockbio.unique_id.requires=IS_NOT_IN_DB(db,db.bio.unique_id)
> db.mockbio.unique_id.label=T('Unique_id')
>
> Using web2py's administrative interface I am able to enter a record
> for each user I created, when I enter a second record for a user I get
> an error on the unique_id field: value already in database or empty.
>
> I also defined two functions in default.py:
>
> @auth.requires_login()
> def create_mockbio_first():
>     form=crud.create(table=db.mockbio)
>     return dict(form=form)
>
> @auth.requires_login()
> def create_mockbio_second():
>     form=SQLFORM(db.mockbio)
>     if form.accepts(request.vars, session):
>         session.flash = 'form accepted'
>     elif form.errors:
>         response.flash = 'form has errors'
>     else:
>         response.flash = 'please fill the form'
>     return dict(form=form)
>
> When I expose the functions, I can create a record for the logged in
> user once, when I try to create a second record for the same user an
> error ticket is issued: IntegrityError: column unique_id is not unique
>
> Why do I get an error ticket instead of an error message in the form?
>
> Kind regards,
>
> Annet


Re: [web2py] Re:

2010-11-17 Thread Napoleon Moreno
Hi Villas

It is that i need.  Apparently there is not a way to do it with a crud. I
could use  a sqlform.

Thanks!

On Mon, Nov 15, 2010 at 7:16 PM, villas  wrote:

> Hi,
> I'm not sure,  but I think Napoleon wants to save the id key of the
> 'master table' into the master_id field of the 'detail' table.
> I'm not sure how it works with crud.  I would suggest that you use
> SQLFORM and set the field after form.accepts.  Take a look at this
> link:
>
> http://www.web2pyslices.com/main/slices/take_slice/102
>
> This is a short-cut way of linking tables, but notice how the id is
> set.
> Hope this helps.
> -D
>
> On Nov 15, 11:49 pm, "mr.freeze"  wrote:
> > Sorry, I don't fully understand. You can email your app (with any
> > personal data removed) and I will take a closer look.
> >
> > On Nov 15, 5:02 pm, Napoleon Moreno  wrote:
> >
> > > I am doing that. but  the crud form does not the key value from the
> master
> > > table. ( or master page ). The user has to input the referencia value
> in the
> > > crud page.
> >
> > > db.define_table('referencia',
> > > Field('fecha_remision','
> >
> > > > datetime')
> > > > )
> >
> > > > db.define_table('diagnostico_referencia',
> > > > Field('diagnostico',db.diagnostico),
> > > > Field('referencia',db.referencia)
> > > > )
> >
> > > > in the controler
> > > >
> >
> > > > grid = webgrid.WebGrid(crud)
> > > > grid.enabled_rows = ['add_links']
> > > > grid.action_links = ['delete']
> > > > grid.action_headers = []
> > > > grid.crud_function = 'diagnostico_referencia'
> >
> > > >crud.settings.controller = 'default'
> > > >grid.datasource =
> > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
> > > > return dict(form=form, grid=grid(),referencia=referencia_id)
> >
> > > > def diagnostico_referencia():
> > > > crud.settings[request.args(0)+'_next'] =
> URL(r=request,f='referencia')
> > > > return dict(form=crud())
> >
> > > > Is it posible that the form in diagnostico_referencia  get the
> > > > referencia.id value from the controler in the addition form?
> >
> > > On Mon, Nov 15, 2010 at 5:59 PM, Napoleon Moreno  >wrote:
> >
> > > > Thansk for your answer
> >
> > > > I am doing that. but  the crud form does not the key value from the
> master
> > > > table. ( or master page )
> >
> > > > This is my code
> >
> > > > db.define_table('referencia',
> > > > Field('fecha_remision','datetime')
> > > > )
> >
> > > > db.define_table('diagnostico_referencia',
> > > > Field('diagnostico',db.diagnostico),
> > > > Field('referencia',db.referencia)
> > > > )
> >
> > > > in the controler
> > > >
> >
> > > > grid = webgrid.WebGrid(crud)
> > > > grid.enabled_rows = ['add_links']
> > > > grid.action_links = ['delete']
> > > > grid.action_headers = []
> > > > grid.crud_function = 'diagnostico_referencia'
> >
> > > >crud.settings.controller = 'default'
> > > >grid.datasource =
> > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
> > > > return dict(form=form, grid=grid(),referencia=referencia_id)
> >
> > > > def diagnostico_referencia():
> > > > crud.settings[request.args(0)+'_next'] =
> URL(r=request,f='referencia')
> > > > return dict(form=crud())
> >
> > > > Is it posible that the form in diagnostico_referencia  the
>  referencia.idvalue from the controler in the addition form?
> >
> > > > On Mon, Nov 15, 2010 at 5:26 PM, mr.freeze 
> wrote:
> >
> > > >> You need to expose crud through a controller. In default.py, put
> this:
> >
> > > >> def data():
> > > >>return dict(form=crud())
> >
> > > >> Then set the grid accordingly:
> > > >> grid.crud_function = 'data'
> >
> > > >> On Nov 15, 4:15 pm, Napoleon Moreno  wrote:
> > > >> > Good afternoon
> >
> > > >> > I am trying to use webgrid in a master- detail form.
> >
> > > >> > But i can't find the way to link the crud with the master form.
> >
> > > >> > any body knows how to do it?
> >
> > > >> > Thansk
> >
> >
>


Re: [web2py] Re:

2010-11-17 Thread Napoleon Moreno
Good day

The webgrid is showing the fields of 'diagnostico_referencia' table. I need
that it shows the name field of the 'Diagnostico' table. I can not find a
way to do it. It suppose to be used in GAE.

Any advice about it
Thanks a lot for your help

On Wed, Nov 17, 2010 at 6:52 AM, Napoleon Moreno wrote:

> Hi Villas
>
> It is that i need.  Apparently there is not a way to do it with a crud. I
> could use  a sqlform.
>
> Thanks!
>
>
> On Mon, Nov 15, 2010 at 7:16 PM, villas  wrote:
>
>> Hi,
>> I'm not sure,  but I think Napoleon wants to save the id key of the
>> 'master table' into the master_id field of the 'detail' table.
>> I'm not sure how it works with crud.  I would suggest that you use
>> SQLFORM and set the field after form.accepts.  Take a look at this
>> link:
>>
>> http://www.web2pyslices.com/main/slices/take_slice/102
>>
>> This is a short-cut way of linking tables, but notice how the id is
>> set.
>> Hope this helps.
>> -D
>>
>> On Nov 15, 11:49 pm, "mr.freeze"  wrote:
>> > Sorry, I don't fully understand. You can email your app (with any
>> > personal data removed) and I will take a closer look.
>> >
>> > On Nov 15, 5:02 pm, Napoleon Moreno  wrote:
>> >
>> > > I am doing that. but  the crud form does not the key value from the
>> master
>> > > table. ( or master page ). The user has to input the referencia value
>> in the
>> > > crud page.
>> >
>> > > db.define_table('referencia',
>> > > Field('fecha_remision','
>> >
>> > > > datetime')
>> > > > )
>> >
>> > > > db.define_table('diagnostico_referencia',
>> > > > Field('diagnostico',db.diagnostico),
>> > > > Field('referencia',db.referencia)
>> > > > )
>> >
>> > > > in the controler
>> > > >
>> >
>> > > > grid = webgrid.WebGrid(crud)
>> > > > grid.enabled_rows = ['add_links']
>> > > > grid.action_links = ['delete']
>> > > > grid.action_headers = []
>> > > > grid.crud_function = 'diagnostico_referencia'
>> >
>> > > >crud.settings.controller = 'default'
>> > > >grid.datasource =
>> > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
>> > > > return dict(form=form, grid=grid(),referencia=referencia_id)
>> >
>> > > > def diagnostico_referencia():
>> > > > crud.settings[request.args(0)+'_next'] =
>> URL(r=request,f='referencia')
>> > > > return dict(form=crud())
>> >
>> > > > Is it posible that the form in diagnostico_referencia  get the
>> > > > referencia.id value from the controler in the addition form?
>> >
>> > > On Mon, Nov 15, 2010 at 5:59 PM, Napoleon Moreno <
>> napoleo...@gmail.com>wrote:
>> >
>> > > > Thansk for your answer
>> >
>> > > > I am doing that. but  the crud form does not the key value from the
>> master
>> > > > table. ( or master page )
>> >
>> > > > This is my code
>> >
>> > > > db.define_table('referencia',
>> > > > Field('fecha_remision','datetime')
>> > > > )
>> >
>> > > > db.define_table('diagnostico_referencia',
>> > > > Field('diagnostico',db.diagnostico),
>> > > > Field('referencia',db.referencia)
>> > > > )
>> >
>> > > > in the controler
>> > > >
>> >
>> > > > grid = webgrid.WebGrid(crud)
>> > > > grid.enabled_rows = ['add_links']
>> > > > grid.action_links = ['delete']
>> > > > grid.action_headers = []
>> > > > grid.crud_function = 'diagnostico_referencia'
>> >
>> > > >crud.settings.controller = 'default'
>> > > >grid.datasource =
>> > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
>> > > > return dict(form=form, grid=grid(),referencia=referencia_id)
>> >
>> > > > def diagnostico_referencia():
>> > > > crud.settings[request.args(0)+'_next'] =
>> URL(r=request,f='referencia')
>> > > > return dict(form=crud())
>> >
>> > > > Is it posible that the form in diagnostico_referencia  the
>>  referencia.idvalue from the controler in the addition form?
>> >
>> > > > On Mon, Nov 15, 2010 at 5:26 PM, mr.freeze 
>> wrote:
>> >
>> > > >> You need to expose crud through a controller. In default.py, put
>> this:
>> >
>> > > >> def data():
>> > > >>return dict(form=crud())
>> >
>> > > >> Then set the grid accordingly:
>> > > >> grid.crud_function = 'data'
>> >
>> > > >> On Nov 15, 4:15 pm, Napoleon Moreno  wrote:
>> > > >> > Good afternoon
>> >
>> > > >> > I am trying to use webgrid in a master- detail form.
>> >
>> > > >> > But i can't find the way to link the crud with the master form.
>> >
>> > > >> > any body knows how to do it?
>> >
>> > > >> > Thansk
>> >
>> >
>>
>
>


[web2py] A small improvement...

2010-11-17 Thread encompass
I have to deal with a lot of funky errors in my code and being a
developer I avoid the mouse as much as I can.  I thought this might
come in handy...
I change line 40 in web2py/gluon/rewrite.py to the following:
p.error_message_ticket = \
'''



Internal error

Ticket issued-:-

%(ticket)s





function GetChar(){
window.location = "/admin/default/ticket/%(ticket)s";
}
'''
Not only is it more readable in the code.  But anyone that doesn't
want to click on that link can just press any key.
It may be better if we just take the space bar (Cause alt would make
it just to the error) And it doesn't open a new window like you do
when you click on it.(I may do that next.)... but I wanted to give
this to you guys to see what you thought about it.  I don't like the
mouse when I am programming, so this saves me a bit of time when you
think about it.
BR,
Jason Brower


[web2py] Re: Unable to edit language files

2010-11-17 Thread pierreth
On Nov 17, 1:51 am, JmiXIII  wrote:
> Salut ! :)
> What about having a look there 
> :)https://groups.google.com/group/web2py-users-france?hl=fr
>

This is cool. I already did the translation. This is not a big
project. Now, we need to verify before integrated it. :-)

I am waiting approbation for the group.


Re: [web2py] Re:

2010-11-17 Thread Napoleon Moreno
I am sorry for insist in this but it is driving me crazy.

If i can not use a join in GAE. How can i show the name of 'diagnostico'
table in an webgrid base on 'diagnostico_referencia' table. I tried with
webgrid and crud and it always show me the id's of the
'diagnostico_referencia' table.

Any advice about it?


On Wed, Nov 17, 2010 at 6:57 AM, Napoleon Moreno wrote:

> Good day
>
> The webgrid is showing the fields of 'diagnostico_referencia' table. I need
> that it shows the name field of the 'Diagnostico' table. I can not find a
> way to do it. It suppose to be used in GAE.
>
> Any advice about it
> Thanks a lot for your help
>
>
> On Wed, Nov 17, 2010 at 6:52 AM, Napoleon Moreno wrote:
>
>> Hi Villas
>>
>> It is that i need.  Apparently there is not a way to do it with a crud. I
>> could use  a sqlform.
>>
>> Thanks!
>>
>>
>> On Mon, Nov 15, 2010 at 7:16 PM, villas  wrote:
>>
>>> Hi,
>>> I'm not sure,  but I think Napoleon wants to save the id key of the
>>> 'master table' into the master_id field of the 'detail' table.
>>> I'm not sure how it works with crud.  I would suggest that you use
>>> SQLFORM and set the field after form.accepts.  Take a look at this
>>> link:
>>>
>>> http://www.web2pyslices.com/main/slices/take_slice/102
>>>
>>> This is a short-cut way of linking tables, but notice how the id is
>>> set.
>>> Hope this helps.
>>> -D
>>>
>>> On Nov 15, 11:49 pm, "mr.freeze"  wrote:
>>> > Sorry, I don't fully understand. You can email your app (with any
>>> > personal data removed) and I will take a closer look.
>>> >
>>> > On Nov 15, 5:02 pm, Napoleon Moreno  wrote:
>>> >
>>> > > I am doing that. but  the crud form does not the key value from the
>>> master
>>> > > table. ( or master page ). The user has to input the referencia value
>>> in the
>>> > > crud page.
>>> >
>>> > > db.define_table('referencia',
>>> > > Field('fecha_remision','
>>> >
>>> > > > datetime')
>>> > > > )
>>> >
>>> > > > db.define_table('diagnostico_referencia',
>>> > > > Field('diagnostico',db.diagnostico),
>>> > > > Field('referencia',db.referencia)
>>> > > > )
>>> >
>>> > > > in the controler
>>> > > >
>>> >
>>> > > > grid = webgrid.WebGrid(crud)
>>> > > > grid.enabled_rows = ['add_links']
>>> > > > grid.action_links = ['delete']
>>> > > > grid.action_headers = []
>>> > > > grid.crud_function = 'diagnostico_referencia'
>>> >
>>> > > >crud.settings.controller = 'default'
>>> > > >grid.datasource =
>>> > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
>>> > > > return dict(form=form, grid=grid(),referencia=referencia_id)
>>> >
>>> > > > def diagnostico_referencia():
>>> > > > crud.settings[request.args(0)+'_next'] =
>>> URL(r=request,f='referencia')
>>> > > > return dict(form=crud())
>>> >
>>> > > > Is it posible that the form in diagnostico_referencia  get the
>>> > > > referencia.id value from the controler in the addition form?
>>> >
>>> > > On Mon, Nov 15, 2010 at 5:59 PM, Napoleon Moreno <
>>> napoleo...@gmail.com>wrote:
>>> >
>>> > > > Thansk for your answer
>>> >
>>> > > > I am doing that. but  the crud form does not the key value from the
>>> master
>>> > > > table. ( or master page )
>>> >
>>> > > > This is my code
>>> >
>>> > > > db.define_table('referencia',
>>> > > > Field('fecha_remision','datetime')
>>> > > > )
>>> >
>>> > > > db.define_table('diagnostico_referencia',
>>> > > > Field('diagnostico',db.diagnostico),
>>> > > > Field('referencia',db.referencia)
>>> > > > )
>>> >
>>> > > > in the controler
>>> > > >
>>> >
>>> > > > grid = webgrid.WebGrid(crud)
>>> > > > grid.enabled_rows = ['add_links']
>>> > > > grid.action_links = ['delete']
>>> > > > grid.action_headers = []
>>> > > > grid.crud_function = 'diagnostico_referencia'
>>> >
>>> > > >crud.settings.controller = 'default'
>>> > > >grid.datasource =
>>> > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
>>> > > > return dict(form=form, grid=grid(),referencia=referencia_id)
>>> >
>>> > > > def diagnostico_referencia():
>>> > > > crud.settings[request.args(0)+'_next'] =
>>> URL(r=request,f='referencia')
>>> > > > return dict(form=crud())
>>> >
>>> > > > Is it posible that the form in diagnostico_referencia  the
>>>  referencia.idvalue from the controler in the addition form?
>>> >
>>> > > > On Mon, Nov 15, 2010 at 5:26 PM, mr.freeze 
>>> wrote:
>>> >
>>> > > >> You need to expose crud through a controller. In default.py, put
>>> this:
>>> >
>>> > > >> def data():
>>> > > >>return dict(form=crud())
>>> >
>>> > > >> Then set the grid accordingly:
>>> > > >> grid.crud_function = 'data'
>>> >
>>> > > >> On Nov 15, 4:15 pm, Napoleon Moreno  wrote:
>>> > > >> > Good afternoon
>>> >
>>> > > >> > I am trying to use webgrid in a master- detail form.
>>> >
>>> > > >> > But i can't find the way to link the crud with the master form.
>>> >
>>> > > >> > any body knows how to do it?
>>> >
>>> > >

[web2py] Re: A small improvement...

2010-11-17 Thread villas
Hi Jason

Anything that avoids the mouse is good news!  However,  at the moment
(in FF) my workflow is:

Tab,Enter to view the exception,  then (once I fixed the error in my
separate editor),  Ctrl-F4 to close the ticket and F5 to refresh my
app.  I don't need the mouse for that,  but any keyboard shortcuts are
always welcome which is why I like the new Time widget :)

-D


On Nov 17, 12:35 pm, encompass  wrote:
> I have to deal with a lot of funky errors in my code and being a
> developer I avoid the mouse as much as I can.  I thought this might
> come in handy...
> I change line 40 in web2py/gluon/rewrite.py to the following:
>     p.error_message_ticket = \
>         '''
>         
>             
>                 
>                     Internal error
>                 
>                 Ticket issued-:-
>                  target="_blank">
>                     %(ticket)s
>                 
>             
>             
>         
>         
>             function GetChar(){
>                 window.location = "/admin/default/ticket/%(ticket)s";
>             }
>         '''
> Not only is it more readable in the code.  But anyone that doesn't
> want to click on that link can just press any key.
> It may be better if we just take the space bar (Cause alt would make
> it just to the error) And it doesn't open a new window like you do
> when you click on it.(I may do that next.)... but I wanted to give
> this to you guys to see what you thought about it.  I don't like the
> mouse when I am programming, so this saves me a bit of time when you
> think about it.
> BR,
> Jason Brower


[web2py] Re: A small improvement...

2010-11-17 Thread encompass
Ahhh yes... I suppose I could have done that.  I wonder however if
that works in all browsers.  And your right about closing the window,
I need to open the window in a new tab if I want it to work like
before.
---
J

On Nov 17, 4:25 pm, villas  wrote:
> Hi Jason
>
> Anything that avoids the mouse is good news!  However,  at the moment
> (in FF) my workflow is:
>
> Tab,Enter to view the exception,  then (once I fixed the error in my
> separate editor),  Ctrl-F4 to close the ticket and F5 to refresh my
> app.  I don't need the mouse for that,  but any keyboard shortcuts are
> always welcome which is why I like the new Time widget :)
>
> -D
>
> On Nov 17, 12:35 pm, encompass  wrote:
>
> > I have to deal with a lot of funky errors in my code and being a
> > developer I avoid the mouse as much as I can.  I thought this might
> > come in handy...
> > I change line 40 in web2py/gluon/rewrite.py to the following:
> >     p.error_message_ticket = \
> >         '''
> >         
> >             
> >                 
> >                     Internal error
> >                 
> >                 Ticket issued-:-
> >                  > target="_blank">
> >                     %(ticket)s
> >                 
> >             
> >             
> >         
> >         
> >             function GetChar(){
> >                 window.location = "/admin/default/ticket/%(ticket)s";
> >             }
> >         '''
> > Not only is it more readable in the code.  But anyone that doesn't
> > want to click on that link can just press any key.
> > It may be better if we just take the space bar (Cause alt would make
> > it just to the error) And it doesn't open a new window like you do
> > when you click on it.(I may do that next.)... but I wanted to give
> > this to you guys to see what you thought about it.  I don't like the
> > mouse when I am programming, so this saves me a bit of time when you
> > think about it.
> > BR,
> > Jason Brower
>
>


[web2py] Re: migrate existing GAE list fields to new web2py list types

2010-11-17 Thread mdipierro
replace

Field('media', 'string', length=2048,
  requires=IS_IN_DB(db, db.media.id, '%(url)s',
multiple=True)),

with

Field('media', 'list:reference media', length=2048)

and

in db.define_table('media',...) add format='%(url)s'

Massimo

On Nov 17, 2:01 am, howesc  wrote:
> i upgraded from 1.74.5 to 1.88.2 (so a little bit out of date as of
> this week).
>
> an example model with the problem is below.  the media field is the
> problem.
>
> db.define_table('song',
>     #...@todo: add proper requires for each field
>     Field('duration', 'integer',
>           requires=IS_NULL_OR(IS_INT_IN_RANGE(0,36001))),
>     Field('last_modified', 'datetime', default=now, update=now),
>     Field('title', 'string', length=256, requires=IS_NOT_EMPTY()),
>     Field('artist', 'string', length=256,
>           requires=IS_IN_DB(db, db.artist.name, '%(name)s')),
>     Field('genre', 'string',
>           requires=IS_IN_DB(db, db.genre.name, '%(name)s')),
>     Field('song_key', 'string',
>           requires=IS_NULL_OR(IS_IN_DB(db, db.song_key.name, '%
> (name)s'))),
>     Field('song_scale', 'string',
>           requires=IS_NULL_OR(IS_IN_DB(db, db.song_scale.name, '%
> (name)s'))),
>     Field('publisher_song_code', 'string', length=100),
>     Field('label', 'string',
>           requires=IS_IN_DB(db, db.label.name, '%(name)s')),
>     #...@todo: not sure that i like this string of ID's seperated by |
>     Field('media', 'string', length=2048,
>           requires=IS_IN_DB(db, db.media.id, '%(url)s',
> multiple=True)),
>     Field('isrc', 'string', length=12, unique=True),
>     Field('orig_publish_year', 'integer',
>           requires=IS_NULL_OR(IS_INT_IN_RANGE(1800, 2100))),
>     Field('tempo', 'integer',
>           requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 250))),
>     Field('written_by', 'string'),
>     #...@todo: add optional parameters
>     #keywords, description, status,thumbnail,name
>     migrate=migrate)
>
> thanks,
>
> cfh
>
> On Nov 16, 7:20 pm, mdipierro  wrote:
>
> > Which version did you upgrade from?
> > Can you show the model that causes problem?
>
> > On Nov 16, 8:42 pm, howesc  wrote:
>
> > > Hi all,
>
> > > sorry if i missed the discussion on this, but i was just bitten by an
> > > upgrade issue that i'm not sure the best way to solve.
>
> > > i have an existing app running on the google app engine that uses
> > > several String fields with IS_IN_DB(... multiple=True).  I upgraded
> > > web2py and now those fields are not working properly (the forms don't
> > > see the existing data, and then they update the field incorrectly
> > > based on the old pipe-delimited string).  This is wrecking havoc in
> > > the system.
>
> > > as far as i can tell the best solution is:
> > >  - change the field type to 'list:reference ' since they
> > > are references
> > >  - update my code that expects the pipe-delimited string and make it
> > > expect a list of IDs (yea!!)
> > >  - write a task that i can run in the GAE task-queue to query each row
> > > (around 200,000 of them at least), parse the string, convert it to the
> > > list, and write back the new entry.
>
> > > is this correct?  has anyone else done this and have a better
> > > suggestion?
>
> > > thanks!
>
> > > christian
>
>


[web2py] Re: list:reference and orderby

2010-11-17 Thread mdipierro
IS_IN_DB(...,orderby=...)

On Nov 17, 2:08 am, Johann Spies  wrote:
> How can I get an ordered list in the dropdown when using list:reference
> (something like IS_IN_DB's orderby = ...)?
>
> Regards
> Johann
>
> --
>  May grace and peace be yours in abundance through the full knowledge of God
> and of Jesus our Lord!  His divine power has given us everything we need for
> life and godliness through the full knowledge of the one who called us by
> his own glory and excellence.
>                                                     2 Pet. 1:2b,3a


[web2py] Re: crud operations for joins?

2010-11-17 Thread villas
Hi Carlos

'Crud' is just a shortcut way of creating simple forms.  In production
systems we normally create the forms using the more flexible SQLFORM
or a lower level method which gives even more flexibility.

With regards your table design,  there is nothing wrong with that,  it
sounds like a very 'normalized' design.  In relational DBs you must
link the tables using foreign keys.  In web2py you can do that when
you define the tables using the keyword 'reference'.  You can then
display the foreign keys in a more meaningful way using 'format='.

I am not sure whether this reply has been so helpful, but IMO your
best way forward is to read the book and then ask specific questions
to the group.

Best wishes
-David



On Nov 17, 3:23 am, Carlos  wrote:
> Hi,
>
> Does anybody have any recommendations about this?.
>
> Thanks,
>
>    Carlos
>
> On Nov 15, 7:23 pm, Carlos  wrote:
>
> > Hi,
>
> > What should I do in order to supportcrudoperations with joined
> > tables?.
>
> > For reference, I have a 'central' table in my design called 'entity'
> > which contains lots of data (including names, company, emails, phones,
> > address, etc.) and I want many other tables to point to ONE entity
> > instance, i.e. 'entity' as an _extension_ of records in many different
> > tables.
>
> > My background is with object databases, and this kind of design makes
> > sense, although I'm not sure if it makes sense with relation
> > databases?.
>
> > Thanks,
>
> >    Carlos
>
>


Re: [web2py] Re: crud operations for joins?

2010-11-17 Thread Ivan Matveev
>>  I have a 'central' table in my design called 'entity'
>> which contains lots of data (including names, company, emails, phones,
>> address, etc.) and I want many other tables to point to ONE entity
>> instance, i.e. 'entity' as an _extension_ of records in many different
>> tables.

When you say 'joined tables' do you mean
SELECT tabl1.some_col, tabl2.other_col FROM tabl1 LEFT JOIN tabl2 ON .
or something else?

I don't know a web2py component that can be used to edit a result of a
joined select.

If your 'entity' table includes all fields you want to present to a
user you can avoid joins by use of references. I don't use db
references myself. I think usage can look like this:

db.define_table('names', Field('name', 'string'))
db.define_table('companies', Field('company', 'string'))

db.define_table('entity',
Field('name', db.names.name),
Field('company', db.companies.company))

also you can alter the way a field is represented with .represent and
.requires methods

The details are in documentation on Database Abstraction Layer(DAL)
http://www.web2py.com/book/default/chapter/06

SQLFORM allows to edit a row in a table which is fine if you have all
fields in 'entity' table.

If your 'entity' table contains references to rows in other tables you
will need SELECT...JOIN...
To edit its result  you will have to make a page with multiple
SQLFORMs to edit individual rows in tables ' entity' refers  to , or
make a custom form with SQLFORM.factory, or invent something.

>> My background is with object databases, and this kind of design makes
>> sense, although I'm not sure if it makes sense with relation
>> databases?.

It's pretty common to store an object information in a relation db as
a set of tables.


[web2py] Application developed with web2py like "Django People"

2010-11-17 Thread appydev
Greetings to everyone.

I recently read about an application developed with web2py like "Django
People" I get to test it and I read about some suggestions from Massimo.

I've been looking but can not find it. Anyone remember it?


[web2py] Re: crud.create(db.table) issues error ticket

2010-11-17 Thread annet
Hi Denes,

Thanks for your explanation. The mock app's behaviour made me worry
about my own app's behaviour, however, I chose a different approach,
and know I understand why I won't encounter this problem.


Kind regards,

Annet.


Re: [web2py] Re:

2010-11-17 Thread Napoleon Moreno
I found the answer in the book , like is usual

db.define_table('diagnostico',
Field('name','string'),format='%(name)s'
)

It shows the name  in every place where i have the diagnostico.id. I got my
app running.

Thanks everybody!

On Wed, Nov 17, 2010 at 9:24 AM, Napoleon Moreno wrote:

> I am sorry for insist in this but it is driving me crazy.
>
> If i can not use a join in GAE. How can i show the name of 'diagnostico'
> table in an webgrid base on 'diagnostico_referencia' table. I tried with
> webgrid and crud and it always show me the id's of the
> 'diagnostico_referencia' table.
>
> Any advice about it?
>
>
>
> On Wed, Nov 17, 2010 at 6:57 AM, Napoleon Moreno wrote:
>
>> Good day
>>
>> The webgrid is showing the fields of 'diagnostico_referencia' table. I
>> need that it shows the name field of the 'Diagnostico' table. I can not find
>> a way to do it. It suppose to be used in GAE.
>>
>> Any advice about it
>> Thanks a lot for your help
>>
>>
>> On Wed, Nov 17, 2010 at 6:52 AM, Napoleon Moreno wrote:
>>
>>> Hi Villas
>>>
>>> It is that i need.  Apparently there is not a way to do it with a crud. I
>>> could use  a sqlform.
>>>
>>> Thanks!
>>>
>>>
>>> On Mon, Nov 15, 2010 at 7:16 PM, villas  wrote:
>>>
 Hi,
 I'm not sure,  but I think Napoleon wants to save the id key of the
 'master table' into the master_id field of the 'detail' table.
 I'm not sure how it works with crud.  I would suggest that you use
 SQLFORM and set the field after form.accepts.  Take a look at this
 link:

 http://www.web2pyslices.com/main/slices/take_slice/102

 This is a short-cut way of linking tables, but notice how the id is
 set.
 Hope this helps.
 -D

 On Nov 15, 11:49 pm, "mr.freeze"  wrote:
 > Sorry, I don't fully understand. You can email your app (with any
 > personal data removed) and I will take a closer look.
 >
 > On Nov 15, 5:02 pm, Napoleon Moreno  wrote:
 >
 > > I am doing that. but  the crud form does not the key value from the
 master
 > > table. ( or master page ). The user has to input the referencia
 value in the
 > > crud page.
 >
 > > db.define_table('referencia',
 > > Field('fecha_remision','
 >
 > > > datetime')
 > > > )
 >
 > > > db.define_table('diagnostico_referencia',
 > > > Field('diagnostico',db.diagnostico),
 > > > Field('referencia',db.referencia)
 > > > )
 >
 > > > in the controler
 > > >
 >
 > > > grid = webgrid.WebGrid(crud)
 > > > grid.enabled_rows = ['add_links']
 > > > grid.action_links = ['delete']
 > > > grid.action_headers = []
 > > > grid.crud_function = 'diagnostico_referencia'
 >
 > > >crud.settings.controller = 'default'
 > > >grid.datasource =
 > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
 > > > return dict(form=form, grid=grid(),referencia=referencia_id)
 >
 > > > def diagnostico_referencia():
 > > > crud.settings[request.args(0)+'_next'] =
 URL(r=request,f='referencia')
 > > > return dict(form=crud())
 >
 > > > Is it posible that the form in diagnostico_referencia  get the
 > > > referencia.id value from the controler in the addition form?
 >
 > > On Mon, Nov 15, 2010 at 5:59 PM, Napoleon Moreno <
 napoleo...@gmail.com>wrote:
 >
 > > > Thansk for your answer
 >
 > > > I am doing that. but  the crud form does not the key value from
 the master
 > > > table. ( or master page )
 >
 > > > This is my code
 >
 > > > db.define_table('referencia',
 > > > Field('fecha_remision','datetime')
 > > > )
 >
 > > > db.define_table('diagnostico_referencia',
 > > > Field('diagnostico',db.diagnostico),
 > > > Field('referencia',db.referencia)
 > > > )
 >
 > > > in the controler
 > > >
 >
 > > > grid = webgrid.WebGrid(crud)
 > > > grid.enabled_rows = ['add_links']
 > > > grid.action_links = ['delete']
 > > > grid.action_headers = []
 > > > grid.crud_function = 'diagnostico_referencia'
 >
 > > >crud.settings.controller = 'default'
 > > >grid.datasource =
 > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
 > > > return dict(form=form, grid=grid(),referencia=referencia_id)
 >
 > > > def diagnostico_referencia():
 > > > crud.settings[request.args(0)+'_next'] =
 URL(r=request,f='referencia')
 > > > return dict(form=crud())
 >
 > > > Is it posible that the form in diagnostico_referencia  the
  referencia.idvalue from the controler in the addition form?
 >
 > > > On Mon, Nov 15, 2010 at 5:26 PM, mr.freeze 
 wrote:
 >
 > > >> You need to expose crud through a controller. In default.py, put
 this:
 >
 > 

[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread mdipierro
we are taking a different approach

   https://experts4solutions.com

You can sign up. I will approve those people who I recognize as
contributors and/or have proven skills by deploying a web2py
application. After we reach ~50 people new members will have to be
endorsed by 5 existing members to be approved.

If you have already signed up but your name is not listed (not
approved) but you feel you deserve it, please email me and explain
why. It is possible I did not recognize your name.

Massimo

On Nov 17, 9:07 am, appydev  wrote:
> Greetings to everyone.
>
> I recently read about an application developed with web2py like "Django
> People" I get to test it and I read about some suggestions from Massimo.
>
> I've been looking but can not find it. Anyone remember it?


[web2py] Re: migrate existing GAE list fields to new web2py list types

2010-11-17 Thread howesc
hmmm, i made the changes you suggested, but now that the field type is
'list:reference' GAE throws:

  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/db/__init__.py", line 3016, in validate
raise BadValueError('Property %s must be a list' % self.name)
BadValueError: Property media must be a list

on existing fields.  we must be telling GAE to enforce the list type.
I do want to be able to take advantage of the lists, so i guess i'll
have to do the data transformation anyway.

cfh

On Nov 17, 6:47 am, mdipierro  wrote:
> replace
>
> Field('media', 'string', length=2048,
>           requires=IS_IN_DB(db, db.media.id, '%(url)s',
> multiple=True)),
>
> with
>
> Field('media', 'list:reference media', length=2048)
>
> and
>
> in db.define_table('media',...) add format='%(url)s'
>
> Massimo
>
> On Nov 17, 2:01 am, howesc  wrote:
>
> > i upgraded from 1.74.5 to 1.88.2 (so a little bit out of date as of
> > this week).
>
> > an example model with the problem is below.  the media field is the
> > problem.
>
> > db.define_table('song',
> >     #...@todo: add proper requires for each field
> >     Field('duration', 'integer',
> >           requires=IS_NULL_OR(IS_INT_IN_RANGE(0,36001))),
> >     Field('last_modified', 'datetime', default=now, update=now),
> >     Field('title', 'string', length=256, requires=IS_NOT_EMPTY()),
> >     Field('artist', 'string', length=256,
> >           requires=IS_IN_DB(db, db.artist.name, '%(name)s')),
> >     Field('genre', 'string',
> >           requires=IS_IN_DB(db, db.genre.name, '%(name)s')),
> >     Field('song_key', 'string',
> >           requires=IS_NULL_OR(IS_IN_DB(db, db.song_key.name, '%
> > (name)s'))),
> >     Field('song_scale', 'string',
> >           requires=IS_NULL_OR(IS_IN_DB(db, db.song_scale.name, '%
> > (name)s'))),
> >     Field('publisher_song_code', 'string', length=100),
> >     Field('label', 'string',
> >           requires=IS_IN_DB(db, db.label.name, '%(name)s')),
> >     #...@todo: not sure that i like this string of ID's seperated by |
> >     Field('media', 'string', length=2048,
> >           requires=IS_IN_DB(db, db.media.id, '%(url)s',
> > multiple=True)),
> >     Field('isrc', 'string', length=12, unique=True),
> >     Field('orig_publish_year', 'integer',
> >           requires=IS_NULL_OR(IS_INT_IN_RANGE(1800, 2100))),
> >     Field('tempo', 'integer',
> >           requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 250))),
> >     Field('written_by', 'string'),
> >     #...@todo: add optional parameters
> >     #keywords, description, status,thumbnail,name
> >     migrate=migrate)
>
> > thanks,
>
> > cfh
>
> > On Nov 16, 7:20 pm, mdipierro  wrote:
>
> > > Which version did you upgrade from?
> > > Can you show the model that causes problem?
>
> > > On Nov 16, 8:42 pm, howesc  wrote:
>
> > > > Hi all,
>
> > > > sorry if i missed the discussion on this, but i was just bitten by an
> > > > upgrade issue that i'm not sure the best way to solve.
>
> > > > i have an existing app running on the google app engine that uses
> > > > several String fields with IS_IN_DB(... multiple=True).  I upgraded
> > > > web2py and now those fields are not working properly (the forms don't
> > > > see the existing data, and then they update the field incorrectly
> > > > based on the old pipe-delimited string).  This is wrecking havoc in
> > > > the system.
>
> > > > as far as i can tell the best solution is:
> > > >  - change the field type to 'list:reference ' since they
> > > > are references
> > > >  - update my code that expects the pipe-delimited string and make it
> > > > expect a list of IDs (yea!!)
> > > >  - write a task that i can run in the GAE task-queue to query each row
> > > > (around 200,000 of them at least), parse the string, convert it to the
> > > > list, and write back the new entry.
>
> > > > is this correct?  has anyone else done this and have a better
> > > > suggestion?
>
> > > > thanks!
>
> > > > christian
>
>


[web2py] decimal validator by default or not

2010-11-17 Thread Richard Vézina
Hello,

I wonder if it is normal that I get ticket in that case :

Model :

Field('field1','decimal(4,2)'),


If I insert in form generate with crud.create(db.table1) this value :
123.123

I get ticket :

Error traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.

Traceback (most recent call last):
  File "/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
  File "/web2py/applications/app/controllers/test.py", line 552, in 
  File "/web2py/gluon/globals.py", line 96, in 
self._caller = lambda f: f()
  File "/web2py/gluon/tools.py", line 2270, in f
return action(*a, **b)
  File "/web2py/applications/app/controllers/test.py", line 372, in update
if form.accepts(request.vars, session):
  File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
self.table._db(self.table.id == self.record.id).update(**fields)
  File "/web2py/gluon/sql.py", line 3484, in update
self._db._execute(query)
  File "/web2py/gluon/sql.py", line 1026, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
DataError: ERREUR:  champ numérique en dehors des limites
DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une valeur
absolue inférieure à 10^2.


I thought that the validator will show up a error...

Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
limit in the model???

Regards.

Richard


[web2py] Re: crud operations for joins?

2010-11-17 Thread Carlos
Thanks villas and Ivan.

When I say joins I mean 1:1 relationships (or "linked tables"?), where
each record in tables A/B/C reference one (and only one) unique
'entity' record, kind of like an 'extension' of such tables, but with
data centralized in the 'entity' table (which would allow better
maintenance).

I know I have the alternative of embedding all of the 'entity' fields
directly into tables A/B/C (instead of having a separate centralized
'entity' table, with 1:1 relationships).

I was wondering what would be the best approach for this in the
relational world?.

And if a separate 'entity' table is the best option, then I guess I
can use the following slice to create (and update?) records with
linked tables:

http://www.web2pyslices.com/main/slices/take_slice/102

Thanks for your recommendations.

p.s. I have certainly already read the entire book :-)

   Carlos



On Nov 17, 9:06 am, Ivan Matveev  wrote:
> >>  I have a 'central' table in my design called 'entity'
> >> which contains lots of data (including names, company, emails, phones,
> >> address, etc.) and I want many other tables to point to ONE entity
> >> instance, i.e. 'entity' as an _extension_ of records in many different
> >> tables.
>
> When you say 'joined tables' do you mean
> SELECT tabl1.some_col, tabl2.other_col FROM tabl1 LEFT JOIN tabl2 ON .
> or something else?
>
> I don't know a web2py component that can be used to edit a result of a
> joined select.
>
> If your 'entity' table includes all fields you want to present to a
> user you can avoid joins by use of references. I don't use db
> references myself. I think usage can look like this:
>
> db.define_table('names', Field('name', 'string'))
> db.define_table('companies', Field('company', 'string'))
>
> db.define_table('entity',
>     Field('name', db.names.name),
>     Field('company', db.companies.company))
>
> also you can alter the way a field is represented with .represent and
> .requires methods
>
> The details are in documentation on Database Abstraction 
> Layer(DAL)http://www.web2py.com/book/default/chapter/06
>
> SQLFORM allows to edit a row in a table which is fine if you have all
> fields in 'entity' table.
>
> If your 'entity' table contains references to rows in other tables you
> will need SELECT...JOIN...
> To edit its result  you will have to make a page with multiple
> SQLFORMs to edit individual rows in tables ' entity' refers  to , or
> make a custom form with SQLFORM.factory, or invent something.
>
> >> My background is with object databases, and this kind of design makes
> >> sense, although I'm not sure if it makes sense with relation
> >> databases?.
>
> It's pretty common to store an object information in a relation db as
> a set of tables.


[web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
I forgot to precise that I am under 1.88.2

Thanks

On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> Hello,
>
> I wonder if it is normal that I get ticket in that case :
>
> Model :
>
> Field('field1','decimal(4,2)'),
>
>
> If I insert in form generate with crud.create(db.table1) this value :
> 123.123
>
> I get ticket :
>
> Error traceback
>
> 1.
> 2.
>
> 3.
> 4.
>
> 5.
> 6.
>
> 7.
> 8.
>
> 9.
> 10.
>
> 11.
> 12.
>
> 13.
> 14.
>
> 15.
> 16.
>
> 17.
> 18.
>
> 19.
> 20.
>
> 21.
>
> Traceback (most recent call last):
>
>   File "/web2py/gluon/restricted.py", line 188, in restricted
>
> exec ccode in environment
>
>   File "/web2py/applications/app/controllers/test.py", line 552, in 
>
>   File "/web2py/gluon/globals.py", line 96, in 
>
> self._caller = lambda f: f()
>
>   File "/web2py/gluon/tools.py", line 2270, in f
>
> return action(*a, **b)
>
>   File "/web2py/applications/app/controllers/test.py", line 372, in update
>
> if form.accepts(request.vars, session):
>
>   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>
> self.table._db(self.table.id == self.record.id).update(**fields)
>
>   File "/web2py/gluon/sql.py", line 3484, in update
>
> self._db._execute(query)
>
>   File "/web2py/gluon/sql.py", line 1026, in 
>
> self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> DataError: ERREUR:  champ numérique en dehors des limites
>
> DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une valeur
>
> absolue inférieure à 10^2.
>
>
> I thought that the validator will show up a error...
>
> Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> limit in the model???
>
> Regards.
>
> Richard
>


Re: [web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread appydev
Excellent. Thanks for responding.

A much changed. I remember an application that was made just for the map of
the "experts." And since I'm beginner, I wanted to see the application to
learn, remember being hosted on Google App Engine.


2010/11/17 mdipierro 

> we are taking a different approach
>
>   https://experts4solutions.com
>
> You can sign up. I will approve those people who I recognize as
> contributors and/or have proven skills by deploying a web2py
> application. After we reach ~50 people new members will have to be
> endorsed by 5 existing members to be approved.
>
> If you have already signed up but your name is not listed (not
> approved) but you feel you deserve it, please email me and explain
> why. It is possible I did not recognize your name.
>
> Massimo
>
> On Nov 17, 9:07 am, appydev  wrote:
> > Greetings to everyone.
> >
> > I recently read about an application developed with web2py like "Django
> > People" I get to test it and I read about some suggestions from Massimo.
> >
> > I've been looking but can not find it. Anyone remember it?
>


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread Anthony
Are you talking about this:

http://web2pyople.appspot.com/


On Nov 17, 10:46 am, appydev  wrote:
> Excellent. Thanks for responding.
>
> A much changed. I remember an application that was made just for the map of
> the "experts." And since I'm beginner, I wanted to see the application to
> learn, remember being hosted on Google App Engine.
>
> 2010/11/17 mdipierro 
>
>
>
> > we are taking a different approach
>
> >  https://experts4solutions.com
>
> > You can sign up. I will approve those people who I recognize as
> > contributors and/or have proven skills by deploying a web2py
> > application. After we reach ~50 people new members will have to be
> > endorsed by 5 existing members to be approved.
>
> > If you have already signed up but your name is not listed (not
> > approved) but you feel you deserve it, please email me and explain
> > why. It is possible I did not recognize your name.
>
> > Massimo
>
> > On Nov 17, 9:07 am, appydev  wrote:
> > > Greetings to everyone.
>
> > > I recently read about an application developed with web2py like "Django
> > > People" I get to test it and I read about some suggestions from Massimo.
>
> > > I've been looking but can not find it. Anyone remember it?- Hide quoted 
> > > text -
>
> - Show quoted text -


Re: [web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread appydev
Yes! Thanks Anthony.


2010/11/17 Anthony 

> Are you talking about this:
>
> http://web2pyople.appspot.com/
>
>
> On Nov 17, 10:46 am, appydev  wrote:
> > Excellent. Thanks for responding.
> >
> > A much changed. I remember an application that was made just for the map
> of
> > the "experts." And since I'm beginner, I wanted to see the application to
> > learn, remember being hosted on Google App Engine.
> >
> > 2010/11/17 mdipierro 
> >
> >
> >
> > > we are taking a different approach
> >
> > >  https://experts4solutions.com
> >
> > > You can sign up. I will approve those people who I recognize as
> > > contributors and/or have proven skills by deploying a web2py
> > > application. After we reach ~50 people new members will have to be
> > > endorsed by 5 existing members to be approved.
> >
> > > If you have already signed up but your name is not listed (not
> > > approved) but you feel you deserve it, please email me and explain
> > > why. It is possible I did not recognize your name.
> >
> > > Massimo
> >
> > > On Nov 17, 9:07 am, appydev  wrote:
> > > > Greetings to everyone.
> >
> > > > I recently read about an application developed with web2py like
> "Django
> > > > People" I get to test it and I read about some suggestions from
> Massimo.
> >
> > > > I've been looking but can not find it. Anyone remember it?- Hide
> quoted text -
> >
> > - Show quoted text -


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread Anthony
Also, there's this one (a little older):

http://www.appenginepeople.net/users/tag/web2py/

Discussed here:

http://groups.google.com/group/web2py/browse_frm/thread/668fade78f5c3d79

and here:

http://groups.google.com/group/web2py/browse_frm/thread/aa692ce9bc9c572e

On Nov 17, 10:57 am, Anthony  wrote:
> Are you talking about this:
>
> http://web2pyople.appspot.com/
>
> On Nov 17, 10:46 am, appydev  wrote:
>
>
>
> > Excellent. Thanks for responding.
>
> > A much changed. I remember an application that was made just for the map of
> > the "experts." And since I'm beginner, I wanted to see the application to
> > learn, remember being hosted on Google App Engine.
>
> > 2010/11/17 mdipierro 
>
> > > we are taking a different approach
>
> > >  https://experts4solutions.com
>
> > > You can sign up. I will approve those people who I recognize as
> > > contributors and/or have proven skills by deploying a web2py
> > > application. After we reach ~50 people new members will have to be
> > > endorsed by 5 existing members to be approved.
>
> > > If you have already signed up but your name is not listed (not
> > > approved) but you feel you deserve it, please email me and explain
> > > why. It is possible I did not recognize your name.
>
> > > Massimo
>
> > > On Nov 17, 9:07 am, appydev  wrote:
> > > > Greetings to everyone.
>
> > > > I recently read about an application developed with web2py like "Django
> > > > People" I get to test it and I read about some suggestions from Massimo.
>
> > > > I've been looking but can not find it. Anyone remember it?- Hide quoted 
> > > > text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


Re: [web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread appydev
Thank you very much Anthony, I spend part of the morning trying to find in
the search of the group without any results. with queries like "django clone
people." Is rare.

Thank you very much again.

2010/11/17 Anthony 

> Also, there's this one (a little older):
>
> http://www.appenginepeople.net/users/tag/web2py/
>
> Discussed here:
>
> http://groups.google.com/group/web2py/browse_frm/thread/668fade78f5c3d79
>
> and here:
>
> http://groups.google.com/group/web2py/browse_frm/thread/aa692ce9bc9c572e
>
> On Nov 17, 10:57 am, Anthony  wrote:
> > Are you talking about this:
> >
> > http://web2pyople.appspot.com/
> >
> > On Nov 17, 10:46 am, appydev  wrote:
> >
> >
> >
> > > Excellent. Thanks for responding.
> >
> > > A much changed. I remember an application that was made just for the
> map of
> > > the "experts." And since I'm beginner, I wanted to see the application
> to
> > > learn, remember being hosted on Google App Engine.
> >
> > > 2010/11/17 mdipierro 
> >
> > > > we are taking a different approach
> >
> > > >  https://experts4solutions.com
> >
> > > > You can sign up. I will approve those people who I recognize as
> > > > contributors and/or have proven skills by deploying a web2py
> > > > application. After we reach ~50 people new members will have to be
> > > > endorsed by 5 existing members to be approved.
> >
> > > > If you have already signed up but your name is not listed (not
> > > > approved) but you feel you deserve it, please email me and explain
> > > > why. It is possible I did not recognize your name.
> >
> > > > Massimo
> >
> > > > On Nov 17, 9:07 am, appydev  wrote:
> > > > > Greetings to everyone.
> >
> > > > > I recently read about an application developed with web2py like
> "Django
> > > > > People" I get to test it and I read about some suggestions from
> Massimo.
> >
> > > > > I've been looking but can not find it. Anyone remember it?- Hide
> quoted text -
> >
> > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -


Re: [web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread António Ramos
AHH, found a big problem!
I need to create a table with 940 fields and web2py complains that it is
over 255

What to do to resolve this? i dont want to partition my table because the
record realy has 940 fields in my database (Lotus Notes) that i want to
migrate to web2py.
António

2010/11/17 Anthony 

> Are you talking about this:
>
> http://web2pyople.appspot.com/
>
>
> On Nov 17, 10:46 am, appydev  wrote:
> > Excellent. Thanks for responding.
> >
> > A much changed. I remember an application that was made just for the map
> of
> > the "experts." And since I'm beginner, I wanted to see the application to
> > learn, remember being hosted on Google App Engine.
> >
> > 2010/11/17 mdipierro 
> >
> >
> >
> > > we are taking a different approach
> >
> > >  https://experts4solutions.com
> >
> > > You can sign up. I will approve those people who I recognize as
> > > contributors and/or have proven skills by deploying a web2py
> > > application. After we reach ~50 people new members will have to be
> > > endorsed by 5 existing members to be approved.
> >
> > > If you have already signed up but your name is not listed (not
> > > approved) but you feel you deserve it, please email me and explain
> > > why. It is possible I did not recognize your name.
> >
> > > Massimo
> >
> > > On Nov 17, 9:07 am, appydev  wrote:
> > > > Greetings to everyone.
> >
> > > > I recently read about an application developed with web2py like
> "Django
> > > > People" I get to test it and I read about some suggestions from
> Massimo.
> >
> > > > I've been looking but can not find it. Anyone remember it?- Hide
> quoted text -
> >
> > - Show quoted text -


Re: [web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread Branko Vukelic
On Wed, Nov 17, 2010 at 4:22 PM, mdipierro  wrote:
> You can sign up. I will approve those people who I recognize as
> contributors and/or have proven skills by deploying a web2py
> application. After we reach ~50 people new members will have to be
> endorsed by 5 existing members to be approved.

Aaaand, we'll have to do something about that list of experts. Maybe a
searchable paged list? Anyway, it's getting longer and longer.


-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re:

2010-11-17 Thread villas
Hi Napolean

I have looked at your app and I did not understand it very well,  but
I hope you don't mind that I will try to give you some advice anyway
(even though it might not be so useful!).

It seems that you are going from one view to another without a good
way of passing the ids.  For example you are doing this:

  referencia_id = session.referencia_id

Why not use the url and pick up the id with request.args(0)?

How do you find the patient info again? Why not try something like
this in your form...

   record = db.table(request.args(0)) or redirect(URL('index'))

The general advice I would give you is:

1. Try to it working in one controller and view first of all. You can
display more than one form in the view. Keep self-submitting the form
to the same controller until you see what you expect.

2. Either use the url to pass the id,  or place as a hidden field on
your forms -- see the book.

3. Use SQLFORM instead of crud whenever things start looking
complex.

4. Test the variables in your controller. e.g. try putting: print '--
whatever-here--' in your controller and then check the value on the
web2py commandline.

5. Once you have everyone working,  you can then figure out the best
UI.  You do not necessarily need to split everything across different
views. You could try for example using jQuery to show and hide forms
when you need them.

Finally, just a small point, take out 'welcome' from all the menu.py
links.  It is not necessary and it will make things easier for you
when you rename the app.

I am sure that everyone in the group would love to give detailed
advice when they can, and others may tell you more,  but quite
honestly it is too much to ask that people will find enough time to
download, review and debug entire apps for you, (please do not be
offended, I am just stating a fact!).

Best wishes,  David


On Nov 17, 2:24 pm, Napoleon Moreno  wrote:
> I am sorry for insist in this but it is driving me crazy.
>
> If i can not use a join in GAE. How can i show the name of 'diagnostico'
> table in an webgrid base on 'diagnostico_referencia' table. I tried with
> webgrid and crud and it always show me the id's of the
> 'diagnostico_referencia' table.
>
> Any advice about it?
>
> On Wed, Nov 17, 2010 at 6:57 AM, Napoleon Moreno wrote:
>
> > Good day
>
> > The webgrid is showing the fields of 'diagnostico_referencia' table. I need
> > that it shows the name field of the 'Diagnostico' table. I can not find a
> > way to do it. It suppose to be used in GAE.
>
> > Any advice about it
> > Thanks a lot for your help
>
> > On Wed, Nov 17, 2010 at 6:52 AM, Napoleon Moreno 
> > wrote:
>
> >> Hi Villas
>
> >> It is that i need.  Apparently there is not a way to do it with a crud. I
> >> could use  a sqlform.
>
> >> Thanks!
>
> >> On Mon, Nov 15, 2010 at 7:16 PM, villas  wrote:
>
> >>> Hi,
> >>> I'm not sure,  but I think Napoleon wants to save the id key of the
> >>> 'master table' into the master_id field of the 'detail' table.
> >>> I'm not sure how it works with crud.  I would suggest that you use
> >>> SQLFORM and set the field after form.accepts.  Take a look at this
> >>> link:
>
> >>>http://www.web2pyslices.com/main/slices/take_slice/102
>
> >>> This is a short-cut way of linking tables, but notice how the id is
> >>> set.
> >>> Hope this helps.
> >>> -D
>
> >>> On Nov 15, 11:49 pm, "mr.freeze"  wrote:
> >>> > Sorry, I don't fully understand. You can email your app (with any
> >>> > personal data removed) and I will take a closer look.
>
> >>> > On Nov 15, 5:02 pm, Napoleon Moreno  wrote:
>
> >>> > > I am doing that. but  the crud form does not the key value from the
> >>> master
> >>> > > table. ( or master page ). The user has to input the referencia value
> >>> in the
> >>> > > crud page.
>
> >>> > > db.define_table('referencia',
> >>> > >     Field('fecha_remision','
>
> >>> > > > datetime')
> >>> > > > )
>
> >>> > > > db.define_table('diagnostico_referencia',
> >>> > > >     Field('diagnostico',db.diagnostico),
> >>> > > >     Field('referencia',db.referencia)
> >>> > > >     )
>
> >>> > > > in the controler
> >>> > > >    
>
> >>> > > >     grid = webgrid.WebGrid(crud)
> >>> > > >     grid.enabled_rows = ['add_links']
> >>> > > >     grid.action_links = ['delete']
> >>> > > >     grid.action_headers = []
> >>> > > >     grid.crud_function = 'diagnostico_referencia'
>
> >>> > > >    crud.settings.controller = 'default'
> >>> > > >    grid.datasource =
> >>> > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
> >>> > > >     return dict(form=form, grid=grid(),referencia=referencia_id)
>
> >>> > > > def diagnostico_referencia():
> >>> > > >     crud.settings[request.args(0)+'_next'] =
> >>> URL(r=request,f='referencia')
> >>> > > >     return dict(form=crud())
>
> >>> > > > Is it posible that the form in diagnostico_referencia  get the
> >>> > > > referencia.id value from the controler in the addition form?
>
> >>> > > On Mon, Nov 15, 2010 at 5:59 PM, Napoleon Moreno <
> 

Re: [web2py] Re: How may I revoked a user logged in "server side"

2010-11-17 Thread Richard Vézina
Hello,

I note that "blocked" in registration_key not prevent the user to login
under 1.88.2...

Is the keyword for that task as change??

Richard

On Thu, Aug 26, 2010 at 2:27 PM, mdipierro  wrote:

> What Thadeus suggests forces the user to logout.
>
> Before you do that you may also want to use appadmin and write
> "blocked" in their registration key. This will prevent them from
> logging in again.
>
> On Aug 26, 11:58 am, Thadeus Burgess  wrote:
> > Two ways, delete their session file... unless you know their IP it
> > might be hard to find the right one, so if its ok just delete them
> > all.
> >
> > The other way is a design thing. Add a column to the auth_user table
> > that says "force_logout" that is a boolean type. If you just flag that
> > to true, make the login mechanism sign them out and require them to
> > sign back in.
> >
> > --
> > Thadeus
> >
> > On Thu, Aug 26, 2010 at 11:41 AM, Jean-Guy  wrote:
> > >  Hello,
> >
> > > I would like to know how may I revoked a user logged in "server side"?
> >
> > > Can I just edit app/sessions/file... And comment appropriate line?
> >
> > > Which lines are the appropriate lines? ;-)
> >
> > > Jonhy
>


[web2py] Re: decimal validator by default or not

2010-11-17 Thread villas
Hi Richard

It might depend on the DB,  but I believe you would normally need at
least decimal(5,2) to contain 123.456789
With decimal(4,2) I think the max value would be 99.99...

Try it...  :)

-D


On Nov 17, 3:44 pm, Richard Vézina 
wrote:
> I forgot to precise that I am under 1.88.2
>
> Thanks
>
> On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
>
> ml.richard.vez...@gmail.com> wrote:
> > Hello,
>
> > I wonder if it is normal that I get ticket in that case :
>
> > Model :
>
> > Field('field1','decimal(4,2)'),
>
> > If I insert in form generate with crud.create(db.table1) this value :
> > 123.123
>
> > I get ticket :
>
> > Error traceback
>
> > 1.
> > 2.
>
> > 3.
> > 4.
>
> > 5.
> > 6.
>
> > 7.
> > 8.
>
> > 9.
> > 10.
>
> > 11.
> > 12.
>
> > 13.
> > 14.
>
> > 15.
> > 16.
>
> > 17.
> > 18.
>
> > 19.
> > 20.
>
> > 21.
>
> > Traceback (most recent call last):
>
> >   File "/web2py/gluon/restricted.py", line 188, in restricted
>
> >     exec ccode in environment
>
> >   File "/web2py/applications/app/controllers/test.py", line 552, in 
>
> >   File "/web2py/gluon/globals.py", line 96, in 
>
> >     self._caller = lambda f: f()
>
> >   File "/web2py/gluon/tools.py", line 2270, in f
>
> >     return action(*a, **b)
>
> >   File "/web2py/applications/app/controllers/test.py", line 372, in update
>
> >     if form.accepts(request.vars, session):
>
> >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>
> >     self.table._db(self.table.id == self.record.id).update(**fields)
>
> >   File "/web2py/gluon/sql.py", line 3484, in update
>
> >     self._db._execute(query)
>
> >   File "/web2py/gluon/sql.py", line 1026, in 
>
> >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > DataError: ERREUR:  champ numérique en dehors des limites
>
> > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une 
> > valeur
>
> > absolue inférieure à 10^2.
>
> > I thought that the validator will show up a error...
>
> > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> > limit in the model???
>
> > Regards.
>
> > Richard
>
>


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
I don't want to store 123.123, I want 99.99 max.

The problem is that no validator is triggered when entering 123.123...

Richard

On Wed, Nov 17, 2010 at 11:53 AM, villas  wrote:

> Hi Richard
>
> It might depend on the DB,  but I believe you would normally need at
> least decimal(5,2) to contain 123.456789
> With decimal(4,2) I think the max value would be 99.99...
>
> Try it...  :)
>
> -D
>
>
> On Nov 17, 3:44 pm, Richard Vézina 
> wrote:
> > I forgot to precise that I am under 1.88.2
> >
> > Thanks
> >
> > On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
> >
> > ml.richard.vez...@gmail.com> wrote:
> > > Hello,
> >
> > > I wonder if it is normal that I get ticket in that case :
> >
> > > Model :
> >
> > > Field('field1','decimal(4,2)'),
> >
> > > If I insert in form generate with crud.create(db.table1) this value :
> > > 123.123
> >
> > > I get ticket :
> >
> > > Error traceback
> >
> > > 1.
> > > 2.
> >
> > > 3.
> > > 4.
> >
> > > 5.
> > > 6.
> >
> > > 7.
> > > 8.
> >
> > > 9.
> > > 10.
> >
> > > 11.
> > > 12.
> >
> > > 13.
> > > 14.
> >
> > > 15.
> > > 16.
> >
> > > 17.
> > > 18.
> >
> > > 19.
> > > 20.
> >
> > > 21.
> >
> > > Traceback (most recent call last):
> >
> > >   File "/web2py/gluon/restricted.py", line 188, in restricted
> >
> > > exec ccode in environment
> >
> > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> 
> >
> > >   File "/web2py/gluon/globals.py", line 96, in 
> >
> > > self._caller = lambda f: f()
> >
> > >   File "/web2py/gluon/tools.py", line 2270, in f
> >
> > > return action(*a, **b)
> >
> > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> update
> >
> > > if form.accepts(request.vars, session):
> >
> > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> >
> > > self.table._db(self.table.id == self.record.id).update(**fields)
> >
> > >   File "/web2py/gluon/sql.py", line 3484, in update
> >
> > > self._db._execute(query)
> >
> > >   File "/web2py/gluon/sql.py", line 1026, in 
> >
> > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > DataError: ERREUR:  champ numérique en dehors des limites
> >
> > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une
> valeur
> >
> > > absolue inférieure à 10^2.
> >
> > > I thought that the validator will show up a error...
> >
> > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> decimal
> > > limit in the model???
> >
> > > Regards.
> >
> > > Richard
> >
> >
>


[web2py] Re: crud operations for joins?

2010-11-17 Thread villas
Hi Carlos,

See what you mean.  We don't usually use 1:1 relationships,  but 1 to
many.

e.g. From the book:

db.define_table('person',
Field('name'),
format='%(name)s')

db.define_table('dog',
Field('name'),
Field('owner', db.person),
format='%(name)s')

Of course an owner might only have one dog to start with, but then
acquire others later, so this model serves for any number of dogs,
incl. zero.

The same owner might also decide to keep a cat and (assuming he needs
to keep different data on that) he would simply define a 'cat' table
later with a similar realtionship.

I suppose if you insisted on making it 1:1,  I might simply suggest
making the dog.owner field into a unique index which would prevent
your adding more than 1.

-D


On Nov 17, 3:44 pm, Carlos  wrote:
> Thanks villas and Ivan.
>
> When I say joins I mean 1:1 relationships (or "linked tables"?), where
> each record in tables A/B/C reference one (and only one) unique
> 'entity' record, kind of like an 'extension' of such tables, but with
> data centralized in the 'entity' table (which would allow better
> maintenance).
>
> I know I have the alternative of embedding all of the 'entity' fields
> directly into tables A/B/C (instead of having a separate centralized
> 'entity' table, with 1:1 relationships).
>
> I was wondering what would be the best approach for this in the
> relational world?.
>
> And if a separate 'entity' table is the best option, then I guess I
> can use the following slice to create (and update?) records with
> linked tables:
>
> http://www.web2pyslices.com/main/slices/take_slice/102
>
> Thanks for your recommendations.
>
> p.s. I have certainly already read the entire book :-)
>
>    Carlos
>
> On Nov 17, 9:06 am, Ivan Matveev  wrote:
>
> > >>  I have a 'central' table in my design called 'entity'
> > >> which contains lots of data (including names, company, emails, phones,
> > >> address, etc.) and I want many other tables to point to ONE entity
> > >> instance, i.e. 'entity' as an _extension_ of records in many different
> > >> tables.
>
> > When you say 'joined tables' do you mean
> > SELECT tabl1.some_col, tabl2.other_col FROM tabl1 LEFT JOIN tabl2 ON .
> > or something else?
>
> > I don't know a web2py component that can be used to edit a result of a
> > joined select.
>
> > If your 'entity' table includes all fields you want to present to a
> > user you can avoid joins by use of references. I don't use db
> > references myself. I think usage can look like this:
>
> > db.define_table('names', Field('name', 'string'))
> > db.define_table('companies', Field('company', 'string'))
>
> > db.define_table('entity',
> >     Field('name', db.names.name),
> >     Field('company', db.companies.company))
>
> > also you can alter the way a field is represented with .represent and
> > .requires methods
>
> > The details are in documentation on Database Abstraction 
> > Layer(DAL)http://www.web2py.com/book/default/chapter/06
>
> > SQLFORM allows to edit a row in a table which is fine if you have all
> > fields in 'entity' table.
>
> > If your 'entity' table contains references to rows in other tables you
> > will need SELECT...JOIN...
> > To edit its result  you will have to make a page with multiple
> > SQLFORMs to edit individual rows in tables ' entity' refers  to , or
> > make a custom form with SQLFORM.factory, or invent something.
>
> > >> My background is with object databases, and this kind of design makes
> > >> sense, although I'm not sure if it makes sense with relation
> > >> databases?.
>
> > It's pretty common to store an object information in a relation db as
> > a set of tables.
>
>


[web2py] Re: decimal validator by default or not

2010-11-17 Thread villas
Sorry I misunderstood. I think you are right, web2py doesn't validate
it.
-D

On Nov 17, 5:00 pm, Richard Vézina 
wrote:
> I don't want to store 123.123, I want 99.99 max.
>
> The problem is that no validator is triggered when entering 123.123...
>
> Richard
>
> On Wed, Nov 17, 2010 at 11:53 AM, villas  wrote:
> > Hi Richard
>
> > It might depend on the DB,  but I believe you would normally need at
> > least decimal(5,2) to contain 123.456789
> > With decimal(4,2) I think the max value would be 99.99...
>
> > Try it...  :)
>
> > -D
>
> > On Nov 17, 3:44 pm, Richard Vézina 
> > wrote:
> > > I forgot to precise that I am under 1.88.2
>
> > > Thanks
>
> > > On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
>
> > > ml.richard.vez...@gmail.com> wrote:
> > > > Hello,
>
> > > > I wonder if it is normal that I get ticket in that case :
>
> > > > Model :
>
> > > > Field('field1','decimal(4,2)'),
>
> > > > If I insert in form generate with crud.create(db.table1) this value :
> > > > 123.123
>
> > > > I get ticket :
>
> > > > Error traceback
>
> > > > 1.
> > > > 2.
>
> > > > 3.
> > > > 4.
>
> > > > 5.
> > > > 6.
>
> > > > 7.
> > > > 8.
>
> > > > 9.
> > > > 10.
>
> > > > 11.
> > > > 12.
>
> > > > 13.
> > > > 14.
>
> > > > 15.
> > > > 16.
>
> > > > 17.
> > > > 18.
>
> > > > 19.
> > > > 20.
>
> > > > 21.
>
> > > > Traceback (most recent call last):
>
> > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
>
> > > >     exec ccode in environment
>
> > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> > 
>
> > > >   File "/web2py/gluon/globals.py", line 96, in 
>
> > > >     self._caller = lambda f: f()
>
> > > >   File "/web2py/gluon/tools.py", line 2270, in f
>
> > > >     return action(*a, **b)
>
> > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> > update
>
> > > >     if form.accepts(request.vars, session):
>
> > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>
> > > >     self.table._db(self.table.id == self.record.id).update(**fields)
>
> > > >   File "/web2py/gluon/sql.py", line 3484, in update
>
> > > >     self._db._execute(query)
>
> > > >   File "/web2py/gluon/sql.py", line 1026, in 
>
> > > >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > > DataError: ERREUR:  champ numérique en dehors des limites
>
> > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une
> > valeur
>
> > > > absolue inférieure à 10^2.
>
> > > > I thought that the validator will show up a error...
>
> > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> > decimal
> > > > limit in the model???
>
> > > > Regards.
>
> > > > Richard
>
>


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
Doesn't neither with IS_DECIMAL_IN_RANGE(0,99), I get the same ticket...

Richard

On Wed, Nov 17, 2010 at 12:24 PM, villas  wrote:

> Sorry I misunderstood. I think you are right, web2py doesn't validate
> it.
> -D
>
> On Nov 17, 5:00 pm, Richard Vézina 
> wrote:
> > I don't want to store 123.123, I want 99.99 max.
> >
> > The problem is that no validator is triggered when entering 123.123...
> >
> > Richard
> >
> > On Wed, Nov 17, 2010 at 11:53 AM, villas  wrote:
> > > Hi Richard
> >
> > > It might depend on the DB,  but I believe you would normally need at
> > > least decimal(5,2) to contain 123.456789
> > > With decimal(4,2) I think the max value would be 99.99...
> >
> > > Try it...  :)
> >
> > > -D
> >
> > > On Nov 17, 3:44 pm, Richard Vézina 
> > > wrote:
> > > > I forgot to precise that I am under 1.88.2
> >
> > > > Thanks
> >
> > > > On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
> >
> > > > ml.richard.vez...@gmail.com> wrote:
> > > > > Hello,
> >
> > > > > I wonder if it is normal that I get ticket in that case :
> >
> > > > > Model :
> >
> > > > > Field('field1','decimal(4,2)'),
> >
> > > > > If I insert in form generate with crud.create(db.table1) this value
> :
> > > > > 123.123
> >
> > > > > I get ticket :
> >
> > > > > Error traceback
> >
> > > > > 1.
> > > > > 2.
> >
> > > > > 3.
> > > > > 4.
> >
> > > > > 5.
> > > > > 6.
> >
> > > > > 7.
> > > > > 8.
> >
> > > > > 9.
> > > > > 10.
> >
> > > > > 11.
> > > > > 12.
> >
> > > > > 13.
> > > > > 14.
> >
> > > > > 15.
> > > > > 16.
> >
> > > > > 17.
> > > > > 18.
> >
> > > > > 19.
> > > > > 20.
> >
> > > > > 21.
> >
> > > > > Traceback (most recent call last):
> >
> > > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
> >
> > > > > exec ccode in environment
> >
> > > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> > > 
> >
> > > > >   File "/web2py/gluon/globals.py", line 96, in 
> >
> > > > > self._caller = lambda f: f()
> >
> > > > >   File "/web2py/gluon/tools.py", line 2270, in f
> >
> > > > > return action(*a, **b)
> >
> > > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> > > update
> >
> > > > > if form.accepts(request.vars, session):
> >
> > > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> >
> > > > > self.table._db(self.table.id == self.record.id
> ).update(**fields)
> >
> > > > >   File "/web2py/gluon/sql.py", line 3484, in update
> >
> > > > > self._db._execute(query)
> >
> > > > >   File "/web2py/gluon/sql.py", line 1026, in 
> >
> > > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > > > DataError: ERREUR:  champ numérique en dehors des limites
> >
> > > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
> une
> > > valeur
> >
> > > > > absolue inférieure à 10^2.
> >
> > > > > I thought that the validator will show up a error...
> >
> > > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> > > decimal
> > > > > limit in the model???
> >
> > > > > Regards.
> >
> > > > > Richard
> >
> >
>


[web2py] Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Lorin Rivers
executesql('select min(reqtime) from data_table;')
-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




Re: [web2py] Re: How may I revoked a user logged in "server side"

2010-11-17 Thread Richard Vézina
Forgot about this one... My error cause of mixup between dev db and prod
db... ;-D

Richard

On Wed, Nov 17, 2010 at 11:50 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> Hello,
>
> I note that "blocked" in registration_key not prevent the user to login
> under 1.88.2...
>
> Is the keyword for that task as change??
>
> Richard
>
>
> On Thu, Aug 26, 2010 at 2:27 PM, mdipierro wrote:
>
>> What Thadeus suggests forces the user to logout.
>>
>> Before you do that you may also want to use appadmin and write
>> "blocked" in their registration key. This will prevent them from
>> logging in again.
>>
>> On Aug 26, 11:58 am, Thadeus Burgess  wrote:
>> > Two ways, delete their session file... unless you know their IP it
>> > might be hard to find the right one, so if its ok just delete them
>> > all.
>> >
>> > The other way is a design thing. Add a column to the auth_user table
>> > that says "force_logout" that is a boolean type. If you just flag that
>> > to true, make the login mechanism sign them out and require them to
>> > sign back in.
>> >
>> > --
>> > Thadeus
>> >
>> > On Thu, Aug 26, 2010 at 11:41 AM, Jean-Guy  wrote:
>> > >  Hello,
>> >
>> > > I would like to know how may I revoked a user logged in "server side"?
>> >
>> > > Can I just edit app/sessions/file... And comment appropriate line?
>> >
>> > > Which lines are the appropriate lines? ;-)
>> >
>> > > Jonhy
>>
>
>


[web2py] Re: Validate dynamically generated select SQLFORM.factory

2010-11-17 Thread Kostas M
At first thanks villas for the correction of the boolean 'multiple'
argument.

DenesL I agree that "multiple should mean 1 or more, not zero or
more."

Making though the following test:

>>> IS_IN_SET(['max', 'john'])('')
('', 'value not allowed')
>>> IS_IN_SET(['max', 'john'], multiple=True)('')
([], None)

seems that the zero option strangely is allowed for the multiple case.

According to: 
http://www.web2py.com/examples/static/epydoc/web2py.gluon.validators.IS_IN_SET-class.html#__call__
this is due to lines:
 327  if self.multiple and (value == None or value ==
''):
 328  return ([], None)

I think should return (value, self.error_message), as is the case for
multiple=False

>
> Because multiple is not False, but I am not sure about the logic.
> No selection should still fail because it is not in the set,
> i.e. multiple should mean 1 or more, not zero or more.
>


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Jonathan Lundell
On Nov 17, 2010, at 9:40 AM, Richard Vézina wrote:
> Doesn't neither with IS_DECIMAL_IN_RANGE(0,99), I get the same ticket...

The doctest for IS_DECIMAL_IN_RANGE is currently broken (Massimo, I'll send you 
a patch), but these all pass:

>>> IS_DECIMAL_IN_RANGE(0,99)(123.123)
(123.123, 'enter a number between 0 and 99')
>>> IS_DECIMAL_IN_RANGE(0,99)('123.123')
('123.123', 'enter a number between 0 and 99')
>>> IS_DECIMAL_IN_RANGE(0,99)('12.34')
(Decimal('12.34'), None)

Something else must be wrong.


> 
> Richard
> 
> On Wed, Nov 17, 2010 at 12:24 PM, villas  wrote:
> Sorry I misunderstood. I think you are right, web2py doesn't validate
> it.
> -D
> 
> On Nov 17, 5:00 pm, Richard Vézina 
> wrote:
> > I don't want to store 123.123, I want 99.99 max.
> >
> > The problem is that no validator is triggered when entering 123.123...
> >
> > Richard
> >
> > On Wed, Nov 17, 2010 at 11:53 AM, villas  wrote:
> > > Hi Richard
> >
> > > It might depend on the DB,  but I believe you would normally need at
> > > least decimal(5,2) to contain 123.456789
> > > With decimal(4,2) I think the max value would be 99.99...
> >
> > > Try it...  :)
> >
> > > -D
> >
> > > On Nov 17, 3:44 pm, Richard Vézina 
> > > wrote:
> > > > I forgot to precise that I am under 1.88.2
> >
> > > > Thanks
> >
> > > > On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
> >
> > > > ml.richard.vez...@gmail.com> wrote:
> > > > > Hello,
> >
> > > > > I wonder if it is normal that I get ticket in that case :
> >
> > > > > Model :
> >
> > > > > Field('field1','decimal(4,2)'),
> >
> > > > > If I insert in form generate with crud.create(db.table1) this value :
> > > > > 123.123
> >
> > > > > I get ticket :
> >
> > > > > Error traceback
> >
> > > > > 1.
> > > > > 2.
> >
> > > > > 3.
> > > > > 4.
> >
> > > > > 5.
> > > > > 6.
> >
> > > > > 7.
> > > > > 8.
> >
> > > > > 9.
> > > > > 10.
> >
> > > > > 11.
> > > > > 12.
> >
> > > > > 13.
> > > > > 14.
> >
> > > > > 15.
> > > > > 16.
> >
> > > > > 17.
> > > > > 18.
> >
> > > > > 19.
> > > > > 20.
> >
> > > > > 21.
> >
> > > > > Traceback (most recent call last):
> >
> > > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
> >
> > > > > exec ccode in environment
> >
> > > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> > > 
> >
> > > > >   File "/web2py/gluon/globals.py", line 96, in 
> >
> > > > > self._caller = lambda f: f()
> >
> > > > >   File "/web2py/gluon/tools.py", line 2270, in f
> >
> > > > > return action(*a, **b)
> >
> > > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> > > update
> >
> > > > > if form.accepts(request.vars, session):
> >
> > > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> >
> > > > > self.table._db(self.table.id == self.record.id).update(**fields)
> >
> > > > >   File "/web2py/gluon/sql.py", line 3484, in update
> >
> > > > > self._db._execute(query)
> >
> > > > >   File "/web2py/gluon/sql.py", line 1026, in 
> >
> > > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > > > DataError: ERREUR:  champ numérique en dehors des limites
> >
> > > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à 
> > > > > une
> > > valeur
> >
> > > > > absolue inférieure à 10^2.
> >
> > > > > I thought that the validator will show up a error...
> >
> > > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> > > decimal
> > > > > limit in the model???
> >
> > > > > Regards.
> >
> > > > > Richard
> >
> >
> 




[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread cjrh
On Nov 17, 6:19 pm, António Ramos  wrote:
> What to do to resolve this? i dont want to partition my table because the
> record realy has 940 fields in my database (Lotus Notes)

I would love to see a summary of that schema, because with that number
of fields it sounds like you're beginning to fail the first normal
form, and possibly the second.  Does every record populate every field
with a value?


[web2py] Re: crud operations for joins?

2010-11-17 Thread Carlos
Thanks villas.

In the example I provide (entity), specifically for web2py and
relational databases, does it actually make sense to separate 'entity'
to its own table and use 1:1 relationships from tables A/B/C, or is it
recommended to just embed the 'entity' fields into tables A/B/C
(without any references)?.

What are the pros and cons of such alternatives?.

The pro I see about using an independent 'entity' table is
maintenance, but the con might be the access / manipulation of this
extra reference ...?

Thanks again!,

   Carlos


On Nov 17, 11:11 am, villas  wrote:
> Hi Carlos,
>
> See what you mean.  We don't usually use 1:1 relationships,  but 1 to
> many.
>
> e.g. From the book:
>
> db.define_table('person',
>     Field('name'),
>     format='%(name)s')
>
> db.define_table('dog',
>     Field('name'),
>     Field('owner', db.person),
>     format='%(name)s')
>
> Of course an owner might only have one dog to start with, but then
> acquire others later, so this model serves for any number of dogs,
> incl. zero.
>
> The same owner might also decide to keep a cat and (assuming he needs
> to keep different data on that) he would simply define a 'cat' table
> later with a similar realtionship.
>
> I suppose if you insisted on making it 1:1,  I might simply suggest
> making the dog.owner field into a unique index which would prevent
> your adding more than 1.
>
> -D
>
> On Nov 17, 3:44 pm, Carlos  wrote:
>
>
>
>
>
>
>
> > Thanks villas and Ivan.
>
> > When I say joins I mean 1:1 relationships (or "linked tables"?), where
> > each record in tables A/B/C reference one (and only one) unique
> > 'entity' record, kind of like an 'extension' of such tables, but with
> > data centralized in the 'entity' table (which would allow better
> > maintenance).
>
> > I know I have the alternative of embedding all of the 'entity' fields
> > directly into tables A/B/C (instead of having a separate centralized
> > 'entity' table, with 1:1 relationships).
>
> > I was wondering what would be the best approach for this in the
> > relational world?.
>
> > And if a separate 'entity' table is the best option, then I guess I
> > can use the following slice to create (and update?) records with
> > linked tables:
>
> >http://www.web2pyslices.com/main/slices/take_slice/102
>
> > Thanks for your recommendations.
>
> > p.s. I have certainly already read the entire book :-)
>
> >    Carlos
>
> > On Nov 17, 9:06 am, Ivan Matveev  wrote:
>
> > > >>  I have a 'central' table in my design called 'entity'
> > > >> which contains lots of data (including names, company, emails, phones,
> > > >> address, etc.) and I want many other tables to point to ONE entity
> > > >> instance, i.e. 'entity' as an _extension_ of records in many different
> > > >> tables.
>
> > > When you say 'joined tables' do you mean
> > > SELECT tabl1.some_col, tabl2.other_col FROM tabl1 LEFT JOIN tabl2 ON .
> > > or something else?
>
> > > I don't know a web2py component that can be used to edit a result of a
> > > joined select.
>
> > > If your 'entity' table includes all fields you want to present to a
> > > user you can avoid joins by use of references. I don't use db
> > > references myself. I think usage can look like this:
>
> > > db.define_table('names', Field('name', 'string'))
> > > db.define_table('companies', Field('company', 'string'))
>
> > > db.define_table('entity',
> > >     Field('name', db.names.name),
> > >     Field('company', db.companies.company))
>
> > > also you can alter the way a field is represented with .represent and
> > > .requires methods
>
> > > The details are in documentation on Database Abstraction 
> > > Layer(DAL)http://www.web2py.com/book/default/chapter/06
>
> > > SQLFORM allows to edit a row in a table which is fine if you have all
> > > fields in 'entity' table.
>
> > > If your 'entity' table contains references to rows in other tables you
> > > will need SELECT...JOIN...
> > > To edit its result  you will have to make a page with multiple
> > > SQLFORMs to edit individual rows in tables ' entity' refers  to , or
> > > make a custom form with SQLFORM.factory, or invent something.
>
> > > >> My background is with object databases, and this kind of design makes
> > > >> sense, although I'm not sure if it makes sense with relation
> > > >> databases?.
>
> > > It's pretty common to store an object information in a relation db as
> > > a set of tables.


[web2py] social network, event planners, and the like?

2010-11-17 Thread Carlos
Hi,

In a future project I might need capabilities like social network,
event planners (e.g. weddings, parties), and the like.

I'm wondering if there's something already out there - preferably free
open source, and obviously developed with web2py?, or at least in
python?.

If there's nothing, is it recommended to start from scratch with
web2py, or interface to external systems (e.g. elgg.org) from web2py?.

If external systems, customizations will likely be required.

Any help / advice on this matter is greatly appreciated - thanks!,

   Carlos


[web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread mdipierro
m=db.data_table.reqtime.min()
value = db(db.date_table).select().first()[m]

On Nov 17, 11:43 am, Lorin Rivers  wrote:
> executesql('select min(reqtime) from data_table;')
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


[web2py] Re: list:reference issue

2010-11-17 Thread mdipierro
will look into this asap.

On Nov 17, 11:49 am, Richard Vézina 
wrote:
> Hello,
>
> The list:reference issue I discribed last week is still in trunk. I joint a
> demo app with which it is possible to reproduce the issue.
>
> If the date validator is triggered and the id of the referenced record is
> greater then or equal to 10 the app break completely if the corrected form
> is submit and the digited id is not existing in table.
>
> For example :
>
> I select id 10, I submit, but I forgot to entered a date. I get the
> validator in action, the id of my selected record is splitted into digit 1
> and 0. 0 not existing in my table = app break including the appadmin
> interface, so no correction of the problem possible except go in the
> database changing the id selected.
>
> Thanks
>
> Richard
>
>  web2py.app.applistissue.w2p
> 107KViewDownload


[web2py] Re: Validate dynamically generated select SQLFORM.factory

2010-11-17 Thread mdipierro
> DenesL I agree that "multiple should mean 1 or more, not zero or more."

I disagree. Multiple means 0 or more. Anyway, we cannot change this.


On Nov 17, 12:06 pm, Kostas M  wrote:
> At first thanks villas for the correction of the boolean 'multiple'
> argument.
>
> DenesL I agree that "multiple should mean 1 or more, not zero or
> more."
>
> Making though the following test:
>
> >>> IS_IN_SET(['max', 'john'])('')
>
> ('', 'value not allowed')>>> IS_IN_SET(['max', 'john'], multiple=True)('')
>
> ([], None)
>
> seems that the zero option strangely is allowed for the multiple case.
>
> According 
> to:http://www.web2py.com/examples/static/epydoc/web2py.gluon.validators
> this is due to lines:
>  327              if self.multiple and (value == None or value ==
> ''):
>  328                  return ([], None)
>
> I think should return (value, self.error_message), as is the case for
> multiple=False
>
>
>
> > Because multiple is not False, but I am not sure about the logic.
> > No selection should still fail because it is not in the set,
> > i.e. multiple should mean 1 or more, not zero or more.
>
>


[web2py] Re: Validate dynamically generated select SQLFORM.factory

2010-11-17 Thread mdipierro
btw you can do

requires=IS_IN_SET(...,multiple=True,_and=IS_NOT_EMPTY())

On Nov 17, 1:33 pm, mdipierro  wrote:
> > DenesL I agree that "multiple should mean 1 or more, not zero or more."
>
> I disagree. Multiple means 0 or more. Anyway, we cannot change this.
>
> On Nov 17, 12:06 pm, Kostas M  wrote:
>
> > At first thanks villas for the correction of the boolean 'multiple'
> > argument.
>
> > DenesL I agree that "multiple should mean 1 or more, not zero or
> > more."
>
> > Making though the following test:
>
> > >>> IS_IN_SET(['max', 'john'])('')
>
> > ('', 'value not allowed')>>> IS_IN_SET(['max', 'john'], multiple=True)('')
>
> > ([], None)
>
> > seems that the zero option strangely is allowed for the multiple case.
>
> > According 
> > to:http://www.web2py.com/examples/static/epydoc/web2py.gluon.validators
> > this is due to lines:
> >  327              if self.multiple and (value == None or value ==
> > ''):
> >  328                  return ([], None)
>
> > I think should return (value, self.error_message), as is the case for
> > multiple=False
>
> > > Because multiple is not False, but I am not sure about the logic.
> > > No selection should still fail because it is not in the set,
> > > i.e. multiple should mean 1 or more, not zero or more.
>
>


[web2py] Re: decimal validator by default or not

2010-11-17 Thread mdipierro
what python version? perhaps something has changed in sqlite? this
looks like a sqlite error.

On Nov 17, 9:43 am, Richard Vézina 
wrote:
> Hello,
>
> I wonder if it is normal that I get ticket in that case :
>
> Model :
>
> Field('field1','decimal(4,2)'),
>
> If I insert in form generate with crud.create(db.table1) this value :
> 123.123
>
> I get ticket :
>
> Error traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
>
> Traceback (most recent call last):
>   File "/web2py/gluon/restricted.py", line 188, in restricted
>     exec ccode in environment
>   File "/web2py/applications/app/controllers/test.py", line 552, in 
>   File "/web2py/gluon/globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File "/web2py/gluon/tools.py", line 2270, in f
>     return action(*a, **b)
>   File "/web2py/applications/app/controllers/test.py", line 372, in update
>     if form.accepts(request.vars, session):
>   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>     self.table._db(self.table.id == self.record.id).update(**fields)
>   File "/web2py/gluon/sql.py", line 3484, in update
>     self._db._execute(query)
>   File "/web2py/gluon/sql.py", line 1026, in 
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> DataError: ERREUR:  champ numérique en dehors des limites
> DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une valeur
> absolue inférieure à 10^2.
>
> I thought that the validator will show up a error...
>
> Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> limit in the model???
>
> Regards.
>
> Richard


[web2py] Re: decimal validator by default or not

2010-11-17 Thread mdipierro
BTW... why are you getting the traceback in french? If your python is
localized, could this affect the meaning of . in sqlite?

On Nov 17, 9:43 am, Richard Vézina 
wrote:
> Hello,
>
> I wonder if it is normal that I get ticket in that case :
>
> Model :
>
> Field('field1','decimal(4,2)'),
>
> If I insert in form generate with crud.create(db.table1) this value :
> 123.123
>
> I get ticket :
>
> Error traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
>
> Traceback (most recent call last):
>   File "/web2py/gluon/restricted.py", line 188, in restricted
>     exec ccode in environment
>   File "/web2py/applications/app/controllers/test.py", line 552, in 
>   File "/web2py/gluon/globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File "/web2py/gluon/tools.py", line 2270, in f
>     return action(*a, **b)
>   File "/web2py/applications/app/controllers/test.py", line 372, in update
>     if form.accepts(request.vars, session):
>   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>     self.table._db(self.table.id == self.record.id).update(**fields)
>   File "/web2py/gluon/sql.py", line 3484, in update
>     self._db._execute(query)
>   File "/web2py/gluon/sql.py", line 1026, in 
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> DataError: ERREUR:  champ numérique en dehors des limites
> DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une valeur
> absolue inférieure à 10^2.
>
> I thought that the validator will show up a error...
>
> Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> limit in the model???
>
> Regards.
>
> Richard


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread mdipierro
I doubt you are getting a web2py error. You are probably getting a
RuntimeError or ProgrammingError from sqlite.

On Nov 17, 10:19 am, António Ramos  wrote:
> AHH, found a big problem!
> I need to create a table with 940 fields and web2py complains that it is
> over 255
>
> What to do to resolve this? i dont want to partition my table because the
> record realy has 940 fields in my database (Lotus Notes) that i want to
> migrate to web2py.
> António
>
> 2010/11/17 Anthony 
>
> > Are you talking about this:
>
> >http://web2pyople.appspot.com/
>
> > On Nov 17, 10:46 am, appydev  wrote:
> > > Excellent. Thanks for responding.
>
> > > A much changed. I remember an application that was made just for the map
> > of
> > > the "experts." And since I'm beginner, I wanted to see the application to
> > > learn, remember being hosted on Google App Engine.
>
> > > 2010/11/17 mdipierro 
>
> > > > we are taking a different approach
>
> > > >  https://experts4solutions.com
>
> > > > You can sign up. I will approve those people who I recognize as
> > > > contributors and/or have proven skills by deploying a web2py
> > > > application. After we reach ~50 people new members will have to be
> > > > endorsed by 5 existing members to be approved.
>
> > > > If you have already signed up but your name is not listed (not
> > > > approved) but you feel you deserve it, please email me and explain
> > > > why. It is possible I did not recognize your name.
>
> > > > Massimo
>
> > > > On Nov 17, 9:07 am, appydev  wrote:
> > > > > Greetings to everyone.
>
> > > > > I recently read about an application developed with web2py like
> > "Django
> > > > > People" I get to test it and I read about some suggestions from
> > Massimo.
>
> > > > > I've been looking but can not find it. Anyone remember it?- Hide
> > quoted text -
>
> > > - Show quoted text -
>
>


[web2py] Web2py Application Exhibition ( Version 2.0 ) 4 weeks to go

2010-11-17 Thread NetAdmin

Just in case you didn't see the "pinned" message at the top of the
group messages, there are 5 weeks to get your apps ready for the
Web2py Application Exhibition ( Version 2.0 )

For more details, see the "pinned" message.

Good Luck!

Mr.NetAdmin


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread mdipierro
here are many things the need refactoring.

we need a public list of approved experts (the same as now, but random
order and pagination) and a private list of everybody who registered
to that existing experts can endorse new applicants.

massimo



On Nov 17, 10:35 am, Branko Vukelic  wrote:
> On Wed, Nov 17, 2010 at 4:22 PM, mdipierro  wrote:
> > You can sign up. I will approve those people who I recognize as
> > contributors and/or have proven skills by deploying a web2py
> > application. After we reach ~50 people new members will have to be
> > endorsed by 5 existing members to be approved.
>
> Aaaand, we'll have to do something about that list of experts. Maybe a
> searchable paged list? Anyway, it's getting longer and longer.
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group


[web2py] Re: social network, event planners, and the like?

2010-11-17 Thread mdipierro
Not exactly but this is a good place to start:

http://web2py.com/appliances/default/show/71

On Nov 17, 12:59 pm, Carlos  wrote:
> Hi,
>
> In a future project I might need capabilities like social network,
> event planners (e.g. weddings, parties), and the like.
>
> I'm wondering if there's something already out there - preferably free
> open source, and obviously developed with web2py?, or at least in
> python?.
>
> If there's nothing, is it recommended to start from scratch with
> web2py, or interface to external systems (e.g. elgg.org) from web2py?.
>
> If external systems, customizations will likely be required.
>
> Any help / advice on this matter is greatly appreciated - thanks!,
>
>    Carlos


[web2py] Beginner's Question

2010-11-17 Thread asklucas

Hello!

I'm new to web development and my trying web2py because of DRY and,
most importantly, Python.

I created a model, however I can't insert records in the admin
interface because of a constraints-error I don't understand.

When trying to insert a record here:
http://127.0.0.1:8000/task/appadmin/insert/db/task

I get the Error Snapshot:

(
('23000',
'[23000] [Microsoft][ODBC SQL Server Driver][SQL Server]
The INSERT statement conflicted with the FOREIGN KEY
constraint "task_id_person_assigned__constraint".
The conflict occurred in database "taskdb", table
"dbo.person", column \'id\'. (547) (SQLExecDirectW);
[01000] [Microsoft][ODBC SQL Server Driver][SQL Server]The
statement has been terminated. (3621)'
)
)


What I really want is to have dropdown fields in [task] for all three
person-fields, where only persons from the list can be chosen or no
one (a task could be created without yet assigning it to anybody).

Additionally I'd like to have a field in [task] where I can choose 0
to n categories.

Thank you very much!

Lucas.


Model:


#Table Definitions

db.define_table("person",
Field("initials", "string", length=16, notnull=True, default=None,
unique=True),
Field("name_last", "string", length=128, notnull=True,
default=None),
Field("name_first", "string", length=128, notnull=False,
default=None)
)

db.define_table("category",
Field("name", "string", length=128, notnull=True, default=None,
unique=True)
)

db.define_table("task",
Field("title", "string", length=256, notnull=True, default=None),
Field("description", "text"),
Field("id_person_assigned", db.person, ondelete='NO ACTION'),
Field("id_person_responsible", db.person, ondelete='NO ACTION'),
Field("id_person_released", db.person, ondelete='NO ACTION'),
Field("date_due", "datetime"),
Field("date_nextcheck", "datetime")
)

db.define_table("task_category",
SQLField("id_category", db.category),
SQLField("id_task", db.task)
)

#Table Relations
#(remove fields you don't need from requires)

db.task.id_person_assigned.requires   = IS_IN_DB( db,
'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')
db.task.id_person_responsible.requires= IS_IN_DB( db,
'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')
db.task.id_person_released.requires   = IS_IN_DB( db,
'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')

task_category = db(
(db.category.id == db.task_category.id_category) | (db.task.id ==
db.task_category.id_task)
)



Re: [web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Lorin Rivers
Massimo,

That pegs my CPU for a bit and then errors:
  File 
"/Users/lrivers/Documents/CurrentProjects/SPTI/spowertech_webappserver1/gluon/sql.py",
 line 734, in __getitem__
return dict.__getitem__(self, key)
KeyError: 'MIN(data_table.ReqTime)'

Here's my code:
m=db4.data_table.ReqTime.min()
firsttime = db4(db4.data_table).select().first()[m]


On Nov 17, 2010, at 13:30 , mdipierro wrote:

> m=db.data_table.reqtime.min()
> value = db(db.date_table).select().first()[m]
> 
> On Nov 17, 11:43 am, Lorin Rivers  wrote:
>> executesql('select min(reqtime) from data_table;')
>> --
>> Lorin Rivers
>> Mosasaur: Killer Technical Marketing 
>> 
>> 512/203.3198 (m)

-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




Re: [web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Massimo Di Pierro
my mistake

m=db4.data_table.ReqTime.min()
firsttime = db4(db4.data_table).select(m).first()[m]

On Nov 17, 2010, at 1:44 PM, Lorin Rivers wrote:

> m=db4.data_table.ReqTime.min()
> firsttime = db4(db4.data_table).select().first()[m]



[web2py] Re: Beginner's Question

2010-11-17 Thread mdipierro
The problem is here

> db.task.id_person_released.requires   = IS_IN_DB( db,'person.initials', 
> '%(initials)s  |  %(name_first)s %(name_last)s')

and 'person.initials' shoud be 'person.id' for a reference field.

You also have a | instead of an &.

Anyway, here is a more compact notation that should work

#Table Definitions

db.define_table("person",
Field("initials",length=16, notnull=True,unique=True),
Field("name_last",length=128, notnull=True),
Field("name_first",length=128, notnull=False,default=''),
format='%(initials)s  |  %(name_first)s %(name_last)s'
)

db.define_table("category",
Field("name",length=128, notnull=True,unique=True),
format='%(name)s'
)

db.define_table("task",
Field("title", length=256, notnull=True),
Field("description", "text"),
Field("id_person_assigned", db.person, ondelete='NO ACTION'),
Field("id_person_responsible", db.person, ondelete='NO ACTION'),
Field("id_person_released", db.person, ondelete='NO ACTION'),
Field("date_due", "datetime"),
Field("date_nextcheck", "datetime"),
format='%(title)s'
)

db.define_table("task_category",
SQLField("id_category", db.category),
SQLField("id_task", db.task)
)

task_category =
db((db.category.id==db.task_category.id_category)&(db.task.id==db.task_category.id_task))

I would also replace

Field("initials",length=16, notnull=True,unique=True),

with

Field("initials",length=16, compute=lambda row: ''.join(x[0] for x
in (row.first_name+' '+row.last_name).split())),



On Nov 17, 1:22 pm, asklucas  wrote:
> Hello!
>
> I'm new to web development and my trying web2py because of DRY and,
> most importantly, Python.
>
> I created a model, however I can't insert records in the admin
> interface because of a constraints-error I don't understand.
>
> When trying to insert a record 
> here:http://127.0.0.1:8000/task/appadmin/insert/db/task
>
> I get the Error Snapshot:
> 
>     (
>         ('23000',
>         '[23000] [Microsoft][ODBC SQL Server Driver][SQL Server]
>         The INSERT statement conflicted with the FOREIGN KEY
> constraint "task_id_person_assigned__constraint".
>         The conflict occurred in database "taskdb", table
> "dbo.person", column \'id\'. (547) (SQLExecDirectW);
>         [01000] [Microsoft][ODBC SQL Server Driver][SQL Server]The
> statement has been terminated. (3621)'
>         )
>     )
>
> What I really want is to have dropdown fields in [task] for all three
> person-fields, where only persons from the list can be chosen or no
> one (a task could be created without yet assigning it to anybody).
>
> Additionally I'd like to have a field in [task] where I can choose 0
> to n categories.
>
> Thank you very much!
>
> Lucas.
>
> Model:
>
> 
> #    Table Definitions
>
> db.define_table("person",
>     Field("initials", "string", length=16, notnull=True, default=None,
> unique=True),
>     Field("name_last", "string", length=128, notnull=True,
> default=None),
>     Field("name_first", "string", length=128, notnull=False,
> default=None)
>     )
>
> db.define_table("category",
>     Field("name", "string", length=128, notnull=True, default=None,
> unique=True)
>     )
>
> db.define_table("task",
>     Field("title", "string", length=256, notnull=True, default=None),
>     Field("description", "text"),
>     Field("id_person_assigned", db.person, ondelete='NO ACTION'),
>     Field("id_person_responsible", db.person, ondelete='NO ACTION'),
>     Field("id_person_released", db.person, ondelete='NO ACTION'),
>     Field("date_due", "datetime"),
>     Field("date_nextcheck", "datetime")
>     )
>
> db.define_table("task_category",
>     SQLField("id_category", db.category),
>     SQLField("id_task", db.task)
>     )
>
> #    Table Relations
> #    (remove fields you don't need from requires)
>
> db.task.id_person_assigned.requires       = IS_IN_DB( db,
> 'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')
> db.task.id_person_responsible.requires    = IS_IN_DB( db,
> 'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')
> db.task.id_person_released.requires       = IS_IN_DB( db,
> 'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')
>
> task_category = db(
>     (db.category.id == db.task_category.id_category) | (db.task.id ==
> db.task_category.id_task)
>     )
> 


Re: [web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Lorin Rivers
I think this would make a good thing to have in the examples.

On Nov 17, 2010, at 13:45 , Massimo Di Pierro wrote:

> my mistake
> 
> m=db4.data_table.ReqTime.min()
> firsttime = db4(db4.data_table).select(m).first()[m]
> 
> On Nov 17, 2010, at 1:44 PM, Lorin Rivers wrote:
> 
>> m=db4.data_table.ReqTime.min()
>> firsttime = db4(db4.data_table).select().first()[m]
> 

-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




[web2py] How to setup plugin_wiki?

2010-11-17 Thread Dan
Hi, I just downloaded web2py and added the plugin_wiki plugin. But I
don't find any documentation on how to use this plugin. I saw the
video on vimeo but the plugin does not add a new node to the main
menu. If I'm calling the plugin in the url I'm getting an error: Not
authorized ACCESS DENIED.

Thanks for any help.


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
I use postgresql and local in postgres are : fr_CA.UTF-8

Could it be the reason of the problem?

Richard

On Wed, Nov 17, 2010 at 2:37 PM, mdipierro  wrote:

> BTW... why are you getting the traceback in french? If your python is
> localized, could this affect the meaning of . in sqlite?
>
> On Nov 17, 9:43 am, Richard Vézina 
> wrote:
> > Hello,
> >
> > I wonder if it is normal that I get ticket in that case :
> >
> > Model :
> >
> > Field('field1','decimal(4,2)'),
> >
> > If I insert in form generate with crud.create(db.table1) this value :
> > 123.123
> >
> > I get ticket :
> >
> > Error traceback
> >
> > 1.
> > 2.
> > 3.
> > 4.
> > 5.
> > 6.
> > 7.
> > 8.
> > 9.
> > 10.
> > 11.
> > 12.
> > 13.
> > 14.
> > 15.
> > 16.
> > 17.
> > 18.
> > 19.
> > 20.
> > 21.
> >
> > Traceback (most recent call last):
> >   File "/web2py/gluon/restricted.py", line 188, in restricted
> > exec ccode in environment
> >   File "/web2py/applications/app/controllers/test.py", line 552, in
> 
> >   File "/web2py/gluon/globals.py", line 96, in 
> > self._caller = lambda f: f()
> >   File "/web2py/gluon/tools.py", line 2270, in f
> > return action(*a, **b)
> >   File "/web2py/applications/app/controllers/test.py", line 372, in
> update
> > if form.accepts(request.vars, session):
> >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> > self.table._db(self.table.id == self.record.id).update(**fields)
> >   File "/web2py/gluon/sql.py", line 3484, in update
> > self._db._execute(query)
> >   File "/web2py/gluon/sql.py", line 1026, in 
> > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > DataError: ERREUR:  champ numérique en dehors des limites
> > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une
> valeur
> > absolue inférieure à 10^2.
> >
> > I thought that the validator will show up a error...
> >
> > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> > limit in the model???
> >
> > Regards.
> >
> > Richard
>


[web2py] Re: How to setup plugin_wiki?

2010-11-17 Thread mdipierro
http://www.web2py.com/book/default/chapter/13

On Nov 17, 2:03 pm, Dan  wrote:
> Hi, I just downloaded web2py and added the plugin_wiki plugin. But I
> don't find any documentation on how to use this plugin. I saw the
> video on vimeo but the plugin does not add a new node to the main
> menu. If I'm calling the plugin in the url I'm getting an error: Not
> authorized ACCESS DENIED.
>
> Thanks for any help.


Re: [web2py] Re: list:reference issue

2010-11-17 Thread Richard Vézina
Thanks

You are involved in a lot of dev... I understand the delay, no problem. It
is just a kind of reminder ;-)

Richard

On Wed, Nov 17, 2010 at 2:31 PM, mdipierro  wrote:

> will look into this asap.
>
> On Nov 17, 11:49 am, Richard Vézina 
> wrote:
> > Hello,
> >
> > The list:reference issue I discribed last week is still in trunk. I joint
> a
> > demo app with which it is possible to reproduce the issue.
> >
> > If the date validator is triggered and the id of the referenced record is
> > greater then or equal to 10 the app break completely if the corrected
> form
> > is submit and the digited id is not existing in table.
> >
> > For example :
> >
> > I select id 10, I submit, but I forgot to entered a date. I get the
> > validator in action, the id of my selected record is splitted into digit
> 1
> > and 0. 0 not existing in my table = app break including the appadmin
> > interface, so no correction of the problem possible except go in the
> > database changing the id selected.
> >
> > Thanks
> >
> > Richard
> >
> >  web2py.app.applistissue.w2p
> > 107KViewDownload


[web2py] Re: decimal validator by default or not

2010-11-17 Thread mdipierro
could be. Not sure what that means for decimal numbers.

On Nov 17, 2:07 pm, Richard Vézina 
wrote:
> I use postgresql and local in postgres are : fr_CA.UTF-8
>
> Could it be the reason of the problem?
>
> Richard
>
> On Wed, Nov 17, 2010 at 2:37 PM, mdipierro  wrote:
> > BTW... why are you getting the traceback in french? If your python is
> > localized, could this affect the meaning of . in sqlite?
>
> > On Nov 17, 9:43 am, Richard Vézina 
> > wrote:
> > > Hello,
>
> > > I wonder if it is normal that I get ticket in that case :
>
> > > Model :
>
> > > Field('field1','decimal(4,2)'),
>
> > > If I insert in form generate with crud.create(db.table1) this value :
> > > 123.123
>
> > > I get ticket :
>
> > > Error traceback
>
> > > 1.
> > > 2.
> > > 3.
> > > 4.
> > > 5.
> > > 6.
> > > 7.
> > > 8.
> > > 9.
> > > 10.
> > > 11.
> > > 12.
> > > 13.
> > > 14.
> > > 15.
> > > 16.
> > > 17.
> > > 18.
> > > 19.
> > > 20.
> > > 21.
>
> > > Traceback (most recent call last):
> > >   File "/web2py/gluon/restricted.py", line 188, in restricted
> > >     exec ccode in environment
> > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> > 
> > >   File "/web2py/gluon/globals.py", line 96, in 
> > >     self._caller = lambda f: f()
> > >   File "/web2py/gluon/tools.py", line 2270, in f
> > >     return action(*a, **b)
> > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> > update
> > >     if form.accepts(request.vars, session):
> > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> > >     self.table._db(self.table.id == self.record.id).update(**fields)
> > >   File "/web2py/gluon/sql.py", line 3484, in update
> > >     self._db._execute(query)
> > >   File "/web2py/gluon/sql.py", line 1026, in 
> > >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > DataError: ERREUR:  champ numérique en dehors des limites
> > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une
> > valeur
> > > absolue inférieure à 10^2.
>
> > > I thought that the validator will show up a error...
>
> > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> > > limit in the model???
>
> > > Regards.
>
> > > Richard
>
>


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
In the database table decimal are represented like this : 123.123

When I export data the "." is replaced by the comma, but I think that depend
of the local of the system or the local I specified in the pgadmin export
panel...

What the relation between the local of the database and the and the lenght
of the decimal defined in the model?

I far as I can see web2py return to the database the proper format it should
it only failed to detected the lenght of the entered value.

Maybe the local of the naviagator is involved??

I set chrome to french canada.

I will make a check in firefox if the problem is not coming from chrome.

Richard

On Wed, Nov 17, 2010 at 3:26 PM, mdipierro  wrote:

> could be. Not sure what that means for decimal numbers.
>
> On Nov 17, 2:07 pm, Richard Vézina 
> wrote:
> > I use postgresql and local in postgres are : fr_CA.UTF-8
> >
> > Could it be the reason of the problem?
> >
> > Richard
> >
> > On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
> wrote:
> > > BTW... why are you getting the traceback in french? If your python is
> > > localized, could this affect the meaning of . in sqlite?
> >
> > > On Nov 17, 9:43 am, Richard Vézina 
> > > wrote:
> > > > Hello,
> >
> > > > I wonder if it is normal that I get ticket in that case :
> >
> > > > Model :
> >
> > > > Field('field1','decimal(4,2)'),
> >
> > > > If I insert in form generate with crud.create(db.table1) this value :
> > > > 123.123
> >
> > > > I get ticket :
> >
> > > > Error traceback
> >
> > > > 1.
> > > > 2.
> > > > 3.
> > > > 4.
> > > > 5.
> > > > 6.
> > > > 7.
> > > > 8.
> > > > 9.
> > > > 10.
> > > > 11.
> > > > 12.
> > > > 13.
> > > > 14.
> > > > 15.
> > > > 16.
> > > > 17.
> > > > 18.
> > > > 19.
> > > > 20.
> > > > 21.
> >
> > > > Traceback (most recent call last):
> > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
> > > > exec ccode in environment
> > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> > > 
> > > >   File "/web2py/gluon/globals.py", line 96, in 
> > > > self._caller = lambda f: f()
> > > >   File "/web2py/gluon/tools.py", line 2270, in f
> > > > return action(*a, **b)
> > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> > > update
> > > > if form.accepts(request.vars, session):
> > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> > > > self.table._db(self.table.id == self.record.id).update(**fields)
> > > >   File "/web2py/gluon/sql.py", line 3484, in update
> > > > self._db._execute(query)
> > > >   File "/web2py/gluon/sql.py", line 1026, in 
> > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > > DataError: ERREUR:  champ numérique en dehors des limites
> > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
> une
> > > valeur
> > > > absolue inférieure à 10^2.
> >
> > > > I thought that the validator will show up a error...
> >
> > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> decimal
> > > > limit in the model???
> >
> > > > Regards.
> >
> > > > Richard
> >
> >
>


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
No change with nav set to en-us and with firefox.

Richard

On Wed, Nov 17, 2010 at 3:35 PM, Richard Vézina  wrote:

> In the database table decimal are represented like this : 123.123
>
> When I export data the "." is replaced by the comma, but I think that
> depend of the local of the system or the local I specified in the pgadmin
> export panel...
>
> What the relation between the local of the database and the and the lenght
> of the decimal defined in the model?
>
> I far as I can see web2py return to the database the proper format it
> should it only failed to detected the lenght of the entered value.
>
> Maybe the local of the naviagator is involved??
>
> I set chrome to french canada.
>
> I will make a check in firefox if the problem is not coming from chrome.
>
> Richard
>
>
> On Wed, Nov 17, 2010 at 3:26 PM, mdipierro wrote:
>
>> could be. Not sure what that means for decimal numbers.
>>
>> On Nov 17, 2:07 pm, Richard Vézina 
>> wrote:
>> > I use postgresql and local in postgres are : fr_CA.UTF-8
>> >
>> > Could it be the reason of the problem?
>> >
>> > Richard
>> >
>> > On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
>> wrote:
>> > > BTW... why are you getting the traceback in french? If your python is
>> > > localized, could this affect the meaning of . in sqlite?
>> >
>> > > On Nov 17, 9:43 am, Richard Vézina 
>> > > wrote:
>> > > > Hello,
>> >
>> > > > I wonder if it is normal that I get ticket in that case :
>> >
>> > > > Model :
>> >
>> > > > Field('field1','decimal(4,2)'),
>> >
>> > > > If I insert in form generate with crud.create(db.table1) this value
>> :
>> > > > 123.123
>> >
>> > > > I get ticket :
>> >
>> > > > Error traceback
>> >
>> > > > 1.
>> > > > 2.
>> > > > 3.
>> > > > 4.
>> > > > 5.
>> > > > 6.
>> > > > 7.
>> > > > 8.
>> > > > 9.
>> > > > 10.
>> > > > 11.
>> > > > 12.
>> > > > 13.
>> > > > 14.
>> > > > 15.
>> > > > 16.
>> > > > 17.
>> > > > 18.
>> > > > 19.
>> > > > 20.
>> > > > 21.
>> >
>> > > > Traceback (most recent call last):
>> > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
>> > > > exec ccode in environment
>> > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
>> > > 
>> > > >   File "/web2py/gluon/globals.py", line 96, in 
>> > > > self._caller = lambda f: f()
>> > > >   File "/web2py/gluon/tools.py", line 2270, in f
>> > > > return action(*a, **b)
>> > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
>> > > update
>> > > > if form.accepts(request.vars, session):
>> > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>> > > > self.table._db(self.table.id == self.record.id
>> ).update(**fields)
>> > > >   File "/web2py/gluon/sql.py", line 3484, in update
>> > > > self._db._execute(query)
>> > > >   File "/web2py/gluon/sql.py", line 1026, in 
>> > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
>> > > > DataError: ERREUR:  champ numérique en dehors des limites
>> > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
>> une
>> > > valeur
>> > > > absolue inférieure à 10^2.
>> >
>> > > > I thought that the validator will show up a error...
>> >
>> > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
>> decimal
>> > > > limit in the model???
>> >
>> > > > Regards.
>> >
>> > > > Richard
>> >
>> >
>>
>
>


[web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Niphlod
+1 for examples, it's quite unusable.

that is also accomplished with this query, only if not seeking other
values 

db4(db4.data_table).select(db4.data_table.reqtime, limitby=(0,1),
orderby=db4.data_table.reqtime)

Niphlod

On 17 Nov, 20:57, Lorin Rivers  wrote:
> I think this would make a good thing to have in the examples.
>
> On Nov 17, 2010, at 13:45 , Massimo Di Pierro wrote:
>
> > my mistake
>
> > m=db4.data_table.ReqTime.min()
> > firsttime = db4(db4.data_table).select(m).first()[m]
>
> > On Nov 17, 2010, at 1:44 PM, Lorin Rivers wrote:
>
> >> m=db4.data_table.ReqTime.min()
> >> firsttime = db4(db4.data_table).select().first()[m]
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


[web2py] Re: crud operations for joins?

2010-11-17 Thread villas
Hi Carlos

In the relational model, you would separate it.  The idea is that you
group your data into logical datasets (tables),  then you join it all
together by using foreign keys. The idea is that data only ever has to
be entered once and there is little wasted space.

These days we also have the new non-sql DBs which have a different
logic.  With that model you try your best to put as much data as
possible into large tables.  It's also OK to have redundancy of data
provided the queries are faster.  Under that system,  we exchange the
elegance of the relational model for faster query speed.  If you
really do think that 1:1 is the way to go,  you can consider having
one big table containing all the fields you'll ever  want.   OK,
there's some wasted space,  but modern computers don't usually have a
problem and you can run it on Google App Engine too.

It's horses for courses,  but generally speaking,  enterprise software
is ausually based on the relational model.  Big global websites where
speed is paramount are based on non-sql.

-D

On Nov 17, 6:48 pm, Carlos  wrote:
> Thanks villas.
>
> In the example I provide (entity), specifically for web2py and
> relational databases, does it actually make sense to separate 'entity'
> to its own table and use 1:1 relationships from tables A/B/C, or is it
> recommended to just embed the 'entity' fields into tables A/B/C
> (without any references)?.
>
> What are the pros and cons of such alternatives?.
>
> The pro I see about using an independent 'entity' table is
> maintenance, but the con might be the access / manipulation of this
> extra reference ...?
>
> Thanks again!,
>
>    Carlos
>
> On Nov 17, 11:11 am, villas  wrote:
>
> > Hi Carlos,
>
> > See what you mean.  We don't usually use 1:1 relationships,  but 1 to
> > many.
>
> > e.g. From the book:
>
> > db.define_table('person',
> >     Field('name'),
> >     format='%(name)s')
>
> > db.define_table('dog',
> >     Field('name'),
> >     Field('owner', db.person),
> >     format='%(name)s')
>
> > Of course an owner might only have one dog to start with, but then
> > acquire others later, so this model serves for any number of dogs,
> > incl. zero.
>
> > The same owner might also decide to keep a cat and (assuming he needs
> > to keep different data on that) he would simply define a 'cat' table
> > later with a similar realtionship.
>
> > I suppose if you insisted on making it 1:1,  I might simply suggest
> > making the dog.owner field into a unique index which would prevent
> > your adding more than 1.
>
> > -D
>
> > On Nov 17, 3:44 pm, Carlos  wrote:
>
> > > Thanks villas and Ivan.
>
> > > When I say joins I mean 1:1 relationships (or "linked tables"?), where
> > > each record in tables A/B/C reference one (and only one) unique
> > > 'entity' record, kind of like an 'extension' of such tables, but with
> > > data centralized in the 'entity' table (which would allow better
> > > maintenance).
>
> > > I know I have the alternative of embedding all of the 'entity' fields
> > > directly into tables A/B/C (instead of having a separate centralized
> > > 'entity' table, with 1:1 relationships).
>
> > > I was wondering what would be the best approach for this in the
> > > relational world?.
>
> > > And if a separate 'entity' table is the best option, then I guess I
> > > can use the following slice to create (and update?) records with
> > > linked tables:
>
> > >http://www.web2pyslices.com/main/slices/take_slice/102
>
> > > Thanks for your recommendations.
>
> > > p.s. I have certainly already read the entire book :-)
>
> > >    Carlos
>
> > > On Nov 17, 9:06 am, Ivan Matveev  wrote:
>
> > > > >>  I have a 'central' table in my design called 'entity'
> > > > >> which contains lots of data (including names, company, emails, 
> > > > >> phones,
> > > > >> address, etc.) and I want many other tables to point to ONE entity
> > > > >> instance, i.e. 'entity' as an _extension_ of records in many 
> > > > >> different
> > > > >> tables.
>
> > > > When you say 'joined tables' do you mean
> > > > SELECT tabl1.some_col, tabl2.other_col FROM tabl1 LEFT JOIN tabl2 ON 
> > > > .
> > > > or something else?
>
> > > > I don't know a web2py component that can be used to edit a result of a
> > > > joined select.
>
> > > > If your 'entity' table includes all fields you want to present to a
> > > > user you can avoid joins by use of references. I don't use db
> > > > references myself. I think usage can look like this:
>
> > > > db.define_table('names', Field('name', 'string'))
> > > > db.define_table('companies', Field('company', 'string'))
>
> > > > db.define_table('entity',
> > > >     Field('name', db.names.name),
> > > >     Field('company', db.companies.company))
>
> > > > also you can alter the way a field is represented with .represent and
> > > > .requires methods
>
> > > > The details are in documentation on Database Abstraction 
> > > > Layer(DAL)http://www.web2py.com/book/default/chapter/06
>
> > > > SQLFORM allows to edi

Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
The french in the ticket should comes from the ubuntu locales setting, I see
no python packages related to the local...

Richard

On Wed, Nov 17, 2010 at 3:43 PM, Richard Vézina  wrote:

> No change with nav set to en-us and with firefox.
>
> Richard
>
>
> On Wed, Nov 17, 2010 at 3:35 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> In the database table decimal are represented like this : 123.123
>>
>> When I export data the "." is replaced by the comma, but I think that
>> depend of the local of the system or the local I specified in the pgadmin
>> export panel...
>>
>> What the relation between the local of the database and the and the lenght
>> of the decimal defined in the model?
>>
>> I far as I can see web2py return to the database the proper format it
>> should it only failed to detected the lenght of the entered value.
>>
>> Maybe the local of the naviagator is involved??
>>
>> I set chrome to french canada.
>>
>> I will make a check in firefox if the problem is not coming from chrome.
>>
>> Richard
>>
>>
>> On Wed, Nov 17, 2010 at 3:26 PM, mdipierro wrote:
>>
>>> could be. Not sure what that means for decimal numbers.
>>>
>>> On Nov 17, 2:07 pm, Richard Vézina 
>>> wrote:
>>> > I use postgresql and local in postgres are : fr_CA.UTF-8
>>> >
>>> > Could it be the reason of the problem?
>>> >
>>> > Richard
>>> >
>>> > On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
>>> wrote:
>>> > > BTW... why are you getting the traceback in french? If your python is
>>> > > localized, could this affect the meaning of . in sqlite?
>>> >
>>> > > On Nov 17, 9:43 am, Richard Vézina 
>>> > > wrote:
>>> > > > Hello,
>>> >
>>> > > > I wonder if it is normal that I get ticket in that case :
>>> >
>>> > > > Model :
>>> >
>>> > > > Field('field1','decimal(4,2)'),
>>> >
>>> > > > If I insert in form generate with crud.create(db.table1) this value
>>> :
>>> > > > 123.123
>>> >
>>> > > > I get ticket :
>>> >
>>> > > > Error traceback
>>> >
>>> > > > 1.
>>> > > > 2.
>>> > > > 3.
>>> > > > 4.
>>> > > > 5.
>>> > > > 6.
>>> > > > 7.
>>> > > > 8.
>>> > > > 9.
>>> > > > 10.
>>> > > > 11.
>>> > > > 12.
>>> > > > 13.
>>> > > > 14.
>>> > > > 15.
>>> > > > 16.
>>> > > > 17.
>>> > > > 18.
>>> > > > 19.
>>> > > > 20.
>>> > > > 21.
>>> >
>>> > > > Traceback (most recent call last):
>>> > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
>>> > > > exec ccode in environment
>>> > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
>>> > > 
>>> > > >   File "/web2py/gluon/globals.py", line 96, in 
>>> > > > self._caller = lambda f: f()
>>> > > >   File "/web2py/gluon/tools.py", line 2270, in f
>>> > > > return action(*a, **b)
>>> > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
>>> > > update
>>> > > > if form.accepts(request.vars, session):
>>> > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>>> > > > self.table._db(self.table.id == self.record.id
>>> ).update(**fields)
>>> > > >   File "/web2py/gluon/sql.py", line 3484, in update
>>> > > > self._db._execute(query)
>>> > > >   File "/web2py/gluon/sql.py", line 1026, in 
>>> > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
>>> > > > DataError: ERREUR:  champ numérique en dehors des limites
>>> > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
>>> une
>>> > > valeur
>>> > > > absolue inférieure à 10^2.
>>> >
>>> > > > I thought that the validator will show up a error...
>>> >
>>> > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
>>> decimal
>>> > > > limit in the model???
>>> >
>>> > > > Regards.
>>> >
>>> > > > Richard
>>> >
>>> >
>>>
>>
>>
>


Re: [web2py] Re: crud operations for joins?

2010-11-17 Thread Ivan Matveev
> In the example I provide (entity), specifically for web2py and
> relational databases, does it actually make sense to separate 'entity'
> to its own table and use 1:1 relationships from tables A/B/C, or is it
> recommended to just embed the 'entity' fields into tables A/B/C
> (without any references)?.
>
> What are the pros and cons of such alternatives?.
>
> The pro I see about using an independent 'entity' table is
> maintenance, but the con might be the access / manipulation of this
> extra reference ...?

For general info on relational database you can google for database
normalization.

On the practical side sometimes 1:1 relations are useful. For example
if we want to store 'dressed person' object which contains
person_name, current_jacket. Its convenient to store in 2 tables
db.define_table('jackets', Field('jacket', 'string'))
db.define_table('dressed_person', Field('person_name','string'),
Field(current_jacket', db.jackets.id)

So when a person changes a jacket we don't loose info on the jacket
he was wearing in case he wants to put old jacket on again.

On web2py side its much easier to design your app with  1 table= 1
page approach.


[web2py] Re: experts4solutions badges

2010-11-17 Thread Branko Vukelic
Here are some badges for experts4solutions members. The 'button'
version comes in two flavors: for dark background ('_d') and for light
background ('_l').

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group
<><><><>

Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Jonathan Lundell
On Nov 17, 2010, at 12:26 PM, mdipierro wrote:
> 
> could be. Not sure what that means for decimal numbers.

FWIW, I took a look at the Python decimal module, and it requires '.' as the 
decimal separator. So any conversion is going to have to happen before Decimal 
gets the string.


> 
> On Nov 17, 2:07 pm, Richard Vézina 
> wrote:
>> I use postgresql and local in postgres are : fr_CA.UTF-8
>> 
>> Could it be the reason of the problem?
>> 
>> Richard
>> 
>> On Wed, Nov 17, 2010 at 2:37 PM, mdipierro  wrote:
>>> BTW... why are you getting the traceback in french? If your python is
>>> localized, could this affect the meaning of . in sqlite?
>> 
>>> On Nov 17, 9:43 am, Richard Vézina 
>>> wrote:
 Hello,
>> 
 I wonder if it is normal that I get ticket in that case :
>> 
 Model :
>> 
 Field('field1','decimal(4,2)'),
>> 
 If I insert in form generate with crud.create(db.table1) this value :
 123.123
>> 
 I get ticket :
>> 
 Error traceback
>> 
 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.
 14.
 15.
 16.
 17.
 18.
 19.
 20.
 21.
>> 
 Traceback (most recent call last):
   File "/web2py/gluon/restricted.py", line 188, in restricted
 exec ccode in environment
   File "/web2py/applications/app/controllers/test.py", line 552, in
>>> 
   File "/web2py/gluon/globals.py", line 96, in 
 self._caller = lambda f: f()
   File "/web2py/gluon/tools.py", line 2270, in f
 return action(*a, **b)
   File "/web2py/applications/app/controllers/test.py", line 372, in
>>> update
 if form.accepts(request.vars, session):
   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
 self.table._db(self.table.id == self.record.id).update(**fields)
   File "/web2py/gluon/sql.py", line 3484, in update
 self._db._execute(query)
   File "/web2py/gluon/sql.py", line 1026, in 
 self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
 DataError: ERREUR:  champ numérique en dehors des limites
 DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une
>>> valeur
 absolue inférieure à 10^2.
>> 
 I thought that the validator will show up a error...
>> 
 Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
 limit in the model???
>> 
 Regards.
>> 
 Richard
>> 
>> 




[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread Anthony
You should encourage every expert to provide as much bio detail as
possible (some have none at all), or at least link to a personal or
business website -- potential customers will want some details before
making contact. Also, everyone should have a location listed --
"undisclosed location" makes it sound like they're in hiding or
something.

Anthony

On Nov 17, 11:35 am, Branko Vukelic  wrote:
> On Wed, Nov 17, 2010 at 4:22 PM, mdipierro  wrote:
> > You can sign up. I will approve those people who I recognize as
> > contributors and/or have proven skills by deploying a web2py
> > application. After we reach ~50 people new members will have to be
> > endorsed by 5 existing members to be approved.
>
> Aaaand, we'll have to do something about that list of experts. Maybe a
> searchable paged list? Anyway, it's getting longer and longer.
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
Just to be sure... Data are entered in english... Mean if we entered exactly
this in the form fiel : 123.123

On Wed, Nov 17, 2010 at 3:59 PM, Jonathan Lundell wrote:

> On Nov 17, 2010, at 12:26 PM, mdipierro wrote:
> >
> > could be. Not sure what that means for decimal numbers.
>
> FWIW, I took a look at the Python decimal module, and it requires '.' as
> the decimal separator. So any conversion is going to have to happen before
> Decimal gets the string.
>
>
> >
> > On Nov 17, 2:07 pm, Richard Vézina 
> > wrote:
> >> I use postgresql and local in postgres are : fr_CA.UTF-8
> >>
> >> Could it be the reason of the problem?
> >>
> >> Richard
> >>
> >> On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
> wrote:
> >>> BTW... why are you getting the traceback in french? If your python is
> >>> localized, could this affect the meaning of . in sqlite?
> >>
> >>> On Nov 17, 9:43 am, Richard Vézina 
> >>> wrote:
>  Hello,
> >>
>  I wonder if it is normal that I get ticket in that case :
> >>
>  Model :
> >>
>  Field('field1','decimal(4,2)'),
> >>
>  If I insert in form generate with crud.create(db.table1) this value :
>  123.123
> >>
>  I get ticket :
> >>
>  Error traceback
> >>
>  1.
>  2.
>  3.
>  4.
>  5.
>  6.
>  7.
>  8.
>  9.
>  10.
>  11.
>  12.
>  13.
>  14.
>  15.
>  16.
>  17.
>  18.
>  19.
>  20.
>  21.
> >>
>  Traceback (most recent call last):
>    File "/web2py/gluon/restricted.py", line 188, in restricted
>  exec ccode in environment
>    File "/web2py/applications/app/controllers/test.py", line 552, in
> >>> 
>    File "/web2py/gluon/globals.py", line 96, in 
>  self._caller = lambda f: f()
>    File "/web2py/gluon/tools.py", line 2270, in f
>  return action(*a, **b)
>    File "/web2py/applications/app/controllers/test.py", line 372, in
> >>> update
>  if form.accepts(request.vars, session):
>    File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>  self.table._db(self.table.id == self.record.id).update(**fields)
>    File "/web2py/gluon/sql.py", line 3484, in update
>  self._db._execute(query)
>    File "/web2py/gluon/sql.py", line 1026, in 
>  self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
>  DataError: ERREUR:  champ numérique en dehors des limites
>  DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
> une
> >>> valeur
>  absolue inférieure à 10^2.
> >>
>  I thought that the validator will show up a error...
> >>
>  Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> decimal
>  limit in the model???
> >>
>  Regards.
> >>
>  Richard
> >>
> >>
>
>
>


[web2py] plugin_wiki won't set active flag in response.menu?

2010-11-17 Thread Dan
Just tried to build my onw menu based on the pages from plugin_wiki
but every active flag in response.menu is set to false. Is there any
onther way to determine if a wiki page is active?


[web2py] Re: plugin_wiki won't set active flag in response.menu?

2010-11-17 Thread mdipierro
Plugin wiki is not very smart. That needs to be improved.

On Nov 17, 3:12 pm, Dan  wrote:
> Just tried to build my onw menu based on the pages from plugin_wiki
> but every active flag in response.menu is set to false. Is there any
> onther way to determine if a wiki page is active?


[web2py] Re: How to setup plugin_wiki?

2010-11-17 Thread Dan
Thank you very much. Everything works fine if you use the simple way
to create an new application. In the beginning I was using the new
wizard and many things went wrong. E.g. everytime I was using the
registration forumular the system adds 100 random users + mine.

On 17 Nov., 21:07, mdipierro  wrote:
> http://www.web2py.com/book/default/chapter/13
>
> On Nov 17, 2:03 pm, Dan  wrote:
>
> > Hi, I just downloaded web2py and added the plugin_wiki plugin. But I
> > don't find any documentation on how to use this plugin. I saw the
> > video on vimeo but the plugin does not add a new node to the main
> > menu. If I'm calling the plugin in the url I'm getting an error: Not
> > authorized ACCESS DENIED.
>
> > Thanks for any help.
>
>


[web2py] verification login

2010-11-17 Thread mattynoce
hi, i hope this is an easy question, but i didn't find answers
elsewhere in the forum.

here's what i'm looking to do:

1) a parent registers with the site
2) the parent registers her child using just an email address
3) the child receives the verification email, and clicks on the link
4) the child then finishes the rest of the registration

the part i'm having trouble with is the transition from (3) to (4). in
(2) i was able to do a custom form to create the user and populate the
registration_key field, no problem. but what i would like to do is
have clicking on the verification link actually log in the user, and
then use updates to set the rest of the variables.

this isn't a security risk because it's just registration and there's
no data about the child in the system. basically, i want the child to
be logged in BEFORE having to set a password, then change it inside.
is there a command i can use that will log a user in, or a way to set
verification to automatically log in a user?

thanks,

matt


[web2py] Upgrade problem

2010-11-17 Thread Kenneth Lundström

I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.

I´m running Linux, Apache and mod_wsgi. Is this too an file permission 
problem. I still can´t create a new application with admin. Don´t know 
where to start looking for the problem.



Kenneth


Version
web2py™ Version 1.89.1 (2010-11-12 15:14:36)
Python Python 2.6.5: /usr/bin/python
Traceback

Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py", 
line 1146, in 

File "/data/domains/web2py/gluon/globals.py", line 96, in 
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py", 
line 200, in upgrade_web2py

(success, error) = upgrade(request)
File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
file.close()
UnboundLocalError: local variable 'file' referenced before assignment

Error snapshot help Detailed traceback description

(local variable 'file' referenced 
before assignment)


[web2py] Re:

2010-11-17 Thread villas
On Nov 17, 3:12 pm, Napoleon Moreno  wrote:
> I found the answer in the book , like is usual

Great news Napoleon!  Sorry I didn't see your post until after I'd
replied  :)



[web2py] Re: many to many inline form

2010-11-17 Thread Joe Wakefield
I'm still learning widget stuff, and while I can design a many-to-many
widget, I am having trouble visualizing how to produce one with extra
fields and buttons for adding/removing. I might strike an epiphany,
but I'll likely just wait for you to make something available.

On Nov 12, 11:27 am, mdipierro  wrote:
> We do not have a widget for that but it is time to make one. It is not
> difficult.
> If I have time I will do this over the week-end. Other users may have
> already something working.
>
> On Nov 12, 10:17 am, Joe Wakefield  wrote:
>
> > So I'm trying to migrate an old rails app that broke a while back, and
> > I came across a rather difficult situation. I boiled the problem down
> > to this simplified mockup:http://yfrog.com/ghbeanjarsp
>
> > The real app has nothing to do with jelly beans, but this is the issue
> > at hand. Basically there are tables joined in a many to many
> > relationship, with an extra column for amount (because no bean is
> > unique). Creating/updating jars must be done inline with the rest of
> > the jar's form.
>
> > I was reading stuff about custom widgets, and that seemed a likely
> > direction. However, I'm hoping for a more direct suggestion on how you
> > guys would achieve this.
>
>


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
Ok,

I think I wrongly define the IS_DECIMAL_IN_RANGE

I set it to (0,99.99)

And now the validators works.

Still wondering if IS_DECIMAL_IN_RANGE as to be explicitly define since the
decimal(4,2) were already available

Richard

On Wed, Nov 17, 2010 at 4:06 PM, Richard Vézina  wrote:

> Just to be sure... Data are entered in english... Mean if we entered
> exactly this in the form fiel : 123.123
>
>
> On Wed, Nov 17, 2010 at 3:59 PM, Jonathan Lundell wrote:
>
>> On Nov 17, 2010, at 12:26 PM, mdipierro wrote:
>> >
>> > could be. Not sure what that means for decimal numbers.
>>
>> FWIW, I took a look at the Python decimal module, and it requires '.' as
>> the decimal separator. So any conversion is going to have to happen before
>> Decimal gets the string.
>>
>>
>> >
>> > On Nov 17, 2:07 pm, Richard Vézina 
>> > wrote:
>> >> I use postgresql and local in postgres are : fr_CA.UTF-8
>> >>
>> >> Could it be the reason of the problem?
>> >>
>> >> Richard
>> >>
>> >> On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
>> wrote:
>> >>> BTW... why are you getting the traceback in french? If your python is
>> >>> localized, could this affect the meaning of . in sqlite?
>> >>
>> >>> On Nov 17, 9:43 am, Richard Vézina 
>> >>> wrote:
>>  Hello,
>> >>
>>  I wonder if it is normal that I get ticket in that case :
>> >>
>>  Model :
>> >>
>>  Field('field1','decimal(4,2)'),
>> >>
>>  If I insert in form generate with crud.create(db.table1) this value :
>>  123.123
>> >>
>>  I get ticket :
>> >>
>>  Error traceback
>> >>
>>  1.
>>  2.
>>  3.
>>  4.
>>  5.
>>  6.
>>  7.
>>  8.
>>  9.
>>  10.
>>  11.
>>  12.
>>  13.
>>  14.
>>  15.
>>  16.
>>  17.
>>  18.
>>  19.
>>  20.
>>  21.
>> >>
>>  Traceback (most recent call last):
>>    File "/web2py/gluon/restricted.py", line 188, in restricted
>>  exec ccode in environment
>>    File "/web2py/applications/app/controllers/test.py", line 552, in
>> >>> 
>>    File "/web2py/gluon/globals.py", line 96, in 
>>  self._caller = lambda f: f()
>>    File "/web2py/gluon/tools.py", line 2270, in f
>>  return action(*a, **b)
>>    File "/web2py/applications/app/controllers/test.py", line 372, in
>> >>> update
>>  if form.accepts(request.vars, session):
>>    File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>>  self.table._db(self.table.id == self.record.id).update(**fields)
>>    File "/web2py/gluon/sql.py", line 3484, in update
>>  self._db._execute(query)
>>    File "/web2py/gluon/sql.py", line 1026, in 
>>  self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
>>  DataError: ERREUR:  champ numérique en dehors des limites
>>  DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
>> une
>> >>> valeur
>>  absolue inférieure à 10^2.
>> >>
>>  I thought that the validator will show up a error...
>> >>
>>  Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
>> decimal
>>  limit in the model???
>> >>
>>  Regards.
>> >>
>>  Richard
>> >>
>> >>
>>
>>
>>
>


[web2py] Re: decimal validator by default or not

2010-11-17 Thread mdipierro
4,2 have to do with precision, not range.

On Nov 17, 4:18 pm, Richard Vézina 
wrote:
> Ok,
>
> I think I wrongly define the IS_DECIMAL_IN_RANGE
>
> I set it to (0,99.99)
>
> And now the validators works.
>
> Still wondering if IS_DECIMAL_IN_RANGE as to be explicitly define since the
> decimal(4,2) were already available
>
> Richard
>
> On Wed, Nov 17, 2010 at 4:06 PM, Richard Vézina 
> > wrote:
> > Just to be sure... Data are entered in english... Mean if we entered
> > exactly this in the form fiel : 123.123
>
> > On Wed, Nov 17, 2010 at 3:59 PM, Jonathan Lundell wrote:
>
> >> On Nov 17, 2010, at 12:26 PM, mdipierro wrote:
>
> >> > could be. Not sure what that means for decimal numbers.
>
> >> FWIW, I took a look at the Python decimal module, and it requires '.' as
> >> the decimal separator. So any conversion is going to have to happen before
> >> Decimal gets the string.
>
> >> > On Nov 17, 2:07 pm, Richard Vézina 
> >> > wrote:
> >> >> I use postgresql and local in postgres are : fr_CA.UTF-8
>
> >> >> Could it be the reason of the problem?
>
> >> >> Richard
>
> >> >> On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
> >> wrote:
> >> >>> BTW... why are you getting the traceback in french? If your python is
> >> >>> localized, could this affect the meaning of . in sqlite?
>
> >> >>> On Nov 17, 9:43 am, Richard Vézina 
> >> >>> wrote:
> >>  Hello,
>
> >>  I wonder if it is normal that I get ticket in that case :
>
> >>  Model :
>
> >>  Field('field1','decimal(4,2)'),
>
> >>  If I insert in form generate with crud.create(db.table1) this value :
> >>  123.123
>
> >>  I get ticket :
>
> >>  Error traceback
>
> >>  1.
> >>  2.
> >>  3.
> >>  4.
> >>  5.
> >>  6.
> >>  7.
> >>  8.
> >>  9.
> >>  10.
> >>  11.
> >>  12.
> >>  13.
> >>  14.
> >>  15.
> >>  16.
> >>  17.
> >>  18.
> >>  19.
> >>  20.
> >>  21.
>
> >>  Traceback (most recent call last):
> >>    File "/web2py/gluon/restricted.py", line 188, in restricted
> >>      exec ccode in environment
> >>    File "/web2py/applications/app/controllers/test.py", line 552, in
> >> >>> 
> >>    File "/web2py/gluon/globals.py", line 96, in 
> >>      self._caller = lambda f: f()
> >>    File "/web2py/gluon/tools.py", line 2270, in f
> >>      return action(*a, **b)
> >>    File "/web2py/applications/app/controllers/test.py", line 372, in
> >> >>> update
> >>      if form.accepts(request.vars, session):
> >>    File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> >>      self.table._db(self.table.id == self.record.id).update(**fields)
> >>    File "/web2py/gluon/sql.py", line 3484, in update
> >>      self._db._execute(query)
> >>    File "/web2py/gluon/sql.py", line 1026, in 
> >>      self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> >>  DataError: ERREUR:  champ numérique en dehors des limites
> >>  DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
> >> une
> >> >>> valeur
> >>  absolue inférieure à 10^2.
>
> >>  I thought that the validator will show up a error...
>
> >>  Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> >> decimal
> >>  limit in the model???
>
> >>  Regards.
>
> >>  Richard
>
>


[web2py] Re: Upgrade problem

2010-11-17 Thread mdipierro
hmmm. I can make the error go away but this is a path issue

On Nov 17, 3:31 pm, Kenneth Lundström 
wrote:
> I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.
>
> I m running Linux, Apache and mod_wsgi. Is this too an file permission
> problem. I still can t create a new application with admin. Don t know
> where to start looking for the problem.
>
> Kenneth
>
> Version
> web2py Version 1.89.1 (2010-11-12 15:14:36)
> Python Python 2.6.5: /usr/bin/python
> Traceback
>
> Traceback (most recent call last):
> File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
> exec ccode in environment
> File "/data/domains/web2py/applications/admin/controllers/default.py",
> line 1146, in 
> File "/data/domains/web2py/gluon/globals.py", line 96, in 
> self._caller = lambda f: f()
> File "/data/domains/web2py/applications/admin/controllers/default.py",
> line 200, in upgrade_web2py
> (success, error) = upgrade(request)
> File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
> file.close()
> UnboundLocalError: local variable 'file' referenced before assignment
>
> Error snapshot help Detailed traceback description
>
> (local variable 'file' referenced
> before assignment)


[web2py] Re: import csv automatic

2010-11-17 Thread Aurigadl
#This was my solution.

import os

db.define_table('sgd_pa_cont_continente',
Field('cont_nombre',writable=False, required=True, notnull=True))

appfolder = os.path.normpath(request.folder)
fileCsv   = os.path.join(appfolder, 'static','continente.csv')

db.import_from_csv_file(open(fileCsv, 'rb'))

Thanks for the help




[web2py] Error: Edit about end license

2010-11-17 Thread Vinicius Vollrath
Hi,

Environment
web2py™ Version 1.89.3 (2010-11-16 13:53:22)
Python Python 2.5.5: /usr/bin/python2.5

Traceback (most recent call last):
  File "/home/vinicius/www/plocme/gluon/restricted.py", line 188, in
restricted
exec ccode in environment
  File
"/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
1148, in 
  File "/home/vinicius/www/plocme/gluon/globals.py", line 96, in 
self._caller = lambda f: f()
  File
"/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
437, in edit
request.args[2] + '.py')
IndexError: list index out of range

ERROR SNAPSHOT
(list index out of range)
-- 
Att,
Vinicius Vollrath


[web2py] web2py and distributed computing

2010-11-17 Thread VP
I am wondering if it is feasible and even easy to incorporate
something like RPyC into web2py.   Ideally, I would like to have an
app calling a web2py app located in a different server without too
much hassle (web2py taking care of the technical details).

Can we have this feature in web2py?  :-)


[web2py] Re: Error: Edit about end license

2010-11-17 Thread mdipierro
I cannot reproduce this. Which version?

On Nov 17, 3:32 pm, Vinicius Vollrath 
wrote:
> Hi,
>
> Environment
> web2py™ Version 1.89.3 (2010-11-16 13:53:22)
> Python Python 2.5.5: /usr/bin/python2.5
>
> Traceback (most recent call last):
>   File "/home/vinicius/www/plocme/gluon/restricted.py", line 188, in
> restricted
>     exec ccode in environment
>   File
> "/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
> 1148, in 
>   File "/home/vinicius/www/plocme/gluon/globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File
> "/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
> 437, in edit
>     request.args[2] + '.py')
> IndexError: list index out of range
>
> ERROR SNAPSHOT
> (list index out of range)
> --
> Att,
> Vinicius Vollrath


[web2py] Re: web2py and distributed computing

2010-11-17 Thread mdipierro
You can import rpyc and use it already. Anyway, I am going to look
more into this.
Do you have something specific in mind?

On Nov 17, 5:12 pm, VP  wrote:
> I am wondering if it is feasible and even easy to incorporate
> something like RPyC into web2py.   Ideally, I would like to have an
> app calling a web2py app located in a different server without too
> much hassle (web2py taking care of the technical details).
>
> Can we have this feature in web2py?  :-)


[web2py] Unable to detect your browser

2010-11-17 Thread greenpoise
Ok, I must admit, I am one of those with a weird setup. I dont have
firefox, seamonkey, IExplorer. I just happen to have Chromium and
Opera as my two browsers. When I try to load web2py I get this error:


Traceback (most recent call last):
  File "web2py.py", line 20, in 
import gluon.widget
  File "/home/danel/Applications/web2py/gluon/widget.py", line 85
print 'warning: unable to detect your browser'


Thanks


[web2py] Re: Unable to detect your browser

2010-11-17 Thread mdipierro
you should set the environment variable BROWSER

http://docs.python.org/library/webbrowser.html

On Nov 17, 5:31 pm, greenpoise  wrote:
> Ok, I must admit, I am one of those with a weird setup. I dont have
> firefox, seamonkey, IExplorer. I just happen to have Chromium and
> Opera as my two browsers. When I try to load web2py I get this error:
>
> Traceback (most recent call last):
>   File "web2py.py", line 20, in 
>     import gluon.widget
>   File "/home/danel/Applications/web2py/gluon/widget.py", line 85
>     print 'warning: unable to detect your browser'
>
> Thanks


[web2py] Re: Error: Edit about end license

2010-11-17 Thread Vollrath
version 1.89.3 (2010-11-16 13:53:22)
I download the trunk (for developers) in https://web2py.googlecode.com/hg/

[ ]'s
Vinicius

On Nov 17, 9:15 pm, mdipierro  wrote:
> Eu não posso reproduzir isso.Qual a versão?
>
> Em 17 de novembro, 03:32, Vinicius Vollrath  terradigital.com.br>escreveu:


[web2py] endswith patch in trunk exception message incorrect

2010-11-17 Thread ron_m
def endswith(self, value):
   if self.type in ('string', 'text'):
   return Query(self, ' LIKE ', '%%%s' % value)
   else:
   raise RuntimeError, "startswith used with incompatible
field type"

The last line should be

   raise RuntimeError, "endswith used with incompatible field
type"


Re: [web2py] ajax push

2010-11-17 Thread Phyo Arkar
Very cool framework .

But how web2py gonna work with as it have no serverside support for python ?


We may be have to run 2 servers 1 for web2py and just 1 alone for Pushes ..

Anyone have used it in real applications?

On Tue, Nov 16, 2010 at 3:54 AM, Michele Comitini <
michele.comit...@gmail.com> wrote:

> Does anyone use this with web2py?
>
> http://www.ape-project.org/ajax-push.html
>
> seems interesting!
>
> mic
>


[web2py] Re: Error: Edit about end license

2010-11-17 Thread mdipierro
using windows?

On Nov 17, 7:06 pm, Vollrath  wrote:
> version 1.89.3 (2010-11-16 13:53:22)
> I download the trunk (for developers) inhttps://web2py.googlecode.com/hg/
>
> [ ]'s
> Vinicius
>
> On Nov 17, 9:15 pm, mdipierro  wrote:
>
> > Eu não posso reproduzir isso.Qual a versão?
>
> > Em 17 de novembro, 03:32, Vinicius Vollrath  > terradigital.com.br>escreveu:
>
>


[web2py] Re: endswith patch in trunk exception message incorrect

2010-11-17 Thread mdipierro
fixed in trunk.

On Nov 17, 7:11 pm, ron_m  wrote:
>     def endswith(self, value):
>        if self.type in ('string', 'text'):
>            return Query(self, ' LIKE ', '%%%s' % value)
>        else:
>            raise RuntimeError, "startswith used with incompatible
> field type"
>
> The last line should be
>
>            raise RuntimeError, "endswith used with incompatible field
> type"


[web2py] Re: Error: Edit about end license

2010-11-17 Thread Vollrath
No, Ubuntu 10.04.

On Nov 17, 11:20 pm, mdipierro  wrote:
> using windows?
>
> On Nov 17, 7:06 pm, Vollrath  wrote:


  1   2   >