[web2py] db field date time compare validation

2011-04-22 Thread 黄祥
hi, is it possible to compare db field datetime during form validation? e.g. db.define_table('duration', Field('from', 'datetime', requires = IS_DATE() ), Field('to', 'datetime',

[web2py] Variables in javascript function.

2011-04-22 Thread annet
In web2py_ajax.html I have the following function: function details(url) { detailswindow=window.open(url,'details','toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=792,height=696'); if (window.focus) detailswindow.focus(); return false; } ... which

[web2py] Re: [w2py-dev] Re: Problems related to keeping applications in seperate folder and not in web2py installation.

2011-04-22 Thread Arun K.Rajeevan
I use trunk (every day updates)

[web2py] Re: Variables in javascript function.

2011-04-22 Thread annet
Hi Ron, Thanks for your reply, problem solved. Kind regards, Annet.

[web2py] Re: Variables in javascript function.

2011-04-22 Thread ron_m
Try changing name=window.open(url,name,'toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=width,height=height'); to have the variables width and height not inside the string literal quotes, something like this name=window.open(url,name,'toolbar=y

[web2py] Re: [w2py-dev] Re: Problems related to keeping applications in seperate folder and not in web2py installation.

2011-04-22 Thread Arun K.Rajeevan
I'm using trunk (which I pull in and update almost daily)

[web2py] Re: Funny behavior with referenced Field display if writable=False

2011-04-22 Thread szimszon
With Version 1.94.6 (2011-04-21 04:20:18) -- nightly build the problem is still persist...

[web2py] Re: new web2py version

2011-04-22 Thread szimszon
File "/home/szimszon/fejlesztes/sajat/web2py/applications/mailadmin/models/menu.py" , line 9, in ( T( 'Új domain' ), URL( 'default', 'domain' ).xml() == URL().xml(), URL( 'default', 'domain' ), [] ), AttributeError: 'st

[web2py] Re: db field date time compare validation

2011-04-22 Thread Anthony
The 'requires' attribute of a field has to be a validator or list of validators (validators are callable objects), not just any boolean test. I think you'll need a custom validator: http://web2py.com/book/default/chapter/07#Custom-Validators. You might also consider using an 'onvalidation' func

Re: [web2py] Re: create new record and update status simultaneously

2011-04-22 Thread Anthony
On Friday, April 22, 2011 2:46:44 AM UTC-4, 黄祥 wrote: > > thank you so much for your pointer, bruno, it seems onaccept, can't receive > request.vars that been passed during form submit, because when i tried to > replace the request.vars into the value id (1, 2, etc), no errors occured. > did an

[web2py] Re: new web2py version

2011-04-22 Thread villas
I think I read somewhere that the URL xml() method was being withdrawn/ cancelled. I think I fixed my menu.py by simply copying a replacement line from the latest welcome/models/menu.py On Apr 22, 11:28 am, szimszon wrote: >   File > "/home/szimszon/fejlesztes/sajat/web2py/applications/mailadmi

[web2py] Re: new web2py version

2011-04-22 Thread szimszon
Okay. No problem. I mentioned just because the default app. had that code too :-o

Re: [web2py] Re: create new record and update status simultaneously

2011-04-22 Thread Stifan Kristi
hi, anthony, thank you so much for your kind attention, problem solved now def __add_2(table): form = crud.create(table, next = URL(request.application, request.controller, index_link),

[web2py] Re: IS_IN_DB using a dal.Set

2011-04-22 Thread villas
My guess is that IS_IN_DB doesn't like joins because it needs to identify one table to display. On Apr 22, 5:31 am, niknok wrote: > I still couldn't find out how to do it with IS_IN_DB and a DAL Set. > > But using IS_IN_SET works: > >         mp_list=gdb(gdb.municipality.province==gdb.province.id

[web2py] Re: IS_IN_DB using a dal.Set

2011-04-22 Thread Massimo Di Pierro
correct On Apr 22, 8:36 am, villas wrote: > My guess is that IS_IN_DB doesn't like joins because it needs to > identify one table to display. > > On Apr 22, 5:31 am, niknok wrote: > > > > > > > > > I still couldn't find out how to do it with IS_IN_DB and a DAL Set. > > > But using IS_IN_SET work

Re: [web2py] Re: new web2py version

2011-04-22 Thread Tito Garrido
I've updated again today and got: Traceback (most recent call last): File "/Users/titogarrido/Documents/Projetos/web2py/gluon/restricted.py", line 181, in restricted exec ccode in environment File "/Users/titogarrido/Documents/Projetos/web2py/applications/loja_controle/controllers/app

Re: [web2py] Re: db field date time compare validation

2011-04-22 Thread Stifan Kristi
thank you so much for your hints anthony, the error didn't appears anymore, but the validation is not run def __date_comparation(form): if request.function == 'booking_add': if form.vars.from_date > form.vars.to_date: form.errors.to_date = 'To Date must greater than From Da

Re: [web2py] Re: db field date time compare validation

2011-04-22 Thread pbreit
I think you were on the right track. I think naming the field "from" might have been a problem. I assume with your last function you had renamed the fields from_date and to_date? The if request.function might not be necessary. Remember that any functions with parameters cannot be accessed from

[web2py] Re: Funny behavior with referenced Field display if writable=False

2011-04-22 Thread Massimo Di Pierro
can you please open an issue on google code (add a link this thread). On Apr 14, 3:06 am, szimszon wrote: > Sorry for late answer (never got an email replay...) > > So: > > -- db.py -- > db.define_table( 'mail_domain', >     Field( 'domainname', 'string') > ) > > db.define_table( 'mail_domain_ali

[web2py] Re: db field date time compare validation

2011-04-22 Thread Massimo Di Pierro
mind that "end" is a keyword in sql and you can have problems with a field called "end". On Apr 22, 12:34 pm, pbreit wrote: > I think you were on the right track. I think naming the field "from" might > have been a problem. I assume with your last function you had renamed the > fields from_date a

[web2py] Re: MySQL, migration, and lower()

2011-04-22 Thread robe...@captivation.com
Thank you for your tips - I'll work with those to find a cleaner workaround for myself. I do wish that a workaround wasn't needed at all, since my table definition was and is correct and matched the database exactly. Cheers, :R On Apr 20, 9:47 pm, drayco wrote: > It's work for me > > On 20 abr

[web2py] Re: web2py in OS X - Where to put custom applications

2011-04-22 Thread Julio Schwarzbeck
I was a little skeptical at first to "pollute" the Mac environment with external python packages (i.e. I use pygments for my qa-stack.com application) this is the reason why I was relying in my (Linux) VM image for all the dirty work, in my reality, in Linux it is easier to manage different package

[web2py] Re: new web2py version

2011-04-22 Thread pierreth
Hello, Can you try this patch on the nightly build and tell me if things are now working? http://pastebin.com/3wjuD6vA --- Pierre

[web2py] Re: db field date time compare validation

2011-04-22 Thread pbreit
Oops. So from_date and to_date better. It still drives me nuts that I can't name a table "order". Is the naming conflict problem common in frameworks?

[web2py] Re: Why new auth_group automatically created with new users?

2011-04-22 Thread pbreit
What is the use case for wanting a group for each user? I am planing to turn this off but am wondering if I am going to lose something down the road. I suppose worst cas scenario is creating all the groups manually/script in the future?

[web2py] Re: Why new auth_group automatically created with new users?

2011-04-22 Thread David Marko
The purpose is probably to give access not directly to user himself but to his group. Then when you need to add access to users resources for the others simply put the user into other users group. David

[web2py] Re: IMPROVED: show error tickets directly if you are a authorized web2py admin

2011-04-22 Thread selecta
playing around with it i realised that inluding the admin css file is not a good idea a new css file would have to be added that works better with error messages in web2py components, will get to that after easter, latest

Re: [web2py] Re: Open a new window and continue

2011-04-22 Thread Kenneth Lundström
Thank you for all your suggestions, the problem is that the PDF is created on the fly, so when I click on a link I need to run a function and that function creates the PDF and updates the database. After that I can reload the page and open the PDF file in a new window. I guess the right order i

[web2py] Re: Why new auth_group automatically created with new users?

2011-04-22 Thread luckysmack
Another possible use case could be that each user by default gets assigned to 2 groups. One say 'Authenticated' that all new users get, this way you can assign global rules as normal. But also a per user group. Say for example my nick here is luckysmack, so my group would be called 'luckysmack' and

Re: [web2py] Re: Open a new window and continue

2011-04-22 Thread Jonathan Lundell
On Apr 22, 2011, at 1:40 PM, Kenneth Lundström wrote: > Thank you for all your suggestions, the problem is that the PDF is created on > the fly, so when I click on a link I need to run a function and that function > creates the PDF and updates the database. After that I can reload the page

[web2py] Re: Why new auth_group automatically created with new users?

2011-04-22 Thread Anthony
In web2py Auth, permissions are granted to groups, so if you want to give specific permissions to individual users, I think they must first belong to a group (even if the group includes just a single user). On Friday, April 22, 2011 3:11:04 PM UTC-4, pbreit wrote: > What is the use case for wan

[web2py] How to rename column name of a projection on select

2011-04-22 Thread Rafael Sales
Hello, How can I define the column name of a field which is a projection (like sum()) on select? Examplo: query = ((db.despesa.id_servico == db.servico.id)) total_gasto = (db.despesa.valor_servico * db.despesa.quantidade).sum() linhas = db(query).select(db.servico.descricao

Re: [web2py] Re: db field date time compare validation

2011-04-22 Thread Stifan Kristi (Kou Shou)
thank you so much for pointers pbreit and massimo, it's correct that before i changed my from database field into from_date because i think it's a keyword. i've already tried to modified my code, but the date validation is not run using crud, here's my code : db.define_table('booking',

[web2py] Javascrip Bug Quick Examples

2011-04-22 Thread Wanderfels
Hey, http://127.0.0.1:8000/examples/default/examples/ clicking on one of the top links and then navigating back in history does not go back to those links, but instead to the previous page. Do not do things like this. dnt. Thx for web2py. Its beautiful, except the Javascript.

[web2py] Architectural question applications/components/etc

2011-04-22 Thread Stodge
Quick architecture question. Say I have a project management application. Typically I'm used to creating separate django apps for tickets and requirements and then I can import modules between them as needed. How would this be done with web2py? Is the preferred way to create one application that in

[web2py] Re: Architectural question applications/components/etc

2011-04-22 Thread Massimo Di Pierro
It depends. If each "part" is supposed to work without the others, than each part is its own application. If the parts only make sense together, they belong to one single application. You can make it more modular using different controllers for different parts. On Apr 22, 8:11 pm, Stodge wrote: >

[web2py] Re: Javascrip Bug Quick Examples

2011-04-22 Thread Massimo Di Pierro
I never noticed that. Technically this is a problem with the zexamples.scroll.js library that is used by the examples app and only by the examples app. I will check if there is an updated version of the jquery plugin that does not have the problem. On Apr 22, 8:27 pm, Wanderfels wrote: > Hey, > >

Re: [web2py] Re: Javascrip Bug Quick Examples

2011-04-22 Thread Bruno Rocha
I guess the hash argument is missing, take a look: http://flesler.blogspot.com/2007/10/jquerylocalscroll-10.html On Sat, Apr 23, 2011 at 12:28 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > I never noticed that. Technically this is a problem with the > zexamples.scroll.js library

Re: [web2py] Re: Javascrip Bug Quick Examples

2011-04-22 Thread Bruno Rocha
Here is an example where history works fine: http://demos.flesler.com/jquery/localScroll/ But, on that page I think the plugin can be removed and keep normal anchors. On Sat, Apr 23, 2011 at 1:04 AM, Bruno Rocha wrote: > I guess the hash argument

[web2py] Fwd: minor path bug in gluon/contrib/pyfpdf/fpdf.py for font.z file location

2011-04-22 Thread Chris Steel
I have been playing with Mariano Reingart's awesome port of fpdf to python in Web2py gluon/contrib (http://code.google.com/p/pyfpdf/) and found a minor bug that occurs when using addfont that causes it to look in gluon/contrib/pyfpdf/font/ for added fonts and associated files but for fontname.z i

[web2py] backward compatibility problem?

2011-04-22 Thread blackthorne
hi trying to solve a problem that emerged when I moved my app from an older (v1.92) installation to latest. Here is the error: File "/Users/blackthorne/Dropbox/Code/Workspaces/web2py/applications/ homepage/controllers/default.py", line 47, in get_tweets import gluon.contrib.simplejson as sj

[web2py] Pusher - Real-time push

2011-04-22 Thread Pepe Araya
Hello! Has anyone used this with web2py? can you share your experience? http://www.pusher.com

Re: [web2py] Re: db field date time compare validation

2011-04-22 Thread Stifan Kristi
pardon me, the problem is solved after a few modification in function. thank you so much for your kind help massimo. it seems that the validation on form is run after the validation that define on the models (db.define_table). On Sat, Apr 23, 2011 at 9:41 AM, Massimo Di Pierro < massimo.dipie...@g

[web2py] Unexpected behavior using LOAD + form factory

2011-04-22 Thread Tito Garrido
Hi Folks, I'm using a sqlform factory form with LOAD and seems that the form doesn't respond when I click the submit for the first time... not sure why the post is sent but seems that it doesn't get accepted... then if I click again it works... is that expected? Example of code: *Controller*: de

Re: [web2py] Re: LOAD/web2py component improved web2py_trap_form

2011-04-22 Thread Tito Garrido
Wow! I just posted a message about this problem... +1 ! I'm using 2 forms with LOAD on the same page and I got the same problem... it doesn't work on the first submit. On Wed, Apr 13, 2011 at 5:12 PM, selecta wrote: > done http://code.google.com/p/web2py/issues/detail?id=232 > > On Apr 11, 3:

[web2py] Re: Unexpected behavior using LOAD + form factory

2011-04-22 Thread Tito Garrido
Nevermind, if you have the same problem check the topic: LOAD/web2py component improved web2py_trap_form On Sat, Apr 23, 2011 at 3:56 AM, Tito Garrido wrote: > Hi Folks, > > I'm using a sqlform factory form with LOAD and seems that the form doesn't > respond when I click the submit for the first