[web2py] Re: Bare Login using API key

2014-08-05 Thread lyn2py
Hi Massimo, in case you missed this, this is a call out, I hope you can 
shed some light on this.

If I would like to do something like:

http://api_key:api_secret@some_url.com/default/call/jsonrpc



On Thursday, July 31, 2014 2:19:36 PM UTC+8, lyn2py wrote:
>
> Thanks Leonel! I just thought that web2py had something like that already 
> in place, perhaps needed to add a correct decorator, and I didn't need to 
> reinvent the wheel.
>
> Sidenote to Massimo: What do you think of the idea? Have a decorator to 
> check for a special field or fields (API key related, like API key, API 
> secret) in order to get a particular / restricted access to the API calls.
>
>
>
> On Thursday, July 31, 2014 2:06:21 AM UTC+8, Leonel Câmara wrote:
>>
>> An easy way would be to have your default.py/call function check the API 
>> key and raise HTTP(403) if it's not valid. You could subclass Auth, make 
>> your own basic_login using the API key, use that as the Auth for your 
>> application, and then use auth.requires_login() in call, but it seems 
>> unnecessarily complicated for this.
>>
>

-- 
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] Re: help

2014-08-05 Thread JorgeH

Welcome

Go ahead and read the documentation and the examples.

Come back with your questions.

When posting on this group, use a specific title for your question other 
than the generic 'help'

On Monday, August 4, 2014 12:38:25 PM UTC-5, ROHIT NEGI wrote:
>
> Hi
> I am new to web2py and I'm quite confused as to how I will be able to 
> deploy application on web? Even if I make a web2py app, how will I be able 
> to make a site from it as I'm making apps on the web2py site?
>

-- 
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] How to add CSS class to SQLFORM.grid??

2014-08-05 Thread greenpoise
How can I make use of my own td classes for SQLFORM.grid??

Thanks

-- 
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.


Re: [web2py] Re: web2py.com is down...

2014-08-05 Thread Ovidio Marinho
http://www.web2py.com/ this is Ok!




 Ovidio Marinho Falcao Neto
  ITJP.NET.BR
 ovidio...@gmail.com
 itjp.net...@gmail.com
 Brasil



2014-08-05 18:12 GMT-03:00 Jim S :

> Back up now.  Thanks to the pythonanywhere team for their quick response!
>
> -Jim
>
>
> On Tuesday, August 5, 2014 4:00:29 PM UTC-5, Jim S wrote:
>>
>> I've sent a note to pythonanywhere to let them know...
>
>  --
> 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.
>

-- 
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] Re: web2py.com is down...

2014-08-05 Thread Jim S
Back up now.  Thanks to the pythonanywhere team for their quick response!

-Jim

On Tuesday, August 5, 2014 4:00:29 PM UTC-5, Jim S wrote:
>
> I've sent a note to pythonanywhere to let them know...

-- 
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] web2py.com is down...

2014-08-05 Thread Jim S
I've sent a note to pythonanywhere to let them know...

-- 
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] Re: scheduler new feature: task dependencies

2014-08-05 Thread Limedrop
Thanks Niphlop, that's brilliant!  I've been using a work-around to 
schedule dependent jobs, and this will help to tidy things up.

On Tuesday, August 5, 2014 8:51:25 PM UTC+12, Niphlod wrote:
>
> Hi @all,
>we have another feature in trunk for the scheduler... Jobs (i.e. task 
> dependencies)
>
> Directly from https://github.com/niphlod/w2p_scheduler_tests/ (that has 
> been updated to accomodate the new feature explanation...)
>
>
> What are "Jobs", you ask ? Well, it's a way to coordinate a set of tasks 
> that have dependencies (what in Celery is called "Canvas").
>
> As always, the Scheduler sticks to the basics. Every Job is considered to 
> be a DAG (a  Directed Acyclic Graph 
> ).
> Without going into silly details, every task can have one or more 
> dependencies, but of course you can't have mutual dependencies among the 
> same tasks.
> If a "job" can't be represented as a DAG, then it can't be processed in 
> its entirety. You can still queue it, but it won't ever complete (i.e. you 
> could have a
>   complete stall at the first task or just a task left on 100 queued...)
>
> So... what can you do ?
> Let's take a trivial example (there are a few based on mathematics, 
> map/reduce, etc... but hey, this is an example!!!)
> Suppose you need to create a job that describes what is needed to get 
> dressed ( thanks to http://hansolav.net/sql/graphs.html )...
>
> We have a few items to wear, and there's an "order" to respect...
> Items are: watch, jacket, shirt, tie, pants, undershorts, belt, shoes, 
> socks
>
> Now, we can't put on the tie without wearing the shirt first, etc...
>
> 
>
>
>
> Suppose we have those tasks queued in a controller (for example's sake, 
> the same function, with different task_name(s))...
> watch = s.queue_task(fname, task_name='watch')
> jacket = s.queue_task(fname, task_name='jacket')
> shirt = s.queue_task(fname, task_name='shirt')
> tie = s.queue_task(fname, task_name='tie')
> pants = s.queue_task(fname, task_name='pants')
> undershorts = s.queue_task(fname, task_name='undershorts')
> belt = s.queue_task(fname, task_name='belt')
> shoes = s.queue_task(fname, task_name='shoes')
> socks = s.queue_task(fname, task_name='socks')
>
>
> Now, there's a helper class to construct and validate a "job".
> First, let's declare a job named "job_1"
>
>
> #from gluon.scheduler import JobGraph
> myjob = JobGraph(db, 'job_1')
>
>
>
> Next, we'd need to establish dependencies
>
>
> # before the tie, comes the shirt
> myjob.add_deps(tie.id, shirt.id)
> # before the belt too comes the shirt
> myjob.add_deps(belt.id, shirt.id)
> # before the jacket, comes the tie
> myjob.add_deps(jacket.id, tie.id)
> # before the belt, come the pants
> myjob.add_deps(belt.id, pants.id)
> # before the shoes, comes the pants
> myjob.add_deps(shoes.id, pants.id)
> # before the pants, comes the undershorts
> myjob.add_deps(pants.id, undershorts.id)
> # before the shoes, comes the undershorts
> myjob.add_deps(shoes.id, undershorts.id)
> # before the jacket, comes the belt
> myjob.add_deps(jacket.id, belt.id)
> # before the shoes, comes the socks
> myjob.add_deps(shoes.id, socks.id)
>
>
>
> Then, we can ask JobGraph if what we asked is a job that is accomplishable
>
> myjob.validate('job_1')
>
> And voilà, job done! If it's not a DAG, then an exception will be raised 
> and the jobs won't be committed (of course their dependencies won't be 
> committed too)
>
> How it works under the hood ?
>
> There's a new table called scheduler_task_deps that holds a reference to 
> the job_name, the task parent, the task child and
> a boolean to mark the "path" (the arrows in the graph) as "visitable".
> To be fair, the job name isn't that important, you can have task 
> dependencies amongst
> different jobs, it's just not that easy to verify that the Job is a DAG at 
> a later stage.
> If a path is "visitable" it means that the DAG graph can be "walked" in 
> that direction.
> Every time a task gets "COMPLETED", the "paths" gets updated to be 
> "visitable". The algo to pick up tasks has been updated
> to work fetching only tasks that have no dependencies, or dependencies 
> that have already been satisfied (i.e. tasks that depends
> on nothing, or tasks that depend on tasks that are yet COMPLETED).
>
>
> Let me know what you think, and if you spot bugs.
>
>
>
>

-- 
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.


Re: [web2py] Web2py Forms and Javascript

2014-08-05 Thread Jesse Ferguson
The service order on the right is what is completed in the field by the 
techs. (The part they bring me). The form on the left is what our company 
calls a Work-Up. The work up Is created by me by taking the service orders 
information and the information from a rolodex card. The rolodex card (not 
pictured) contains just basic information about the company and location 
(mileage to charge and hours). then i scan them both just as pictured and 
send them to main office.

-- 
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] Re: help

2014-08-05 Thread Anthony
Please read the documentation 
 and come 
back with specific questions if you run into difficulty.

On Monday, August 4, 2014 7:38:25 PM UTC+2, ROHIT NEGI wrote:
>
> Hi
> I am new to web2py and I'm quite confused as to how I will be able to 
> deploy application on web? Even if I make a web2py app, how will I be able 
> to make a site from it as I'm making apps on the web2py site?
>

-- 
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.


Re: [web2py] Web2py Forms and Javascript

2014-08-05 Thread Richard Vézina
Could you explain the 3 differents part of the paperwork... There the
invoice at the right but what is the listing in the lower left...

Richard


On Tue, Aug 5, 2014 at 2:57 PM, Jesse Ferguson  wrote:

> here is the paperwork
>
> --
> 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.
>

-- 
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] Re: scheduler new feature: task dependencies

2014-08-05 Thread Dave S


On Tuesday, August 5, 2014 1:51:25 AM UTC-7, Niphlod wrote:
>
> Hi @all,
>we have another feature in trunk for the scheduler... Jobs (i.e. task 
> dependencies)
>
> Directly from https://github.com/niphlod/w2p_scheduler_tests/ (that has 
> been updated to accomodate the new feature explanation...)
>
>
> What are "Jobs", you ask ? Well, it's a way to coordinate a set of tasks 
> that have dependencies (what in Celery is called "Canvas"). 
>
[...]
>
Let me know what you think, and if you spot bugs.
>

My first reaction is, "Sweet!"  The explanation is nice and simple and the 
hooks look very usable.  Now I just have to learn to use the scheduler   ;-)
(I haven't need it yet, but I've been reading along with the posts here, so 
I have a vague idea of what to do.)

/dps

-- 
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] Re: template de instalação de aplicação web2py no windows

2014-08-05 Thread Dave S


On Monday, August 4, 2014 5:46:45 PM UTC-7, Hains Hausmann Junior wrote:
>
> Olá!
>
> Estou tentando fazer (ou encontrar um exemplo) um template de um 
> instalador de aplicações we2py para windows.
> Quero instalar o web2py, a aplicação desenvolvida (compilada em pyc), e um 
> servidor web melhor, (exemplo nginx) que não seja o do web2py.
> Rodar o servidor web com a aplicação web2py como serviço ou rodar de outra 
> forma em background com um ícone na bandeja do sistema e iniciar junto com 
> o windows.
>

I would take a look at the tools used by web2py to make the Windows 
installation package that you download from web2py.com.   The toolset 
changed a few months back; there was some discussion of that here and 
probably more on the web2py developers group.

There are Windows installation packages for Apache; I don't know if NginX 
has done that yet.  My impression of IIS is that if you already know it, it 
works fine, but it can be a pain to learn how to set it up.  Rocket might 
be enough if you can front it with an appropriate process launcher; it's 
small but I hear that it seems to have plenty of capability in the right 
environment.

Good luck!
 
/dps



> O inno setup tem resolvido alguns problemas, e provavelmente irá resolver 
> os outros, mas gostaria da opinião do pessoal,
> se alguém já fez algo parecido, se tem algumas dicas de de como montar a 
> stack servidor/app, exemplos de configurações padrões 
> para casos genérico de sistema CRUD.
>
> Quero fazer um instalador para uma aplicação pequena de CRUD 
> (inicialmente), que vai ser instalado no windows,
> e usado tanto local como remoto por apenas algum usuários.
>
> Se alguém tiver algumas dicas ou exemplo, ficarei agradecido.
> Att
> Hains
>

-- 
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] Re: help

2014-08-05 Thread Dave S


On Monday, August 4, 2014 10:38:25 AM UTC-7, ROHIT NEGI wrote:
>
> Hi
> I am new to web2py and I'm quite confused as to how I will be able to 
> deploy application on web? Even if I make a web2py app, how will I be able 
> to make a site from it as I'm making apps on the web2py site?
>

I'm not sure you are making apps on web2py.com.   That's the web2py site.

If you've downloaded the web2py executable and are running it on a local 
machine, that machine is *your* server.  Sometimes that machine can be 
visible to the world for web access, but it's more common to access that 
machine only on a local area network (LAN) (your LAN  can be big or small 
... maybe just 2 machines, say a desktop and a laptop, on the same wifi 
segment).  The local machine is used for a "development server" where you 
try out and debug your code.  Then when you're ready for a wider audience, 
you find a host service and set up an account that will run your 
"production server".  The hosting service takes care of the nuts and bolts 
of server hardware and routers and suitable ISP connections, and their 
customer service will often be able to get you started on installing your 
OS (some hosts come with the OS pre-installed) and other software setup 
issues.


Some of the widely available hosting services mentioned around here (that 
is, in posts to the Web2py Google Groups discussion forum) include  Python 
Anywhere, Google App Engine, Digital Ocean, DreamHost, heroku, HostGator, 
and  BeagleBone.  There are also plenty of local hosting services in many 
cities, and some allow physical access to "your" server.

The hosting service typically provides a "virtual machine" or VM, and and 
it can be helpful if you've used one of those before you go to open your 
account.  Get VMWare Player of Virtual Box or Xen and try some simple 
setups.  This is also a good, cheap way to learn a different OS (if, say, 
you're a Windows person but you want to use a flavor of Linux as well), or 
how to set up and maintain some software packages (Apache or NginX, for 
instance).  You can even do your development server in a VM and then your 
network is just one piece of hardware with a "virtual ethernet" connection.

If all this made your eyes glaze over, relax and take it a little bit at a 
time.  Practice the samples in the book, find Massimo's videos, continue to 
read the group and to visit some of the sites people here show off, and it 
will come to you.

/dps

-- 
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.


Re: [web2py] Web2py Forms and Javascript

2014-08-05 Thread Jesse Ferguson
I am working to move the company from paper to electronic, I work in a remote 
office and have to fax all of this right now.

basic workflow:
   Service Orders Created in the field at Job site get delivered to me every 
day.
   I take the service order and create a workup (basically an invoice) using a 
rolodex of company/location details (Price List, ACCCODE, ATTN TO, PO#, ETC..)
   I then fax all the service orders and workups at the end of the week to our 
main office.

I think I have figured out the schema but if you could take a look and see if 
you can find any obvious errors please let me know.. I will attach code in next 
reply



-- 
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] Re: Encoding and 'invalid argument'

2014-08-05 Thread Dave S


On Monday, August 4, 2014 7:08:11 AM UTC-7, Rémy Reche wrote:
>
> I agree with you, but it is web2py (gluon) which process the arguments. 
> This error occurs before entering my function.
>
>
> On Friday, August 1, 2014 9:27:47 PM UTC+2, Derek wrote:
>>
>> Well, before you process the arguments, you would want to encode it as 
>> utf-8. See here: 
>> https://groups.google.com/forum/#!msg/web2py/B_EOmprbjO0/kMEHiiCrmYEJ
>>
>> URLs get converted into punycode if they are not ascii, so that wouldn't 
>> be an issue.
>>
>

Do you need to make sure the client code is using unicode when it builds 
the URL (and/or POST data) before it ships it to you?

Do you control the client code, or is it third-party software that you are 
having point to you?

/dps

 

>
>> On Thursday, July 31, 2014 2:33:56 AM UTC-7, Rémy Reche wrote:
>>>
>>> I am using the decorator @request.restful() in order to implement a 
>>> rest API. Unfortunatly, one on my function take an argument which can 
>>> contain non-ascii character, for instance 'Gymnase Joseph Guétat'. Each 
>>> request using this string returns a web2py error with the following 
>>> comment: invalid arg . Is this an issue with 
>>> the url encoding/decoding mechanism ? a routing issue ? How can I solve 
>>> this problem ?
>>>
>>> Thanks,
>>>
>>> Rémy
>>>
>>

-- 
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.


Re: [web2py] Re: Python and Web2py course

2014-08-05 Thread Richard Vézina
If I would teach, I do it like that. I propose some project to students,
they have to pic one and then you deconstruct the project in small pieces
that are the differents courses themes and you start with the easier thing
and you increase the chalange progressively until you finalize the app
project.

Project idea :

Phone Directory
Invoice system
Etc.

Richard


On Mon, Aug 4, 2014 at 7:33 PM, 黄祥  wrote:

> perhaps you can learn and get some idea from massimo's video teaching
> web2py.
>
> best regards,
> stifan
>
> --
> 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.
>

-- 
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.


Re: [web2py] Nginx and uwsgi Internal Server Error

2014-08-05 Thread Richard Vézina
Make sure everything in web2py directory is owned by www-data user : sudo
chown -R www-data.www-data web2py/

Richard


On Mon, Aug 4, 2014 at 7:09 PM, Jim Steil  wrote:

> Just logged in and saw that I did install unixodbc before pyodbc.  Also,
> this all works if I run using the rocket web server instead of nginx/uwsgi.
>
> -Jim
>
>
> On Mon, Aug 4, 2014 at 5:59 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> Try install unixodbc before pyodbc as says in the link I posted above...
>>
>> To me, it looks like uwsgi and nginx and web2py are running but the
>> pyodbc make web2py failing with internal error...
>>
>> Richard
>>
>>
>> On Mon, Aug 4, 2014 at 6:38 PM, Marin Pranjić 
>> wrote:
>>
>>> Can you check again if there is wsgihandler.py inside web2py root
>>> directory?
>>> Can you make sure sockets are created inside /tmp and www-data owns them?
>>> What does nginx error log say when you try to make a request?
>>>
>>> I had a 5-hour fight with uwsgi last week. It's really hard to debug it
>>> because logs don't say much about the issue. :(
>>>
>>>
>>> On Tue, Aug 5, 2014 at 12:27 AM, Jim Steil  wrote:
>>>
 appears to be.  Also, keep in mind that all of this works with the
 rocket server...

  administrator@web1-14:/home/www-data/web2py$ ps aux | grep uwsgi
 root   788  0.0  0.1  39256  6380 ?Ss   17:15   0:00 uwsgi
 --master --die-on-term --emperor /etc/uwsgi --logto 
 /var/log/uwsgi/uwsgi.log
 root   892  0.0  0.0  36612  1112 ?S17:15   0:00 uwsgi
 --master --die-on-term --emperor /etc/uwsgi --logto 
 /var/log/uwsgi/uwsgi.log
 www-data   893  0.0  0.4  84564 19308 ?S17:15   0:00
 /usr/local/bin uwsgi --ini web2py.ini
 www-data   996  0.0  0.3  84564 14704 ?S17:15   0:00
 /usr/local/bin uwsgi --ini web2py.ini
 www-data   997  0.0  0.3  84564 14704 ?S17:15   0:00
 /usr/local/bin uwsgi --ini web2py.ini
 www-data   998  0.0  0.3  84564 15088 ?S17:15   0:00
 /usr/local/bin uwsgi --ini web2py.ini
 www-data   999  0.0  0.3  84564 14840 ?S17:15   0:00
 /usr/local/bin uwsgi --ini web2py.ini
 adminis+  1258  0.0  0.0  11748   916 pts/0S+   17:26   0:00 grep
 --color=auto uwsgi
 administrator@web1-14:/home/www-data/web2py$



 On Mon, Aug 4, 2014 at 5:12 PM, Marin Pranjić 
 wrote:

> Is uwsgi running after restart? ps aux | grep uwsgi
>
>
> On Tue, Aug 5, 2014 at 12:08 AM, Jim Steil 
> wrote:
>
>> I did not.  I used the script in the web2py/scripts directory.
>>
>>
>> On Mon, Aug 4, 2014 at 5:07 PM, Marin Pranjić <
>> marin.pran...@gmail.com> wrote:
>>
>>> Did you copy wsgihandler.py inside web2py root?
>>>
>>> Marin
>>>
>>>
>>> On Mon, Aug 4, 2014 at 11:50 PM, Jim S  wrote:
>>>
 Clean install with all dependencies in place before installing
 nginx/uwsgi/web2py yields the same results.  It works if I don't have
 pyodbc installed.

 Any more thoughts on what I could do for debugging?

 -Jim

 --
 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.

>>>
>>>  --
>>> 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 a topic in
>>> the Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/web2py/Fkaz9N8bMh0/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+unsubscr...@googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
>> 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

[web2py] Re: How can I set correctly auth.settings.registration_requires_verification = False ?

2014-08-05 Thread Massimo Di Pierro
You are right. With that code the used should be able to register and 
immediately login.
This usually works. We cannot help you without looking at your code.

On Monday, 4 August 2014 03:39:26 UTC-5, Luca Guerrieri wrote:
>
> Goodmornig people,
> I've customized registration form and relative view, for integrating the 
> registration
> process with Active Directory (asap I'll post on webslices my results :-) )
> But ... I've a problem ... and I'm not able to resolve correctly ...
>
> in db.pt I've set 
>
> ## configure auth policy
> auth.settings.registration_requires_verification = False
> auth.settings.registration_requires_approval = False
> auth.settings.reset_password_requires_verification = True
>
> so it means that if a new user registers after submit he will be able to 
> make login without register_key verification etc... right?
>
> it seems it's not so  after registration I've the registration_key 
> filled with the key and I've to clear if i want to permit loging 
> to the user ...
>
> What is wrong ?
>
>
> Thank you for your help 
>
> Luca
>
>

-- 
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] Re: emailing a pdf view as an attachment

2014-08-05 Thread Massimo Di Pierro
Yes. In at least three ways. web2py ships with pyfpdf (in gluon.contrib) 
which converts html to pdf. Once you make the file you can also add as an 
attachment to an email (look the web2py email API). You can install/unzip 
reportlab in web2py/site-packages and use that alternatively. Also, if you 
run on a linux/mac machine you can install LaTeX and call that for the 
conversion, but use it only if you know latex already. 

On Sunday, 3 August 2014 18:00:07 UTC-5, sasogeek wrote:
>
> I have a form, and i display the details entered in the form on .pdf views 
> page. Is it possible to use web2py to email that generated pdf page to 
> someone? what I want to achieve is to allow users to fill the form and then 
> click a button to send the pdf containing the entered details without 
> downloading the pdf and re-uploading it... it's about the best solution 
> I've come up with so far but that's not what I want to achieve. It'll be 
> too much hustle for users (even I wouldn't want to do that)
>

-- 
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] Re: Scheduler, modules, and database calls

2014-08-05 Thread Bilal Hasan
Another question, is there any implication in sending db as a parameter to 
a module?

On Sunday, August 3, 2014 2:45:16 PM UTC-5, Niphlod wrote:
>
> there's nothing different in running the function in the web2py shell. 
> global variables defined in models are available in the scheduler.
>
> On Friday, August 1, 2014 11:36:36 PM UTC+2, Bilal Hasan wrote:
>>
>> So I'm trying to set up a scheduler, which makes calls to the module. 
>> Problem is, it keeps failing. And since it's the scheduler, it's super hard 
>> to debug if not almost impossible.
>>
>> Within the module, it makes db calls.
>>
>> Now since db is a global variable, which module CANNOT access. I have to 
>> pass in db through its function calls.
>>
>> So I have that part figured out. My question is, when scheduler runs its 
>> function, does it have accses to the same global db instance that's a part 
>> of web2py?
>>
>> Since scheduler runs on its own process I have reason to believe whenever 
>> scheduler runs, it doesn't have access to db, request, etc.
>>
>> Any ideas on what's a good way of going about running a scheduler that 
>> calls a function in a module which makes calls to the database using the 
>> global db variable.
>>
>

-- 
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] Re: PeerQuiz

2014-08-05 Thread Massimo Di Pierro
It is not open source.

On Sunday, 3 August 2014 12:29:42 UTC-5, eric cuver wrote:
>
> hello ,
>
> everybody,
> i looking for peerquiz web2py source http://vimeo.com/83536698  . i dont 
> find in github. 
> somebody know where i can find it ?
>
> thanks
>
>

-- 
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] Re: Multiple Routes - Same App

2014-08-05 Thread Massimo Di Pierro
No because by the time the controller is executed the the request went 
through the routes.

On Saturday, 2 August 2014 17:29:05 UTC-5, Michael Gheith wrote:
>
> Is there way to programmatically set a path prefix in a controller rather 
> than in routes.py?
>
> Best,
> Michael Joseph Gheith
>
> On Tuesday, July 29, 2014 4:47:17 PM UTC-5, Michael Gheith wrote:
>>
>> Hello,
>>
>> I rewrote what you had Massimo as the following (and it compiled just 
>> fine):
>>
>> routes_in =  [('/sam/(?P\w+)/$a/$c/$f', '/$a/$c/$f/\g')]
>>
>> routes_out =  [('/$a/$c/$f/(?P)', '/sam/\g/$a/$c/$f')]
>>
>>
>> I see what you are trying to do - although it's still not producing the 
>> desired result unfortunately :(
>>
>>
>> Further guidance would be much appreciated!  Anthony, where are you on 
>> this one, I need your help man!
>>
>>
>>
>> Kindest of regards,
>>
>> Michael Joseph Gheith
>>
>> On Wednesday, July 23, 2014 11:41:29 AM UTC-5, Michael Gheith wrote:
>>>
>>> What I'm trying to do is to have my application serve 2 different 
>>> customers via URLs like the following:
>>>
>>> http://127.0.0.1:8000/sam/client1//default/index
>>> http://127.0.0.1:8000/sam/client2//default/index
>>>
>>>
>>> My routes.py looks like:
>>>
>>> routes_in =  (
>>>
>>>   ('/sam/client1/$a/$c/$f', '/$a/$c/$f'), (
>>> '/sam/client2/$a/$c/$f', '/$a/$c/$f')
>>>
>>>  )
>>>
>>>
>>> routes_out = (
>>>
>>>   ('/$a/$c/$f', '/sam/client1/$a/$c/$f'), ('/$a/$c/$f', 
>>> '/sam/client2/$a/$c/$f')
>>>
>>>  )
>>>
>>>
>>> This works great for client1.  The minute I use client2 the links use 
>>> client1 mappings in the URL.  I'm using the URL function for all my links. 
>>>  Any ideas what I'm doing wrong?  Perhaps this is an issue with web2py? 
>>>  Please advise.
>>>
>>>
>>> Thanks in advance!
>>> M.G.
>>>
>>

-- 
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] Select table's fields to be displayed in views

2014-08-05 Thread Kuba Kozłowicz
I'd like to display more fields for a few particular tables in my system or 
to be able to control exactly which fields will be displayed. I want it to 
be available in following compontents:
- list of tables' entries ( I am using smartgrid )
- view page ( I am using the default view-page )
- edit page ( I am using the default edit-page )

I also want user to be able to search/filter by these fields, that I am 
going to add. 

I tried playing with 'fields' attribute of smartgrid function, but I did 
not manage to get it working. Basically I want to get Date fields like 
'created_on', 'modified_on', which are created by default for every table, 
but not displayed by default and hide some fields specified by myself, but 
that are not necessarly so important to be displayed.

How can I do that?

-- 
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] Re: Scheduler, modules, and database calls

2014-08-05 Thread Bilal Hasan
Also does current from gluon work in a module function that's being called 
from a scheduler?

On Sunday, August 3, 2014 2:45:16 PM UTC-5, Niphlod wrote:
>
> there's nothing different in running the function in the web2py shell. 
> global variables defined in models are available in the scheduler.
>
> On Friday, August 1, 2014 11:36:36 PM UTC+2, Bilal Hasan wrote:
>>
>> So I'm trying to set up a scheduler, which makes calls to the module. 
>> Problem is, it keeps failing. And since it's the scheduler, it's super hard 
>> to debug if not almost impossible.
>>
>> Within the module, it makes db calls.
>>
>> Now since db is a global variable, which module CANNOT access. I have to 
>> pass in db through its function calls.
>>
>> So I have that part figured out. My question is, when scheduler runs its 
>> function, does it have accses to the same global db instance that's a part 
>> of web2py?
>>
>> Since scheduler runs on its own process I have reason to believe whenever 
>> scheduler runs, it doesn't have access to db, request, etc.
>>
>> Any ideas on what's a good way of going about running a scheduler that 
>> calls a function in a module which makes calls to the database using the 
>> global db variable.
>>
>

-- 
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] Web2py With Pycharm project on remote Server

2014-08-05 Thread NOSSOLUTIONS
Hi All,
Sorry for disturb.
I've a question regarding Web2py on Pycharm IDE. I wonder if is possible to 
create a new web2py project on Pycarm an work on remote server?
thanks a lot.


-- 
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] help

2014-08-05 Thread ROHIT NEGI
Hi
I am new to web2py and I'm quite confused as to how I will be able to 
deploy application on web? Even if I make a web2py app, how will I be able 
to make a site from it as I'm making apps on the web2py site?

-- 
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] How to make so that the "client" database "address" took 'Id' database "client".

2014-08-05 Thread Капылов Данил
*How to make so that the "client" database "address" took 'Id' database 
"client". And attached to her **This example is taken from the chapter of a 
book  *One form for multiple tables 


db.define_table('client',
 Field('name'))
db.define_table('address',
Field('client','reference client',
  writable=False,readable=False),
Field('street'),Field('city'))


def register():
form=SQLFORM.factory(db.client,db.address)
if form.process().accepted:
id = db.client.insert(**db.client._filter_fields(form.vars))
form.vars.client=id
id = db.address.insert(**db.address._filter_fields(form.vars))
response.flash='Thanks for filling the form'
return dict(form=form)



-- 
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] Re: Upload field custom manipulation

2014-08-05 Thread Kuba Kozłowicz
What does "writable=false if forms" mean and WHAT should I apply this to?

And where should I plug this "URL('mydownload', ... ) into? Sorry, but I 
understand if you just write some web2py-specific code completely out of 
contex. It requires some explanation.

W dniu niedziela, 3 sierpnia 2014 00:22:57 UTC+2 użytkownik Massimo Di 
Pierro napisał:
>
> Than it is easy. make it writable=false if forms.
> Store your filename in the the upload field. But instead of
>
> URL('download',)
>
> use
>
> URL('mydownload',)
>
>
> Where:
>
> def mydownload():
>  fullname = os.path.join(os.path.join, 'private', request.args(0))
>  response.stream(fullname)
>
>
> On Wednesday, 30 July 2014 03:00:48 UTC-5, Kuba Kozłowicz wrote:
>>
>> f_invoice_file_path is location where the file is stored by myself, 
>> because I generate these files myself and I save them myself as well. It 
>> contains whole path to the file ( with the filename and its extension ). 
>> They are stored under "private" directory with the structure I described 
>> above. I don't need web2py to handle writing of these files ( because I am 
>> doing it myself ), I just need to be able to browse and download these file 
>> in SMART GRID as well as on VIEW page. And since I don't use default web2py 
>> storing mechanism ( which does some name changing ) I can't simply do that 
>> or I don't know how to do it.
>>
>> W dniu wtorek, 29 lipca 2014 17:35:02 UTC+2 użytkownik Massimo Di Pierro 
>> napisał:
>>>
>>> Let me understand this better f_invoice_file_path is the location where 
>>> the file is supposed to be stored or is it the full path including the 
>>> desired filename? Do you handle the file writing or should web2py do it 
>>> automatically?
>>>
>>>
>>> On Tuesday, 29 July 2014 05:59:10 UTC-5, Kuba Kozłowicz wrote:

 I have three tables:

 - invoices
 - invoice summaries
 - invoice bundles

 The website I am working on provides such a functionality, that user 
 uploads a file, from which invoices and invoice summaries are generated 
 and 
 after being generated they are zipped and put into a bundle.

 For each upload I create following structure for storing these files:

 invoices/
  //>/
 summaries/
  //>/
 bundles/
  //>/



 So I end up having something that looks like this

 invoices/
  /1//
 /invoice1.pdf
 /invoice2.pdf
  /2//
 /invoice1.pdf
 /invoice2.pdf
  /3//
 /invoice1.pdf
 /invoice2.pdf
 summaries/
  /1//
 /summary1.pdf
  /2//
 /summary1.pdf
  /3//
 /summary1.pdf
 bundles/
  /1//
 /bundle.zip
  /2//
 /bundle.zip
  /3//
 /bundle.zip




 where inner folder name is ID of recently created bundle.

 Now to provide CRUD functionality I am using SMART GRID and I want to 
 be able to display the file of invoice, summary, bundle entries ( by 
 displaying I mean I want to display file's name and allow downloading it 
 ), 
 when a user either chooses VIEW in the SMART GRID or when he looks at the 
 list of entries. Since I've chosen my own folder structure for storing 
 these invoices, summaries and bundles I can't do it in a simple way, 
 because Web2py uses its own mechanism to store and retrieve files and 
 changse file's name. So in each of these tables I store the following 
 fields:
 Field('f_invoice_file_path', type='string')
 Field('f_invoice_file', 'upload')



 what I wanted to do is something like this:

 def on_before_insert_invoice(fields, id):
 db(db.t_invoice.id == id).update(
 f_invoice_file=fields['f_invoice_file_path']
 )
 db.t_invoice._before_insert.append(
 on_before_insert_invoice
 )

 , here actually *fields* contains a list of tuples in following format 
 (field, value) so I had to iterate over it to find fields[
 'f_invoice_file_path'], I just omitted this part for brevity.

 , but I get following error and most likely it is not the proper way to 
 do that:

 *** RuntimeError: Unable to handle upload

 Note that the field:

 Field('f_invoice_file_path', type='string')

 is saved correctly, I just need somehow to make upload field point to 
 that location. The next weird thing is that variable *fields* doesn't 
 contain field Field('f_invoice_file', 'upload')
 , even though I added it to the model, settings.migrate is set to True, 
 and server has been restarted.

 How can I do it?









-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.c

[web2py] template de instalação de aplicação web2py no windows

2014-08-05 Thread Hains Hausmann Junior
Olá!

Estou tentando fazer (ou encontrar um exemplo) um template de um instalador 
de aplicações we2py para windows.
Quero instalar o web2py, a aplicação desenvolvida (compilada em pyc), e um 
servidor web melhor, (exemplo nginx) que não seja o do web2py.
Rodar o servidor web com a aplicação web2py como serviço ou rodar de outra 
forma em background com um ícone na bandeja do sistema e iniciar junto com 
o windows.

O inno setup tem resolvido alguns problemas, e provavelmente irá resolver 
os outros, mas gostaria da opinião do pessoal,
se alguém já fez algo parecido, se tem algumas dicas de de como montar a 
stack servidor/app, exemplos de configurações padrões 
para casos genérico de sistema CRUD.

Quero fazer um instalador para uma aplicação pequena de CRUD 
(inicialmente), que vai ser instalado no windows,
e usado tanto local como remoto por apenas algum usuários.

Se alguém tiver algumas dicas ou exemplo, ficarei agradecido.
Att
Hains

-- 
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] applications/app/languages

2014-08-05 Thread Carl Hunter Roach
Each file in applications/app/languages has a line:
# -*- coding: utf8 -*-

I've had to ammend this to:
# -*- coding: utf-8 -*-

otherwise an exception is thrown in \Python\lib\encodings\utf_8.py (see 
below).

utf-8 is the standard term rather than utf8.

My question: does anyone know why all the language files in Web2py are 
parsed when using GAE Search? It'd be good if I could get the system to 
skip this step.

Exception stack...

  File 
"F:\projects\workspace\jupiter\applications\jupiterapi\controllers/default.py", 
line 276, in 

  File "F:\projects\workspace\jupiter\gluon\globals.py", line 385, in 


self._caller = lambda f: f()

  File 
"F:\projects\workspace\jupiter\applications\jupiterapi\controllers/default.py", 
line 107, in results

options=options)

  File "applications\jupiterapi\modules\indexer\indexer.py", line 42, in 
searchWithOptions

resultObj = index.search(query)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\datastore\datastore_rpc.py", 
line 103, in positional_wrapper

return wrapped(*args, **kwds)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
2802, in search

return self._NewSearchResults(response, cursor)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
2678, in _NewSearchResults

result_pb.expression_list(), per_result_cursor))

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
2663, in _NewScoredDocumentFromPb

expressions=_NewFieldsFromPb(expressions), cursor=cursor)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
1327, in _NewFieldsFromPb

return [_NewFieldFromPb(f) for f in field_list]

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
1140, in _NewFieldFromPb

value = _DecodeValue(_GetValue(pb.value()), val_type)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
1132, in _DecodeValue

return _DecodeUTF8(pb_value)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
1125, in _DecodeUTF8

return pb_value.decode('utf-8')

  File "C:\Python\lib\encodings\utf_8.py", line 16, in decode

return codecs.utf_8_decode(input, errors, True)

-- 
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] Re: Upload field custom manipulation

2014-08-05 Thread Kuba Kozłowicz
Ok so I've already figured out what you meant.

I should set 'writable' attribute of this field in db_wizard.py to False in 
order to prevent this field from being overwritten in forms. Then change 
type from 'string' to 'upload'  and apply URL('mydownload') to 'represent' 
attribute of this field and then specify 'mydownload' function in 
controllers. Complete solution looks like this now:

db_wizard.py
db.define_table('t_invoice',
Field('f_invoice_file_path', type='upload', writable=False,
  label=T('Invoice File')),

db.t_invoice.f_invoice_file_path.represent = lambda value, row: A('Download'
, _class='download_btn', _href=URL('mydownload', args=value))

controllers/management.py
def mydownload():
fullname = request.raw_args
response.stream(fullname)

Thanks for help!

W dniu niedziela, 3 sierpnia 2014 00:22:57 UTC+2 użytkownik Massimo Di 
Pierro napisał:
>
> Than it is easy. make it writable=false if forms.
> Store your filename in the the upload field. But instead of
>
> URL('download',)
>
> use
>
> URL('mydownload',)
>
>
> Where:
>
> def mydownload():
>  fullname = os.path.join(os.path.join, 'private', request.args(0))
>  response.stream(fullname)
>
>
> On Wednesday, 30 July 2014 03:00:48 UTC-5, Kuba Kozłowicz wrote:
>>
>> f_invoice_file_path is location where the file is stored by myself, 
>> because I generate these files myself and I save them myself as well. It 
>> contains whole path to the file ( with the filename and its extension ). 
>> They are stored under "private" directory with the structure I described 
>> above. I don't need web2py to handle writing of these files ( because I am 
>> doing it myself ), I just need to be able to browse and download these file 
>> in SMART GRID as well as on VIEW page. And since I don't use default web2py 
>> storing mechanism ( which does some name changing ) I can't simply do that 
>> or I don't know how to do it.
>>
>> W dniu wtorek, 29 lipca 2014 17:35:02 UTC+2 użytkownik Massimo Di Pierro 
>> napisał:
>>>
>>> Let me understand this better f_invoice_file_path is the location where 
>>> the file is supposed to be stored or is it the full path including the 
>>> desired filename? Do you handle the file writing or should web2py do it 
>>> automatically?
>>>
>>>
>>> On Tuesday, 29 July 2014 05:59:10 UTC-5, Kuba Kozłowicz wrote:

 I have three tables:

 - invoices
 - invoice summaries
 - invoice bundles

 The website I am working on provides such a functionality, that user 
 uploads a file, from which invoices and invoice summaries are generated 
 and 
 after being generated they are zipped and put into a bundle.

 For each upload I create following structure for storing these files:

 invoices/
  //>/
 summaries/
  //>/
 bundles/
  //>/



 So I end up having something that looks like this

 invoices/
  /1//
 /invoice1.pdf
 /invoice2.pdf
  /2//
 /invoice1.pdf
 /invoice2.pdf
  /3//
 /invoice1.pdf
 /invoice2.pdf
 summaries/
  /1//
 /summary1.pdf
  /2//
 /summary1.pdf
  /3//
 /summary1.pdf
 bundles/
  /1//
 /bundle.zip
  /2//
 /bundle.zip
  /3//
 /bundle.zip




 where inner folder name is ID of recently created bundle.

 Now to provide CRUD functionality I am using SMART GRID and I want to 
 be able to display the file of invoice, summary, bundle entries ( by 
 displaying I mean I want to display file's name and allow downloading it 
 ), 
 when a user either chooses VIEW in the SMART GRID or when he looks at the 
 list of entries. Since I've chosen my own folder structure for storing 
 these invoices, summaries and bundles I can't do it in a simple way, 
 because Web2py uses its own mechanism to store and retrieve files and 
 changse file's name. So in each of these tables I store the following 
 fields:
 Field('f_invoice_file_path', type='string')
 Field('f_invoice_file', 'upload')



 what I wanted to do is something like this:

 def on_before_insert_invoice(fields, id):
 db(db.t_invoice.id == id).update(
 f_invoice_file=fields['f_invoice_file_path']
 )
 db.t_invoice._before_insert.append(
 on_before_insert_invoice
 )

 , here actually *fields* contains a list of tuples in following format 
 (field, value) so I had to iterate over it to find fields[
 'f_invoice_file_path'], I just omitted this part for brevity.

 , but I get following error and most likely it is not the proper way to 
 do that:

 *** RuntimeError: Unable to handle upload

 Note that the field

[web2py] Re: Encoding and 'invalid argument'

2014-08-05 Thread Rémy Reche
I agree with you, but it is web2py (gluon) which process the arguments. 
This error occurs before entering my function.

On Friday, August 1, 2014 9:27:47 PM UTC+2, Derek wrote:
>
> Well, before you process the arguments, you would want to encode it as 
> utf-8. See here: 
> https://groups.google.com/forum/#!msg/web2py/B_EOmprbjO0/kMEHiiCrmYEJ
>
> URLs get converted into punycode if they are not ascii, so that wouldn't 
> be an issue.
>
> On Thursday, July 31, 2014 2:33:56 AM UTC-7, Rémy Reche wrote:
>>
>> I am using the decorator @request.restful() in order to implement a rest 
>> API. Unfortunatly, one on my function take an argument which can contain 
>> non-ascii character, for instance 'Gymnase Joseph Guétat'. Each request 
>> using this string returns a web2py error with the following comment: 
>> invalid arg . Is this an issue with the url 
>> encoding/decoding mechanism ? a routing issue ? How can I solve this 
>> problem ?
>>
>> Thanks,
>>
>> Rémy
>>
>

-- 
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] TypeError: 'NoneType' object is not callable

2014-08-05 Thread Marco
Hi,

 I have followed your tutorial for the RESTful api.
 I am getting the following error though on POST.
 
 Here is the code snippet:

*def POST(table_name,**vars):*

*return db[table_name].validate_and_insert(**vars)*


 Here is the db model


* db.define_table("entries", Field("entry", "text"))*

 And here is the way I call it


curl  -d "entry=322332" http://127.0.0.1:8080/api/default/api/entries.json


The database operation works just fine. I see the entry created in the 
table.

But I would like the script to return the id of the created entry and it is 
right now throwing an exception instead.


This is for the Google App Engine developer environment of Web2Py.


marcos-mbp:google_appengine marco$ 

marcos-mbp:google_appengine marco$ python dev_appserver.py ../web2py-3

INFO 2014-08-04 15:47:46,373 sdk_update_checker.py:242] Checking for 
updates to the SDK.

WARNING  2014-08-04 15:47:46,731 api_server.py:383] Could not initialize 
images API; you are likely missing the Python "PIL" module.

INFO 2014-08-04 15:47:46,736 api_server.py:171] Starting API server at: 
http://localhost:51723

INFO 2014-08-04 15:47:46,746 dispatcher.py:182] Starting module 
"default" running at: http://localhost:8080

INFO 2014-08-04 15:47:46,755 admin_server.py:117] Starting admin server 
at: http://localhost:8000

INFO 2014-08-04 15:48:36,673 gaehandler.py:75]  Request: 
140.07ms/123.83ms (real time/cpu time)

ERROR2014-08-04 15:48:36,674 cgi.py:121] Traceback (most recent call 
last):

  File "/Users/marco/Downloads/web2py-3/gaehandler.py", line 112, in 


main()

  File "/Users/marco/Downloads/web2py-3/gaehandler.py", line 109, in main

run_wsgi_app(wsgiapp)

  File 
"/Users/marco/Downloads/google_appengine/google/appengine/ext/webapp/util.py", 
line 98, in run_wsgi_app

run_bare_wsgi_app(add_wsgi_middleware(application))

  File 
"/Users/marco/Downloads/google_appengine/google/appengine/ext/webapp/util.py", 
line 123, in run_bare_wsgi_app

result.close()

TypeError: 'NoneType' object is not callable



 Any hints would be appreciated.


tks


-- 
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] Working with MSSQL with codepage other than latin1 or unicode

2014-08-05 Thread Алексей Котряхов

Hello web2pyers

I have a problem with encoding when I work with MSSQL with codepage other 
than latin1 or unicode
Here is my DB connection

dbsol = DAL 
('mssql://user:password@w2ptkts/SacuraOnline',
 db_codec = 'cp1251', migrate_enabled = False)

I'm successfully read and and view any tables from my DB.
But when I try to write to my DB, I see strange behavior, like occuring 
unwanted (or excessive) encoding.

Here is example



Also got an error while saving the profile with Cyrillic letters



I got the following ticket

Error ticket for "tkts"Ticket ID

127.0.0.1.2014-08-04.14-39-38.9ab5fa77-867f-4e5d-b1c6-67b8e8e66e76
 'charmap' codec can't encode characters 
in position 0-5: character maps to Версияweb2py™Version 
2.9.5-trunk+timestamp.2014.03.29.21.54.41PythonPython 2.7.6: 
C:\Python27\python.exe (prefix: C:\Python27)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 220, in restricted
exec ccode in environment
  File "C:/web2py/applications/tkts/controllers/default.py" 
, line 
93, in 
  File "C:\web2py\gluon\globals.py", line 385, in 
self._caller = lambda f: f()
  File "C:/web2py/applications/tkts/controllers/default.py" 
, line 
55, in user
return dict(form=auth())
  File "C:\web2py\gluon\tools.py", line 1362, in __call__
return getattr(self, args[0])()
  File "C:\web2py\gluon\tools.py", line 3112, in profile
hideerror=self.settings.hideerror):
  File "C:\web2py\gluon\sqlhtml.py", line 1610, in accepts
self.id_field_name]).update(**fields)
  File "C:\web2py\gluon\dal.py", line 10553, in update
ret = db._adapter.update("%s" % table._tablename,self.query,fields)
  File "C:\web2py\gluon\dal.py", line 1612, in update
sql = self._update(tablename, query, fields)
  File "C:\web2py\gluon\dal.py", line 1607, in _update
for (field, value) in fields])
  File "C:\web2py\gluon\dal.py", line 1552, in expand
return str(self.represent(expression,field_type))
  File "C:\web2py\gluon\dal.py", line 3519, in represent
return BaseAdapter.represent(self, obj, fieldtype)
  File "C:\web2py\gluon\dal.py", line 2061, in represent
obj = obj.decode('latin1').encode(self.db_codec)
  File "C:\Python27\Lib\encodings\cp1251.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-5: 
character maps to 

Error snapshot [image: help] 


('charmap' codec can't encode 
characters in position 0-5: character maps to )

inspect attributes
Frames
   
   - 
   
   *File C:\web2py\gluon\restricted.py in restricted at line 220* код 
   аргументы переменные
   - 
   
   *File C:\web2py\applications\tkts\controllers\default.py in  at 
   line 93* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\globals.py in  at line 385* код аргументы 
   переменные
   - 
   
   *File C:\web2py\applications\tkts\controllers\default.py in user at line 
   55* код аргументы переменные
   - 
   
   *File C:\web2py\gluon\tools.py in __call__ at line 1362* код аргументы 
   переменные
   - 
   
   *File C:\web2py\gluon\tools.py in profile at line 3112* код аргументы 
   переменные
   - 
   
   *File C:\web2py\gluon\sqlhtml.py in accepts at line 1610* код аргументы 
   переменные
   - 
   
   *File C:\web2py\gluon\dal.py in update at line 10553* код аргументы 
   переменные
   - 
   
   *File C:\web2py\gluon\dal.py in update at line 1612* код аргументы 
   переменные
   - 
   
   *File C:\web2py\gluon\dal.py in _update at line 1607* код аргументы 
   переменные
   - 
   
   *File C:\web2py\gluon\dal.py in expand at line 1552* код аргументы 
   переменные
   - 
   
   *File C:\web2py\gluon\dal.py in represent at line 3519* код аргументы 
   переменные
   - 
   
   *File C:\web2py\gluon\dal.py in represent at line 2061* код аргументы 
   переменные
   - 
   
   *File C:\Python27\Lib\encodings\cp1251.py in encode at line 12* код 
   аргументы переменные
   Function argument list
   
   (self=, input=u'\xd0\x97\xd0\x90\xd0\x9e 
   "\xd0\x98\xd0\xbd\xd1...d1\x80\xd0\xb8\xd1\x81\xd1\x82-\xd0\x94\xd0\x92"', 
   errors='strict')
   Code listing
   
   7.
   8.
   9.
   10.
   11.
   12.
   
   13.
   14.
   15.
   16.
   
   ### Codec APIs
   
   class Codec(codecs.Codec):
   
   def encode(self,input,errors='strict'):
 

[web2py] DAL using Mysql.server on pythonanywhere is not working. Giving errors

2014-08-05 Thread Gideon George
Please I need somebody to help me make my site visible by telling me what 
to do to make my database connection work on the pythonanywhere.com remote 
server
I have tried all I could but never seems to get close.

This is how I did it from the pythonanywhere database dashboard and below 
to is my DAL connection in db.py
MySQL Database host address:mysql.serverDatabase username:my_username
Database   my_username$ 

dbname 


db = DAL('mysql://my_username$:my_password@mysql.server/my_username$dbname')





Please somebody should help me out. I need this site to be online 
www.homeler.com.ng without errors

-- 
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] Re: Add (customer) number to url

2014-08-05 Thread Jim S
Are you looking for multi-tenancy?

If so, this may help

http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Common-fields-and-multi-tenancy

I haven't used it but seems like it should help.

-Jim


On Tuesday, August 5, 2014 1:53:49 AM UTC-5, Eric wrote:
>
> Hi Derek,
>
> Thank you for your reaction!
>
> I did read the manual, but I could not find the solution that I needed. 
> That's why I asked what I asked ;)
>
> Let me see if this is solution we can work with. 
>
>
>
> Op vrijdag 1 augustus 2014 00:30:22 UTC+2 schreef Derek:
>>
>> RTFM 
>>
>>
>> http://www.web2py.com/books/default/chapter/29/04/the-core#Dispatching
>>
>> web2py maps GET/POST requests of the form:
>>
>> http://127.0.0.1:8000/a/c/f.html/x/y/z?p=1&q=2
>>
>> to function f in controller "c.py" in application a, and it stores the 
>> URL parameters in the request variable as follows:
>>
>> request.args = ['x', 'y', 'z']
>>
>>
>> so you could say /a/c/f.html/customernumber and customernumber would be 
>> request.args[0]
>> On Wednesday, July 30, 2014 2:53:34 AM UTC-7, Eric wrote:
>>>
>>> Hi,
>>>
>>> We need a way to get the customer number into web2py by it's url so we 
>>> can display the corresponding data to the visitor. To keep it easy for the 
>>> visitor this number needs to be visible in every url.
>>>
>>> Since the site runs under SSL and we don't want to buy another SSL 
>>> certificate, we're looking for a different solution, so this isn't an 
>>> option:
>>> https://.sub.domain.com
>>>
>>> That would be the easy way :)
>>>
>>> I was looking at the routers, but I can't figure out how to do something 
>>> like this in an router and have  available in the Python scripts:
>>> https://sub.domain.com//c/f/a?vars=example
>>>
>>> Is here anyone with an idea how to create this and have the "" 
>>> accessible in Python? The  is a dynamic value, so zero maintenance 
>>> in the routes would be really, really nice ;)
>>>
>>> The number can probably be retrieved from the HTTP_HOST that is 
>>> available in Web2Py, but how to handle the number in a router? I've tried 
>>> this, but that's not working:
>>>
>>> # # -*- coding: utf-8 -*-
>>>
>>> default_controller = 'default'
>>> default_function = 'index'
>>>
>>> routers = dict(
>>>BASE=dict(default_application='app',
>>>map_static=True,
>>>map_hyphen=True)
>>> )
>>>
>>> routes_in = (
>>>  # Keep admin working
>>>  ('/admin', '/admin'),
>>>  ('/admin/$anything', '/admin/$anything'),
>>>
>>>  # Keep appadmin working
>>>  ('/$app/appadmin', '/$app/appadmin'),
>>>  ('/$app/appadmin/$anything', '/$app/appadmin/$anything'),
>>>
>>>  ('/$app/$number/$anything', '/$app/$anything'),
>>>
>>> )
>>>
>>> routes_out = [(x, y) for (y, x) in routes_in]
>>>
>>> Thanks for the input!
>>>
>>

-- 
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.


Re: [web2py] Restful authentication and CORS

2014-08-05 Thread Albert Abril
Hi Christian,

I'm trying to set up my app as a oauth2 provider too,
did you use https://github.com/SamuelMarks/web2py-oauth2 , or another
source? do you have any tutorials or documentation about it? I'll
appreciate it so much.

Cheers,
Albert.


On 29 May 2013 00:21, Christian Foster Howes  wrote:

> i have configured my system to be an oauth provider and added a decorator
> to all RESTful calls to validate the oauth signature.  yes, i do this on
> each request that i require authentication for.
>
>
> On Tuesday, May 28, 2013 6:01:11 AM UTC-7, Ruben D. Orduz wrote:
>
>> Yes, most REST patterns I've seen are handled either by http basic auth
>> or else request signing. Either option requires handling that on each call.
>>
>>
>> On Tue, May 28, 2013 at 4:54 AM, Michele Comitini 
>> wrote:
>>
>>>  REST is stateless so you should not rely on session, hence you can use
>>>
>>> auth.settings.allow_basic_login = True
>>>
>>> see here
>>> http://web2py.com/books/default/chapter/29/10#Access-Control
>>>
>>> for proper (as per RFC) authentication challenge with realm use:
>>>
>>> @auth.basich(basic_auth_real=)
>>>
>>> An alternative is to pass an argument or a parameter with authencation
>>> info and use
>>> auth.login_bare
>>>
>>> Anyway you must pass authentication info with each call since being the
>>> service stateless the server has no way to recognize the client.
>>>
>>> mic
>>>
>>>
>>> 2013/5/27 Ray (a.k.a. Iceberg) 
>>>
 Hi Alec,

 On Tuesday, July 17, 2012 1:03:04 AM UTC+8, Alec Taylor wrote:
>
> On Tue, Jul 17, 2012 at 2:20 AM, David Marko 
> wrote:
> > +1 from me having this. Btw. On client side i'm using AngularJS and
> Trigger.io (instead of PhoneGap)
>
> I've been looking around, and will have one of the following setups:
>
>- *AngularJS * with *BarristerRPC
>*
>- *BackboneJS * with *Backbone.Rpc
>*
>- *JQuery mobile*  with *jquery-jsonrpc*
> (or plain
>JSON.stringify)
>
> All within a *PhoneGap * (*Apache Cordova
> *) app using the* Facebook
> connect plugin
> *
> for authentication (for graceful downgrade from Facebook mobile app
>  to Facebook website auth
> ).
>
> I should have a PoC 
> on August 2 with a full backend written in web2py and two frontends (one 
> in
> web2py views; the other in one of the above frameworks).
>
> Subsequently I'll release it under a full open-source license onto
> Bitbucket. I'll post to the web2py list with link + slides when the repo 
> is
> live
>

 Sorry for late response. I am a web2py veteran who dives into restful
 world only recently. Do you have any finding to share about the restful
 authentication in web2py? Thanks in advance!

 Regards,
 Ray

 --

 ---
 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+un...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.



>>>
>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/
>>> topic/web2py/FyxbO0WGMhU/unsubscribe?hl=en.
>>>  To unsubscribe from this group and all its topics, send an email to
>>> web2py+un...@googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>
> ---
> 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/groups/opt_out.
>
>
>

-- 
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] Re: response.js does not load div

2014-08-05 Thread Richard
Niphlod ,

Thank you for the support. It appeared that I did not make an ajax call; in 
the controller request.ajax was False. This was because a simple form in a 
view does not generate an ajax call. Is this correct?

if form1.process(formname='form_one').accepted:
response.js= "web2py_component('%s','graph1')" % URL('default','graph1') 

So now I can generate successive forms and graphs. 

On Monday, August 4, 2014 10:08:37 PM UTC+2, Niphlod wrote:
>
>
>
> On Monday, August 4, 2014 10:06:12 PM UTC+2, Niphlod wrote:
>>
>> too much code will kill you (yep, on the notes of the almighty Queen) ...
>>
>> maybe, but just maybe  try with $.web2py. instead of $web2py ^_^
>>
>>
> also, $.web2py.component() accepts a string as an url. If you open your 
> console you'll probably see the error involved...
>
> $.web2py.component('url', .)
>
> to be "valid", needs something like 
>
> response.js= '$web2py.component('"%s"', target="graph1");' % 
> URL('default', 'graph1.load')
>
> notice the red quotes
>

-- 
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] scheduler new feature: task dependencies

2014-08-05 Thread Niphlod
Hi @all,
   we have another feature in trunk for the scheduler... Jobs (i.e. task 
dependencies)

Directly from https://github.com/niphlod/w2p_scheduler_tests/ (that has 
been updated to accomodate the new feature explanation...)


What are "Jobs", you ask ? Well, it's a way to coordinate a set of tasks 
that have dependencies (what in Celery is called "Canvas").

As always, the Scheduler sticks to the basics. Every Job is considered to 
be a DAG (a  Directed Acyclic Graph 
).
Without going into silly details, every task can have one or more 
dependencies, but of course you can't have mutual dependencies among the 
same tasks.
If a "job" can't be represented as a DAG, then it can't be processed in its 
entirety. You can still queue it, but it won't ever complete (i.e. you 
could have a
  complete stall at the first task or just a task left on 100 queued...)

So... what can you do ?
Let's take a trivial example (there are a few based on mathematics, 
map/reduce, etc... but hey, this is an example!!!)
Suppose you need to create a job that describes what is needed to get 
dressed ( thanks to http://hansolav.net/sql/graphs.html )...

We have a few items to wear, and there's an "order" to respect...
Items are: watch, jacket, shirt, tie, pants, undershorts, belt, shoes, socks

Now, we can't put on the tie without wearing the shirt first, etc...





Suppose we have those tasks queued in a controller (for example's sake, the 
same function, with different task_name(s))...
watch = s.queue_task(fname, task_name='watch')
jacket = s.queue_task(fname, task_name='jacket')
shirt = s.queue_task(fname, task_name='shirt')
tie = s.queue_task(fname, task_name='tie')
pants = s.queue_task(fname, task_name='pants')
undershorts = s.queue_task(fname, task_name='undershorts')
belt = s.queue_task(fname, task_name='belt')
shoes = s.queue_task(fname, task_name='shoes')
socks = s.queue_task(fname, task_name='socks')


Now, there's a helper class to construct and validate a "job".
First, let's declare a job named "job_1"


#from gluon.scheduler import JobGraph
myjob = JobGraph(db, 'job_1')



Next, we'd need to establish dependencies


# before the tie, comes the shirt
myjob.add_deps(tie.id, shirt.id)
# before the belt too comes the shirt
myjob.add_deps(belt.id, shirt.id)
# before the jacket, comes the tie
myjob.add_deps(jacket.id, tie.id)
# before the belt, come the pants
myjob.add_deps(belt.id, pants.id)
# before the shoes, comes the pants
myjob.add_deps(shoes.id, pants.id)
# before the pants, comes the undershorts
myjob.add_deps(pants.id, undershorts.id)
# before the shoes, comes the undershorts
myjob.add_deps(shoes.id, undershorts.id)
# before the jacket, comes the belt
myjob.add_deps(jacket.id, belt.id)
# before the shoes, comes the socks
myjob.add_deps(shoes.id, socks.id)



Then, we can ask JobGraph if what we asked is a job that is accomplishable

myjob.validate('job_1')

And voilà, job done! If it's not a DAG, then an exception will be raised 
and the jobs won't be committed (of course their dependencies won't be 
committed too)

How it works under the hood ?

There's a new table called scheduler_task_deps that holds a reference to 
the job_name, the task parent, the task child and
a boolean to mark the "path" (the arrows in the graph) as "visitable".
To be fair, the job name isn't that important, you can have task 
dependencies amongst
different jobs, it's just not that easy to verify that the Job is a DAG at 
a later stage.
If a path is "visitable" it means that the DAG graph can be "walked" in 
that direction.
Every time a task gets "COMPLETED", the "paths" gets updated to be 
"visitable". The algo to pick up tasks has been updated
to work fetching only tasks that have no dependencies, or dependencies that 
have already been satisfied (i.e. tasks that depends
on nothing, or tasks that depend on tasks that are yet COMPLETED).


Let me know what you think, and if you spot bugs.



-- 
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] Re: web2py vs others. Status of 2014

2014-08-05 Thread Joe Barnhart
I look forward to Massimo's improvements.

One of the continuing thorns in my side is that a significant number of my 
users are still on XP and IE8 -- about 15% -- and my users are in 
California.  I can only imagine the ratio would be higher in middle America 
where the tall corn grows.  I could choose to ignore these users, but they 
have money to spend and I want to get it.

As we move to more client-heavy designs, it means more javascript and more 
chances that it won't run in antique computers.  I can't leave 15% of my 
revenue on the table.  

On the other hand, more and more of my users are on mobile platforms, which 
fits perfectly with the heavy client approach.

Agh!

-- Joe


On Monday, June 9, 2014 5:01:39 AM UTC-7, Ramos wrote:
>
> what is the status of the evolution of web2py compared with other, mainly 
> rails /or django ?
>
>
> which of these including web2py has gain more improvements over the last 
> year?
> Does anybody knows?
> Is still web2py over the others?
>
>
> From the beginning Massimo used the phrase
> "Ideas we had , ideas we stole"
>
> I would like to know if Massimo  is stealing more ideas from others.
> Also what new "Killer" ideas are we expecting for near future?
>
> Regards
>
> António
>  

-- 
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.