[web2py] Webservice to upload files

2012-06-27 Thread Adriano Almeida
Hello Gentleman

Is this possible to create a webservice with web2py to upload files 
(ex:pictures)? How could this be done if I want to have some security 
(password verification) on it?

I would like to integrate a web2py service with a mobile  application, 
dropbox style. 

Thanks in advance

Adriano

-- 





[web2py] Date field mask or another value

2012-03-27 Thread Adriano Almeida
Hi,

I want a field (may be string,date or number, no prob) to have a
format of MM (valid year and month) or if it is left null, to be
99. How Could I accomplished that?

I have tried :
Field('A0514_DT_FIN','date',notnull=True, label= 'Dt Fim (MM)',
default= '99')

and then the check:
db.tb0514_bihc_consultor_nivel.A0514_DT_FIN.requires =
IS_EMPTY_OR(IS_DATE(format=T('%Y%m'), error_message='formato deve ser
MM! ou vazio'))

It does not work as 99 is not a valid month and  is not a valid
year.

Any ideas?



[web2py] Re: Photo Gallery

2012-02-25 Thread Adriano Almeida
I have used the Firebug to see if I could get the error I was having.
It gave me "effect is not defined"

I've googled it and it was about a file called effectS.js. When
uploading the file using the admin interface, to copy the file to the
js dir, I had to rename to js/effects.js. The problem is that I
mistakenly renamed it to effect.js, without the s.

Sorry for wasting your time and thanks a lot for the help. Now the
next challenge is to make the site work on GAE.

Thanks a lot to all.

On Feb 25, 10:58 am, Adriano Almeida 
wrote:
> sorry for not posting any code before. I had my code at home.
>
> So..
>
> I have a layout.html with the following code:
>
> ...
>  
>   

[web2py] Re: Photo Gallery

2012-02-25 Thread Adriano Almeida
sorry for not posting any code before. I had my code at home.


So..

I have a layout.html with the following code:

...
 
  

  
  {{
  response.files.append(URL('static','css/skeleton.css'))
  response.files.append(URL('static','css/web2py.css'))
  response.files.append(URL('static','css/superfish.css'))
  response.files.append(URL('static','js/superfish.js'))
  response.files.append(URL('static','css/mamae.css'))
  response.files.append(URL('static','js/prototype.js'))
  response.files.append(URL('static','js/scriptaculous.js'))
  response.files.append(URL('static','js/lightbox.js'))
  response.files.append(URL('static','css/lightbox.css'))
  }}

  {{include 'web2py_ajax.html'}}
...


   {{block center}}
   {{include}}
   {{end}}


...


Than I have a controller called  fotos that has a method called  index
and download:
def index():
response.menu = [
(T('A LOJA'),False,URL('default','aloja')),
(T('FOTOS'),True,URL('fotos','index')),
(T('PRODUTOS'),False,URL('default','produtos')),
(T('ONDE'),False,URL('default','onde')),
(T('CONTATO'),False,URL('default','contato'))]

fotos = db().select(db.imagem.ALL)
return dict(fotos=fotos)

@auth.requires_login()
def gerenciamento():
""" simple person registration form with validation and
database.insert()
also lists all records currently in the table"""

records = SQLFORM.grid(db.imagem,searchable=False)
return dict(records=records)

def download():
"""
allows downloading of uploaded files
http:///[app]/default/download/[filename]
"""
return response.download(request,db)


and the view that will use these files is fotos/index.html:
{{tipo_pagina='site'}} -- this will tell layout which layout it will
use
{{extend 'layout.html'}}


{{for foto in fotos:}}

{{=foto.descricao}}
{{pass}}

besides that I have the lightbox.css in css folder and the various js
asked in js folder (lightbox, ligthbox_web, prototype,
scriptaculous).

I have tried to upload the project to fluxflex but it returned and
internal error after uploading it.

Thanks again



On Feb 24, 9:12 pm, peter  wrote:
> To see what the current repository deployed on fluxflex looks like, go
> to
>
> kathykuck.fluxflex.com/gallery
>
> When Kathy logs in, using the usual web2py way of doing this, 3 new
> headings appear, allowing her to edit images, edit galleries and edit
> the personal information. Only the first registered user is allowed to
> do this. The second gallery is currently empty.
>
> As flux flex is free for small sites like this, one can give an artist
> a free site that they have control over.
>
> Peter
>
> On Feb 24, 10:48 pm, peter  wrote:


[web2py] Photo Gallery

2012-02-24 Thread Adriano Almeida
Hi folks,

I have been trying to create a image gallery for a website that I´ll
be hosting on GAE. I am trying to use 
http://lokeshdhakar.com/projects/lightbox2/
but I cannot make it work.

When clicking on the link the would open the box and the fotos nothing
happens.

Is there anybody that could make web2py and the lightbox work
together?

Thanks in advance