Re: [web2py] Re: Appadmin on 2.9.4

2014-03-14 Thread Dewes
Maybe in apache2, on default config you have this line:

AliasMatch ^/([^/]+)/static/(.*)   
 /var/www/web2py/applications/$1/static/$2

Change it to:
 AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*)   
 /var/www/web2py/applications/$1/static/$2

At least that solved my problem.

This makes apache ignore statics with versioning.

Em sexta-feira, 14 de março de 2014 18h11min50s UTC-3, Niphlod escreveu:

 me neither but it may be related to static_version. A simple screenshot 
 from firebug or chrome developers tools will tell us.

 On Friday, March 14, 2014 5:43:41 PM UTC+1, Massimo Di Pierro wrote:

 Sorry I do not understand.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] [Error]TypeError: format requires a mapping

2012-11-06 Thread Dewes
Hello, I have the following table that worked in web2py 1.99.7, but now I 
upgraded to 2.2.1, and I got this error that I don't know how to solve:

Traceback (most recent call last):
  File 
/home/dewes/Dropbox/desenvolvimento/novo_web2py/web2py/gluon/restricted.py, 
line 212, in restricted
exec ccode in environment
  File 
/home/dewes/Dropbox/desenvolvimento/novo_web2py/web2py/applications/normas/models/db.py
 http://localhost:8000/admin/default/edit/normas/models/db.py, line 100, in 
module
Field('grupo', db.auth_group, default=auth.user_group(auth.user_id), 
format='%(role)'),
  File /home/dewes/Dropbox/desenvolvimento/novo_web2py/web2py/gluon/tools.py, 
line 2990, in user_group
return self.id_group(self.user_group_role(user_id))
  File /home/dewes/Dropbox/desenvolvimento/novo_web2py/web2py/gluon/tools.py, 
line 2997, in user_group_role
return self.settings.create_user_groups % user
TypeError: format requires a mapping

db.define_table('normas',
Field('titulo','string',label=T('Título')),
Field('ementa','text',label=T('Ementa')),
Field('tipo_norma',db.tipos,label=T('Tipo Norma')),
Field('numero_norma','integer',label=T('Número')),
Field('situacao',db.situacao,label=T('Situação')),
Field('orgao_emissor','list:reference orgaos',label=T('Órgão Emissor')),
Field('veiculo','string',label=T('Veículo de Publicação')),
Field('numero_veiculo','integer',label=T('Número do Veículo')),
Field('dt_emissao','date',label=T('Data de Emissão')),
Field('dt_publicacao','date',label=T('Data de Publicação')),
Field('conteudo','text',label=T('Conteúdo')),
Field('arquivo1','upload',uploadseparate=True),
Field('arquivo2','upload',uploadseparate=True),
Field('arquivo3','upload',uploadseparate=True),
Field('arquivo4','upload',uploadseparate=True),
Field('arquivo5','upload',uploadseparate=True),
Field('created_on', 'datetime', default=request.now),
Field('created_by', db.auth_user, default=auth.user_id),
Field('grupo', db.auth_group, default=auth.user_group(auth.user_id)),
format='%(titulo)s'
)

Deleting the field Field('grupo', db.auth_group, 
default=auth.user_group(auth.user_id)), the error is gone, but I need this 
field, as a shortcut to restrict the normas (normative documents) to the 
group of people that created it, without going to the user that created and 
after the group of that user.

I have already tried to put in the Field something like format='%(role)s' or 
format='%(description)' but to no avail.

Thanks in advance.

More from error:

def user_group_role(self, user_id=None):
if user_id:
user = self.table_user()[user_id]
else:
user = self.user
return self.settings.create_user_groups % user

-- 





[web2py:16461] Datetime bug?

2009-02-17 Thread dewes

When I create a table like this:

db.define_table('pontos',
SQLField('nome','string'),
SQLField('destino','string'),
SQLField('dt_entrada','datetime'),
SQLField('dt_saida','datetime')
)

db.pontos.nome.required = IS_NOT_EMPTY()
db.pontos.destino.required = IS_NOT_EMPTY()

and make this controller:

def controle_ponto():
 form = SQLFORM(db.pontos)
 if form.accepts(request.vars,session):
 response.flash='ok'
 return dict(form=form)

it keep saying that I have to fill both dates even if I didn't make
they required. I had also tried to set them notnull=False,
required=False, but it didn't helped.

The solution that I found was to make FORM() and insert after.

By the way, pretty cool the little calendar to fill dates when you
click on a datetime input made by the sqlform.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:16464] Re: Datetime bug?

2009-02-17 Thread Rodrigo Dewes
Thanks a lot!

On Tue, Feb 17, 2009 at 18:17, mdipierro mdipie...@cs.depaul.edu wrote:


 db.pontos.dt_entrada.requires=IS_NULL_OR(IS_DATETIME())

 On Feb 17, 2:39 pm, dewes rde...@gmail.com wrote:
  When I create a table like this:
 
  db.define_table('pontos',
  SQLField('nome','string'),
  SQLField('destino','string'),
  SQLField('dt_entrada','datetime'),
  SQLField('dt_saida','datetime')
  )
 
  db.pontos.nome.required = IS_NOT_EMPTY()
  db.pontos.destino.required = IS_NOT_EMPTY()
 
  and make this controller:
 
  def controle_ponto():
   form = SQLFORM(db.pontos)
   if form.accepts(request.vars,session):
   response.flash='ok'
   return dict(form=form)
 
  it keep saying that I have to fill both dates even if I didn't make
  they required. I had also tried to set them notnull=False,
  required=False, but it didn't helped.
 
  The solution that I found was to make FORM() and insert after.
 
  By the way, pretty cool the little calendar to fill dates when you
  click on a datetime input made by the sqlform.
 



-- 
Jeder Tag der Niederlage ist ein Sieg
Each day of the defeat is a victory

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:16399] Re: Multiple form select

2009-02-16 Thread Rodrigo Dewes
Thank you, it worked, or sort

because when I tried to print de values, it prints on this way:

[
'
t
e
s
t
1
'
,
'
t
e
s
t
2
'
]

I tried to get the form values on this way:

form.vars.test

and printed this way

for x in form.vars.test :
print x

Am I doing it wrong?

Just wanted it to print:
test1
test2

On Fri, Feb 13, 2009 at 15:19, mdipierro mdipie...@cs.depaul.edu wrote:


 you can do:

 options=[str(x) for x in range(10)]
 form=FORM(SELECT(*options,_name='test',_multiple='multiple'),INPUT
 (_type='submit'))

 or you can do:

 from gluon.sqlhtml import form_factory
 options=[str(x) for x in range(10)]
 form=form_factory(SQLField('test',requires=IS_IN_SET
 (options,multiple=True))

 Massimo


 On Feb 13, 11:59 am, dewes rde...@gmail.com wrote:
  Hello there, I'm new at web2py, and I have a question. When making a
  form with FORM() how I do a select multiple name=test ?
 



-- 
Jeder Tag der Niederlage ist ein Sieg
Each day of the defeat is a victory

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:16309] Multiple form select

2009-02-13 Thread dewes

Hello there, I'm new at web2py, and I have a question. When making a
form with FORM() how I do a select multiple name=test ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py Web Framework group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---