[web2py] Re: How to dont show seconds in a time field

2013-02-06 Thread Gerd


Am Donnerstag, 7. Februar 2013 00:20:02 UTC+1 schrieb DenesL:
>
>
>
> On Wednesday, February 6, 2013 8:24:01 AM UTC-5, Gerd wrote:
>>
>> Hi Annet and DenesL!
>>
>> @DenesL: Yes, did restart it, nothings changed
>>
>
> True. Note that the input will show HH:MM:SS until you click on it, then 
> it becomes HH:MM.
>

Thats what i described in the starting thread 

>  
>
>>
>> @Annet: Thanks you very much, you got it
>>
>> regards
>> Gerd
>>
>> Am Mittwoch, 6. Februar 2013 13:31:24 UTC+1 schrieb Annet:
>>>
>>> Hi Gerd,
>>>
>>> So if i understand this right there is no possibility to change the 
 representation in an update form?

>>>
>>>
>>> Yes, besides, I am not sure whether IS_TIME() has a format property like 
>>> IS_DATE() and IS_DATETIME() have.
>>> In 2009 it hadn't, and Chris helped me solve the problem as follows:
>>>
>>> In db.py:
>>>
>>> istime = dict(type='time',requires=IS_TIME(error_message=T('no match 
>>> HH:MM')),widget=timeplain,comment=T('Format HH:MM'))
>>>
>>> Field('startTime',**istime),
>>> Field('endTime',**istime),
>>>
>>> In a module:
>>>
>>> def timeplain(field,value): 
>>> if value == None: 
>>> value = ''
>>> elif 'strftime' in dir(value):
>>> value = value.strftime('%H:%M') 
>>> id = '%s_%s' % (field._tablename, field.name) 
>>> return INPUT(_type='text',_id=id,_class='time_plain',_name=
>>> field.name,value=str(value),requires=field.requires)
>>>
>>
> The only caveat here is that you will not be using jQuery.timeEntry, 
> unless you change the class to just 'time'.
> You can also do:
>
> widget=lambda field,value: SQLFORM.widgets.time.widget(field, 
> value.strftime('%H:%M') if value else '')
>
> but you still need to add {showSeconds:false} to .timeEntry in web2py.js
>
>
I see, thank you very much DenesL 

>  
>
>>
>>> and in case you need it, in a view:
>>>
>>>   {{=table.startTime.strftime("%H:%M")}}
>>>
>>>
>>> Kind regards,
>>>
>>> Annet
>>>
>>

-- 

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




Re: [web2py] Re: Forcing SSL mode (on GAE)

2013-02-06 Thread Philip Kilner

Hi,

On 06/02/13 20:45, howesc wrote:

if you want all requests in SSL it sounds like the best thing to me.



Yes, it's working very well from my PoV - but my needs are very simple 
in that I want to force SSL for everything. I'm used to doing this in 
Apache, so haven't previously had to think about it enforcing it within 
the app.


There was a browser-specific issue where e.g. Firefox worked 
immediately, but Chrome blocked the jQuery scripts from Google's CDN on 
the basis that they were insecure. Changing the link to the scripts to 
https sorted that.



note that on GAE if you want to use SSL and a custom domain you have to
purchase additional add-ons to the GAE service.  https on the
appspot.com domain is free.



Understood - I'm happy withe the appspot.com URL, FWIW.


--

Regards,

PhilK


'a bell is a cup...until it is struck'

--

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




[web2py] Re: Background M2M communication

2013-02-06 Thread Bernard
Thanks, it works.
Do I have to worry about s.close()?

On Wednesday, February 6, 2013 6:12:06 PM UTC-8, Massimo Di Pierro wrote:
>
> yes:
>
> def connect(address):
> socket.settimeout(10)
> s = socket.socket()
> return s.connect(address)
>
> mysocket = cache.ram('socket',lambda address=(ip,port): 
> connect(address),3600)
> mysocket.send('hello world')
>
> But mind that s.connect may block.
>
> On Wednesday, 6 February 2013 19:32:49 UTC-6, Bernard wrote:
>>
>> Is it possible to use cache.ram for a TCP socket?
>> In my setup, establishing a TCP connection to a remote machine is time 
>> consuming and I need to find a workaround to have snappier response to the 
>> Web UI.
>>
>> Any help appreciated.
>>
>> Thanks,
>> Bernard
>>
>> On Monday, February 4, 2013 11:46:22 AM UTC-8, Bernard wrote:
>>>
>>> Hi web2py users,
>>>I've been using web2py for a few months now, thank you to the 
>>> developers for the great work.
>>>
>>>I'm working on an interactive web based monitoring and control 
>>> Application that communicates with ~30 mobile field units at a time to get 
>>> periodic 'semi-realtime' status reports (2-5 second poll period) and allow 
>>> the user to change settings of the field units on demand.  The 
>>> communications channel is using TCP sockets: the web2py workstation end is 
>>> the TCP client and each field unit is running as a TCP server on an 
>>> embedded low performance field unit.  The front end is currently doing 
>>> periodic Ajax polling every 2 seconds and updating the GUI.  I also 
>>> would like to support multiple web users connected to the Application 
>>> on the front end.
>>>
>>>I've searched the mailing lists of web2py and other frameworks but 
>>> could not find a use case similar to mine.  There are many ways 
>>> implementing this, it's not easy to figure out which is best and what 
>>> pitfalls may lie ahead.
>>> Here are some of the approaches that I have considered:
>>> 1- Use a background asynchronous "Data Acquisition" task always running 
>>> and fills a "RealTime" table in the database (by polling all field units 
>>> every 2 seconds). For each web request, the controller would then pick up 
>>> the latest values from the database and serve them up to Web clients 
>>> without having to worry about pulling the data. The background task keeps 
>>> the sockets open to improve performance.
>>> 2- The controller communicates with the ~30 field units directly, 
>>> bypassing any database overhead. The controller needs a persistent 
>>> reference to the 30 TCP sockets to make the comms faster. Is there a way to 
>>> parallelize the TCP request/response in the request thread to 
>>> communicate with ~30 units quickly? To handle multiple Web users, I can 
>>> cache the controller function so that it doesn't run on every web client 
>>> request.
>>> 3- Have web2py controller communicate with a separate data acquisition 
>>> process 
>>> via message queues. The web2py parts would never deal with the low level 
>>> comms and the external data acquisition component would abstract all 
>>> that. However, this is at the expense of having to create an external 
>>> component and define the interface to it and adding a messaging framework 
>>> between web2py and the data acquisition process.
>>> 4- Controller kicks off a worker thread that collects the field unit 
>>> status. Controller function cached to avoid having a task for every web 
>>> request.
>>> 5- Other ideas that might be better suited to this application?
>>>
>>> If anybody has gone through something similar, can you please help with 
>>> your experience?
>>> If you see any issues or potential weaknesses in any of these 
>>> approaches, your feedback would be greatly appreciated.
>>>
>>> Regards,
>>> Bernard
>>>
>>>

-- 

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




[web2py] Re: Background M2M communication

2013-02-06 Thread Massimo Di Pierro
yes:

def connect(address):
socket.settimeout(10)
s = socket.socket()
return s.connect(address)

mysocket = cache.ram('socket',lambda address=(ip,port): 
connect(address),3600)
mysocket.send('hello world')

But mind that s.connect may block.

On Wednesday, 6 February 2013 19:32:49 UTC-6, Bernard wrote:
>
> Is it possible to use cache.ram for a TCP socket?
> In my setup, establishing a TCP connection to a remote machine is time 
> consuming and I need to find a workaround to have snappier response to the 
> Web UI.
>
> Any help appreciated.
>
> Thanks,
> Bernard
>
> On Monday, February 4, 2013 11:46:22 AM UTC-8, Bernard wrote:
>>
>> Hi web2py users,
>>I've been using web2py for a few months now, thank you to the 
>> developers for the great work.
>>
>>I'm working on an interactive web based monitoring and control 
>> Application that communicates with ~30 mobile field units at a time to get 
>> periodic 'semi-realtime' status reports (2-5 second poll period) and allow 
>> the user to change settings of the field units on demand.  The 
>> communications channel is using TCP sockets: the web2py workstation end is 
>> the TCP client and each field unit is running as a TCP server on an 
>> embedded low performance field unit.  The front end is currently doing 
>> periodic Ajax polling every 2 seconds and updating the GUI.  I also 
>> would like to support multiple web users connected to the Application on 
>> the front end.
>>
>>I've searched the mailing lists of web2py and other frameworks but 
>> could not find a use case similar to mine.  There are many ways 
>> implementing this, it's not easy to figure out which is best and what 
>> pitfalls may lie ahead.
>> Here are some of the approaches that I have considered:
>> 1- Use a background asynchronous "Data Acquisition" task always running 
>> and fills a "RealTime" table in the database (by polling all field units 
>> every 2 seconds). For each web request, the controller would then pick up 
>> the latest values from the database and serve them up to Web clients 
>> without having to worry about pulling the data. The background task keeps 
>> the sockets open to improve performance.
>> 2- The controller communicates with the ~30 field units directly, 
>> bypassing any database overhead. The controller needs a persistent 
>> reference to the 30 TCP sockets to make the comms faster. Is there a way to 
>> parallelize the TCP request/response in the request thread to 
>> communicate with ~30 units quickly? To handle multiple Web users, I can 
>> cache the controller function so that it doesn't run on every web client 
>> request.
>> 3- Have web2py controller communicate with a separate data acquisition 
>> process 
>> via message queues. The web2py parts would never deal with the low level 
>> comms and the external data acquisition component would abstract all 
>> that. However, this is at the expense of having to create an external 
>> component and define the interface to it and adding a messaging framework 
>> between web2py and the data acquisition process.
>> 4- Controller kicks off a worker thread that collects the field unit 
>> status. Controller function cached to avoid having a task for every web 
>> request.
>> 5- Other ideas that might be better suited to this application?
>>
>> If anybody has gone through something similar, can you please help with 
>> your experience?
>> If you see any issues or potential weaknesses in any of these approaches, 
>> your feedback would be greatly appreciated.
>>
>> Regards,
>> Bernard
>>
>>

-- 

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




[web2py] Re: Background M2M communication

2013-02-06 Thread Bernard
Is it possible to use cache.ram for a TCP socket?
In my setup, establishing a TCP connection to a remote machine is time 
consuming and I need to find a workaround to have snappier response to the 
Web UI.

Any help appreciated.

Thanks,
Bernard

On Monday, February 4, 2013 11:46:22 AM UTC-8, Bernard wrote:
>
> Hi web2py users,
>I've been using web2py for a few months now, thank you to the 
> developers for the great work.
>
>I'm working on an interactive web based monitoring and control 
> Application that communicates with ~30 mobile field units at a time to get 
> periodic 'semi-realtime' status reports (2-5 second poll period) and allow 
> the user to change settings of the field units on demand.  The 
> communications channel is using TCP sockets: the web2py workstation end is 
> the TCP client and each field unit is running as a TCP server on an 
> embedded low performance field unit.  The front end is currently doing 
> periodic Ajax polling every 2 seconds and updating the GUI.  I also would 
> like to support multiple web users connected to the Application on the 
> front end.
>
>I've searched the mailing lists of web2py and other frameworks but 
> could not find a use case similar to mine.  There are many ways 
> implementing this, it's not easy to figure out which is best and what 
> pitfalls may lie ahead.
> Here are some of the approaches that I have considered:
> 1- Use a background asynchronous "Data Acquisition" task always running 
> and fills a "RealTime" table in the database (by polling all field units 
> every 2 seconds). For each web request, the controller would then pick up 
> the latest values from the database and serve them up to Web clients 
> without having to worry about pulling the data. The background task keeps 
> the sockets open to improve performance.
> 2- The controller communicates with the ~30 field units directly, 
> bypassing any database overhead. The controller needs a persistent 
> reference to the 30 TCP sockets to make the comms faster. Is there a way to 
> parallelize the TCP request/response in the request thread to communicate 
> with ~30 units quickly? To handle multiple Web users, I can cache the 
> controller function so that it doesn't run on every web client request.
> 3- Have web2py controller communicate with a separate data acquisition 
> process 
> via message queues. The web2py parts would never deal with the low level 
> comms and the external data acquisition component would abstract all 
> that. However, this is at the expense of having to create an external 
> component and define the interface to it and adding a messaging framework 
> between web2py and the data acquisition process.
> 4- Controller kicks off a worker thread that collects the field unit 
> status. Controller function cached to avoid having a task for every web 
> request.
> 5- Other ideas that might be better suited to this application?
>
> If anybody has gone through something similar, can you please help with 
> your experience?
> If you see any issues or potential weaknesses in any of these approaches, 
> your feedback would be greatly appreciated.
>
> Regards,
> Bernard
>
>

-- 

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




Re: [web2py] default function in a non default controller with args - routing

2013-02-06 Thread Francisco Costa
Right now using the Parameter-based system for routing if we want to define 
different default_function for each controller we must set a list of all 
controllers, and then a dictionary with a list of all functions in each 
controller.

blog=dict(
controllers=['posts', 'comments'],
functions=dict(
posts=['list', 'create', 'show', 'edit', 'delete'],
comments=['list', 'create', 'show', 'edit', 'delete'],
),
default_controller='posts',
default_function=dict(
posts='list',
comments='show',
)
),


Why is this truly necessary? Shouldn't we just set the default_controller 
and default_function for each controller like bellow?

blog=dict(
default_controller='posts',
default_function=dict(
posts='list',
comments='show',
)
),

It would save lots of time, because every time you add a new controller or 
function you have to set it in routes and restart the server. And if you 
have lots of functions, and you access them with .json extension you also 
have to set those on the list like 'create.json'

On Tuesday, July 10, 2012 5:05:44 PM UTC+1, Jonathan Lundell wrote:
>
> On 10 Jul 2012, at 6:14 AM, Anthony wrote:
>
> Thanks Anthony and Jonathan. It works!
>> It would be nice to have this routing documentation updated in the online 
>> book.
>>
>
> +1
>
> For now, there's quite a bit in the routers.example.py file (including 
> the detail about making "functions" a dictionary of lists).
>
>
> One reason that the documentation is more up to date in the example file 
> is that it tracks the relevant version. As opposed to the book, where one 
> doesn't want to change the docs until the changes make it to stable. 
>

-- 

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




Re: [web2py] Re: error in GAE

2013-02-06 Thread samuel bonilla
2013/2/5 Massimo Di Pierro 

> Look in the GAE log for the actual error.
>
> thanks massimo...

>
> On Tuesday, 5 February 2013 15:10:49 UTC-6, samuel bonilla wrote:
>>
>> i'm runing my app on GAE and i get this error :
>>
>> http://web2pyutil.appspot.com/**web2pyutil
>>
>> Internal errorTicket issued: 
>> unknown
>>
>  --
>
> ---
> 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.
>
>
>

-- 

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




[web2py] Re: multiuser editing in admin?

2013-02-06 Thread Massimo Di Pierro
It does not lock but it detects conflcts

A opens and edits file X
B opens and edits file X
A saves file X
B saves file X web2py detects a change in the file and opens a merge window.

This feature is not really documented and may have been broken with the 
ajax save. Nobody really used it. Please check it and see what happens. Let 
us know if this is sufficient and/or needs a fix.


On Wednesday, 6 February 2013 15:26:22 UTC-6, Andrew Replogle wrote:
>
> Does the admin editor have the ability to have multiple users and lock 
> files when they're being edited by others? 
> If I want to have a small team of developers using the admin tool that's 
> deployed?
>
> They don't need to have any sort of real-time visibility into others work, 
> just support for multiple users. 
>

-- 

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




[web2py] Re: Editing problem with current admin app

2013-02-06 Thread Massimo Di Pierro
Can you help us fix the css?

On Wednesday, 6 February 2013 15:14:40 UTC-6, Nico Zanferrari wrote:
>
> Hi,
>
> I really like the web editor inside the current admin app, and I'm using 
> it more and more for various reasons. I think that the recent changes are 
> pointing towards a Github look and feel, where you have a notification area 
> on the top and  an editing frame in the middle. This works quite fine with 
> current web2py admin app but:
>
> 1. the editing frame is too small (roughly half the number of the Github 
> lines)
> 2. the editing frame is not fixed. This really is a big issue, because if 
> you're editing down the first page you cannot see the notification area on 
> the top and so you miss any message when you save (not even an error one!).
>
> Is it a known problem? Should I open a ticket?
>
> Thank you,
> Nico
>
>
>

-- 

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




Re: [web2py] Re: Import problem in Web2py 2.3.2 vs 1.99.4

2013-02-06 Thread Massimo Di Pierro
Hope it does not break anything else.

On Wednesday, 6 February 2013 13:18:51 UTC-6, Álvaro José Iradier wrote:
>
> Works, but the identation at the "else:" on line 84 in custom_import.py is 
> wrong. FIxed identation, and it apparently works perfect. 
>
> Thanks very much!
>
>
> On Wed, Feb 6, 2013 at 6:35 PM, Massimo Di Pierro 
> 
> > wrote:
>
>> I agree. I am have attempted a fix. Can you try it?
>>
>>
>> On Wednesday, 6 February 2013 01:23:06 UTC-6, Álvaro José Iradier wrote:
>>
>>> I agree they should get priority over system wide modules, but not over 
>>> imports for files on the same directory. So in Geraldo reports, it does not 
>>> make sense that in the situation:
>>>
>>> .../site-packages/geraldo/**generators/__init__.py -> from pdf import 
>>> PDFGenerator
>>> .../site-packages/geraldo/**geraldo/generators/pdf.py -> PDFGenerator 
>>> class is in here
>>> .../myapp/modules/pdf.py -> Nothing to do with Geraldo
>>>
>>> the pdf.py from modules/ is higher priority than the pdf.py from the 
>>> geraldo.generators package, when being imported from __init__.py in the 
>>> same folder.
>>>
>>> This behavior could unexpectedly break any module or package just 
>>> because the application uses a modules/whatever.py file, "whatever" being 
>>>  the same name as any other package. Furthermore, in this case the error 
>>> when importing geraldo.generators was something like "Can not import module 
>>> geraldo", which is quite misleading, and it took me some work to figure out 
>>> what was wrong.
>>>
>>> Maybe the rule should apply when importing from the web2py application, 
>>> or using local_import, but never when importing from other module files 
>>> where a simple filename collision inside any package can break the module.
>>>
>>> Thanks.
>>>
>>> On Tue, Feb 5, 2013 at 11:24 PM, Massimo Di Pierro <
>>> massimo@gmail.com> wrote:
>>>
 The rule is that if something is imported web2py should first look in 
 app/modules/ because app-level modules should get priority else you cannot 
 override system wide modules. So 2.3.2 is doing the right thing. This did 
 not work well in previous versions.
  

 On Tuesday, 5 February 2013 14:40:41 UTC-6, Álvaro José Iradier wrote:
>
> Recently I updated web2py from 1.99.4 to 2.3.2. Suddenly, a PDF report 
> stopped working.
>
> Digging into the problem, I found there is a *pdf.py* file in my 
> application *modules/* folder. Also, I am using Geraldo Reports in *
> web2py/site-packages*.
>
> Geraldo reports has the following file: *geraldo/generators/pdf.py*
> and the __init__.py in geraldo/generators/__init__.py does:
>
> from pdf import PDFGenerator
>
>
> but when doing *import geraldo.generators*, that line fails, so 
> importing geraldo.generators fails. It fails in 2.3.2, but works in 
> 1.99.4.
>
> The fix has been to rename modules/pdf.py in my application to 
> modules/pdfreport.py, because it looks like web2py is trying to import it 
> in the geraldo/generators/__init.py sentence. ¿Is this the expected 
> behavior, or should it look in the __init__,py folder first, as it did in 
> 1.99.4?
>
> Thanks.
>
  -- 
  
 --- 
 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
 .
  
  

>>>
>>>
>>>
>>> -- 
>>> (:**=:)
>>>  Alvaro J. Iradier Muro - aira...@gmail.com 
>>>
>>  -- 
>>  
>> --- 
>> 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.
>>  
>>  
>>
>
>
>
> -- 
> (:=:)
>  Alvaro J. Iradier Muro - aira...@gmail.com  
>

-- 

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




[web2py] Re: How to dont show seconds in a time field

2013-02-06 Thread DenesL


On Wednesday, February 6, 2013 8:24:01 AM UTC-5, Gerd wrote:
>
> Hi Annet and DenesL!
>
> @DenesL: Yes, did restart it, nothings changed
>

True. Note that the input will show HH:MM:SS until you click on it, then it 
becomes HH:MM.
 

>
> @Annet: Thanks you very much, you got it
>
> regards
> Gerd
>
> Am Mittwoch, 6. Februar 2013 13:31:24 UTC+1 schrieb Annet:
>>
>> Hi Gerd,
>>
>> So if i understand this right there is no possibility to change the 
>>> representation in an update form?
>>>
>>
>>
>> Yes, besides, I am not sure whether IS_TIME() has a format property like 
>> IS_DATE() and IS_DATETIME() have.
>> In 2009 it hadn't, and Chris helped me solve the problem as follows:
>>
>> In db.py:
>>
>> istime = dict(type='time',requires=IS_TIME(error_message=T('no match 
>> HH:MM')),widget=timeplain,comment=T('Format HH:MM'))
>>
>> Field('startTime',**istime),
>> Field('endTime',**istime),
>>
>> In a module:
>>
>> def timeplain(field,value): 
>> if value == None: 
>> value = ''
>> elif 'strftime' in dir(value):
>> value = value.strftime('%H:%M') 
>> id = '%s_%s' % (field._tablename, field.name) 
>> return INPUT(_type='text',_id=id,_class='time_plain',_name=field.name
>> ,value=str(value),requires=field.requires)
>>
>
The only caveat here is that you will not be using jQuery.timeEntry, unless 
you change the class to just 'time'.
You can also do:

widget=lambda field,value: SQLFORM.widgets.time.widget(field, 
value.strftime('%H:%M') if value else '')

but you still need to add {showSeconds:false} to .timeEntry in web2py.js

 

>
>> and in case you need it, in a view:
>>
>>   {{=table.startTime.strftime("%H:%M")}}
>>
>>
>> Kind regards,
>>
>> Annet
>>
>

-- 

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




[web2py] Re: How to handle one-to-many relationship with sqlform and checkboxes?

2013-02-06 Thread Derek
It's a list:reference field then, look at the reference in chapter 6: the 
database abstraction layer

On Wednesday, February 6, 2013 2:09:50 PM UTC-7, brac...@gmail.com wrote:
>
> Hello, I was reading about the "Links to referencing 
> records"  
> part in the online guide, but was confused how I would deal with custom 
> logic of inserting it to the database. The guide seems to already have the 
> values in the database to pull from. 
>
> If we take the person and dog database in the example, a person can own 
> many dogs, but a dog can only have one owner. 
>
> If we take the example one step further and say we're running an animal 
> shelter, we would have a list of people and a list of dogs, but we don't 
> have the connection between the two. If a person wants to adopt a dog, 
> they'll use a form which will have the following elements:
>
> Textfield for the person's name. 
> A list of checkboxes with the dog's name.
>
> Then upon successful form submission, the selected dogs are linked to a 
> person.
>
> I don't quite understand how the form is built using "form = 
> SQLFORM(db.person)" in this scenario. 
>
> Since SQLFORM builds its own html, how would web2py handle the dog object? 
> By default, it will probably use a textfield because the dog has a String 
> name, but what about the owner reference? Furthermore, the dog has to be 
> treated as a boolean since we are simply asking if this dog should belong 
> to the human listed on the form or not. I can't quite picture how 
> "SQLFORM.widgets.boolean.widget" 
> since a dog isn't a boolean value tied to a person. It's its own entity 
> with a name and an owner.
>
> The only way I can think of to solve this is to NOT use SQLFORM, but 
> rather SQLFORM.factory(). Then I would use "{{=form.custom.begin/end}}" to 
> manually format the form, create the Textfield for the person name, and 
> generate the checkboxes in a for loop given the list of dog names. When the 
> form passes basic validation with form.accepted, I would grab the person's 
> id and update the entry for all dogs that are returned checked. 
>
> Do I have the right idea or am I misunderstanding web2py design? Is there 
> an easier way to handle one-to-many relationships through a form?
>
>

-- 

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




[web2py] multiuser editing in admin?

2013-02-06 Thread Andrew Replogle
Does the admin editor have the ability to have multiple users and lock 
files when they're being edited by others? 
If I want to have a small team of developers using the admin tool that's 
deployed?

They don't need to have any sort of real-time visibility into others work, 
just support for multiple users. 

-- 

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




[web2py] Editing problem with current admin app

2013-02-06 Thread Nico Zanferrari
Hi,

I really like the web editor inside the current admin app, and I'm using it 
more and more for various reasons. I think that the recent changes are 
pointing towards a Github look and feel, where you have a notification area 
on the top and  an editing frame in the middle. This works quite fine with 
current web2py admin app but:

1. the editing frame is too small (roughly half the number of the Github 
lines)
2. the editing frame is not fixed. This really is a big issue, because if 
you're editing down the first page you cannot see the notification area on 
the top and so you miss any message when you save (not even an error one!).

Is it a known problem? Should I open a ticket?

Thank you,
Nico


-- 

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




[web2py] Re: Scheduler Quick question

2013-02-06 Thread Leonel Câmara
I guess I'm having a hard time configuring the scheduler as a daemon on 
webfaction (not much of a sys admin) and it seemed more pratical to do it 
this way, since it would have the added advantage of reloading the modules 
and I have quite a bit of my code in modules.

Quarta-feira, 6 de Fevereiro de 2013 16:42:01 UTC, Niphlod escreveu:
>
> unless changes are in modules, scheduler loads a pristine environment at 
> every task (meaning that if you change models or task functions, as soon as 
> you save the file the scheduler will pick up the changes)
>
> On Wednesday, February 6, 2013 5:35:10 PM UTC+1, Leonel Câmara wrote:
>>
>> Yes the scheduler certainly doesn't need to reboot every time the 
>> webserver restarts. However it's pratical that it does as many times, 
>> webserver reboots correspond with code updates that I want the scheduler to 
>> see too.
>
>

-- 

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




[web2py] How to handle one-to-many relationship with sqlform and checkboxes?

2013-02-06 Thread bracquet
Hello, I was reading about the "Links to referencing 
records"  
part in the online guide, but was confused how I would deal with custom 
logic of inserting it to the database. The guide seems to already have the 
values in the database to pull from. 

If we take the person and dog database in the example, a person can own 
many dogs, but a dog can only have one owner. 

If we take the example one step further and say we're running an animal 
shelter, we would have a list of people and a list of dogs, but we don't 
have the connection between the two. If a person wants to adopt a dog, 
they'll use a form which will have the following elements:

Textfield for the person's name. 
A list of checkboxes with the dog's name.

Then upon successful form submission, the selected dogs are linked to a 
person.

I don't quite understand how the form is built using "form = 
SQLFORM(db.person)" in this scenario. 

Since SQLFORM builds its own html, how would web2py handle the dog object? 
By default, it will probably use a textfield because the dog has a String 
name, but what about the owner reference? Furthermore, the dog has to be 
treated as a boolean since we are simply asking if this dog should belong 
to the human listed on the form or not. I can't quite picture how 
"SQLFORM.widgets.boolean.widget" 
since a dog isn't a boolean value tied to a person. It's its own entity 
with a name and an owner.

The only way I can think of to solve this is to NOT use SQLFORM, but rather 
SQLFORM.factory(). Then I would use "{{=form.custom.begin/end}}" to 
manually format the form, create the Textfield for the person name, and 
generate the checkboxes in a for loop given the list of dog names. When the 
form passes basic validation with form.accepted, I would grab the person's 
id and update the entry for all dogs that are returned checked. 

Do I have the right idea or am I misunderstanding web2py design? Is there 
an easier way to handle one-to-many relationships through a form?

-- 

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




[web2py] Re: Example JSON Code

2013-02-06 Thread howesc
the URL that you *think* you are requesting via AJAX may not be the URL you 
are actually hitting.  can you check which URL you are trying to make a 
request to via AJAX?  (use the debugging tools included in firefox or 
chrome to see all network traffic)

cfh

On Monday, February 4, 2013 4:04:27 PM UTC-8, pal...@gmail.com wrote:
>
> niphold, what do you mean when you say opening directly the URL that fails?
>
> On Thursday, January 31, 2013 1:10:18 AM UTC-8, Niphlod wrote:
>>
>> did you try opening directly the url that is failing through ajax ? that 
>> 404 could be originated by an incorrect/mispelled url.
>>
>> On Thursday, January 31, 2013 12:36:56 AM UTC+1, pal...@gmail.com wrote:
>>>
>>> We just started using web2py where I work.  We created our 1st webpage 
>>> and it uses JSON calls: One to retrieve database info and the second to 
>>> status the selected info.  We created a 2nd screen using the 1st as a 
>>> template.  On the 2nd screen, our JSON call to retrieve database info 
>>> works.  However, the 2nd JSON call to perform the status won't work.  It 
>>> returns the following:
>>>
>>> *errMsg =Requested page not found. [404]*
>>> *status =error*
>>> *errorThrown =NOT FOUND*
>>> *xhr.status= 404*
>>>
>>> The HTML, jQuery and Python code are very similar to the working screen. 
>>> The one difference is that we are using an *.ajax* call instead of a *
>>> .post* because I couldn't figure out how to write the error handling 
>>> for the .post statement.  Also, I read somewhere that *.post* calls *
>>> .ajax* so it really shouldn't matter
>>>
>>> What else should we look at besides the error code and text?
>>>
>>> Is there an example .html and .py file with JSON calls that we can look 
>>> at?
>>>
>>> I've searched the web for Javascript, web2py, jQuery and JSON examples 
>>> and tried dozens of example but we can't figure out why this call won't 
>>> work.
>>>
>>> Is there something else we should be looking at?
>>>
>>

-- 

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




[web2py] Re: GAE deployment questions...from a total beginner!

2013-02-06 Thread howesc
Riccardo,

some answers:

 - i "backup" the source code of my app by using HG or GIT.
 - google offers data backup via google cloud storage.  you can see options 
for this in the google app engine web admin console
 - yes it is possible to download GAE data.  you'll have to download 
database data into a CSV file and then do an import into your other 
system.  google has instructions for bulk export/import of data.
 - if you use the GAE blobstore for large images, copying all that data out 
is a little harder, but is doable.  i've done it for small projects.
 - yes, to change any code you have to re-deploy your app to GAE.  using 
the GAE SDK you can view changes locally in real time (no reload 
required).  this kind of thing is good development practice in general 
(having a test environment and a production environment)
 - yes you can do queries like the one you mention above.  there are 
restrictions for more complex queries.  you can read the google docs for 
this. (or post most specific questions when you hit a roadblock)
 - no the web2py web admin interface is not available.  logs are provided 
buy the GAE web console.

For what it's worth, i love GAE.  i'm running several apps, one of them 
gets over 2.5 million HTTP requests a day and works really well.  there is 
some differences between GAE and "traditional" hosting, but once you learn 
the rules it's a fun playground to play on.

good luck!

christian

On Tuesday, February 5, 2013 6:17:28 AM UTC-8, Riccardo C wrote:
>
> Hi All,
>
> As in the title I'm an absolute beginner... now I'd like to see my app 
> online. Probably it would be more correct to say that I would learn to 
> deploy for choosing then the hosting for my app. 
> I think that using Gae would be the best solution (for a beginner) but I 
> was not able to find an answer to these questions (I apologise if some of 
> them might seem trivial to you):
>
>- I read that I will not have access to the file system. How to do a 
>backup of the app?
>   - let say that I want to test the "image gallery" example and after 
>   a couple of day I want to download all the photos uploaded... would it 
> be 
>   possible? what is possible to do?
>   - Would it be easy to move in the future the web app to another 
>   hosting service without loosing (db data and static file)?
>   - I would to change a single view file... what should I do? reload 
>   all the app?
>   - From the web2py doc "No complex datastore queries. In particular 
>there are no JOIN, LIKE, and DATE/DATETIME operators."
>   - would I still be able to ask the database, for example, << tell 
>   me all the post in the database BEFORE Jan 2010? >>
>   - Would I have the admin web interface available?
>- based on the previous questions, do you suggest to use/evaluate 
>another hosting? which one?
>
> Thanks for your help and patienceplease if there is already an answer 
> to those questions (and I was not able to find it in the forum) please just 
> point me to those existing thread.
>
> Riccardo
>

-- 

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




[web2py] Re: Forcing SSL mode (on GAE)

2013-02-06 Thread howesc
if you want all requests in SSL it sounds like the best thing to me.

note that on GAE if you want to use SSL and a custom domain you have to 
purchase additional add-ons to the GAE service.  https on the appspot.com 
domain is free.

cfh

On Tuesday, February 5, 2013 9:49:34 AM UTC-8, Philip Kilner wrote:
>
> Hi All, 
>
> Am just about to test using "request.requires_https()" to force my GAE 
> sessions into SSL mode. 
>
> Is this the best way to do it (a) generally or (b) on GAE in particular? 
>
>
> -- 
>
> Regards, 
>
> PhilK 
>
>
> 'a bell is a cup...until it is struck' 
>
>

-- 

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




Re: [web2py] Re: error in GAE

2013-02-06 Thread howesc
Samuel,

you showed us the console log from when you deployed your code to google 
app engine.  can you use the google app engine admin tool (website) to view 
the logs there and post us the stack trace?

thanks,

cfh

On Tuesday, February 5, 2013 3:11:36 PM UTC-8, JavierQQ wrote:
>
>
>
>
> On Tue, Feb 5, 2013 at 6:03 PM, samuel bonilla 
> 
> > wrote:
>
>> but a ge this error in the console
>>
>>
>> 2013-02-05 17:57:39,281 ERROR appcfg.py:1856 Filename cannot contain "." 
>> or ".." or start with "-" or "_ah/": 
>> applications/init/static/menu/css/bootstrap.css. 
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.css.green.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.css.original.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.css.readable.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.css.united.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.css_original1.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.css_top_head.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.css_top_light_ok.  Using 
>> application/octet-stream.
>> 05:57 PM Scanned 1000 files.
>> Could not guess mimetype for 
>> applications/init/static/css/zocial-regular-webfont.eot.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/css/zocial-regular-webfont.ttf.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/css/zocial-regular-webfont.woff.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/font/fontawesome-webfont.eot.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/font/fontawesome-webfont.ttf.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/font/fontawesome-webfont.woff.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/css/bootstrap.backup.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/css/bootstrap.css..  Using 
>> application/octet-stream.
>> 2013-02-05 17:57:41,425 ERROR appcfg.py:1856 Filename cannot contain "." 
>> or ".." or start with "-" or "_ah/": 
>> applications/init/static/bootstrap/css/bootstrap.css. 
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/css/bootstrap.css.original.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/css/bootstrap.css.readable.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/css/bootstrap.css.united.  Using 
>> application/octet-stream.
>> 05:57 PM Scanned 1500 files.
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.backup.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.css.green.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/font/fontawesome-webfont.woff.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.css_top_light_ok.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/css/bootstrap.css.readable.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/font/fontawesome-webfont.eot.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/css/zocial-regular-webfont.ttf.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/font/fontawesome-webfont.eot.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/menu/css/bootstrap.css.readable.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/font/fontawesome-webfont.woff.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/css/zocial-regular-webfont.woff.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/css/bootstrap.backup.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/plugin_ckeditor/ckeditor.pack.  Using 
>> application/octet-stream.
>> Could not guess mimetype for 
>> applications/init/static/bootstrap/font/fontaw

Re: [web2py] Re: Cannot import module 'ldap'

2013-02-06 Thread Nicholas Duffy
Got it! Apparently the file I had in the modules folder was causing the 
problem. I don't understand why, but time to go read the docs.

Thanks for everybody posting.  

On Wednesday, February 6, 2013 1:13:45 PM UTC-7, Nicholas Duffy wrote:
>
> Upon further research it appears that I'm unable to import ldap in only 
> one of my applications. It works in others, but just not this one. I copied 
> the db.py from one of the working applications over but still no luck. I'll 
> keep digging but any suggestions as to where to look would greatly be 
> appreciated.
>
> c:\web2py>python web2py.py -S training
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.3.2 (2012-12-17 15:03:30) stable
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
> PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), 
> IMAP(imaplib)
> WARNING:web2py:import IPython error; use default python shell
> Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] 
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> import ldap
> >>> ^Z
>
>
> c:\web2py>python web2py.py -S apollo
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2013
> Version 2.3.2 (2012-12-17 15:03:30) stable
> Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
> PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), 
> IMAP(imaplib)
> WARNING:web2py:import IPython error; use default python shell
> Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] 
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> import ldap
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "c:\web2py\gluon\custom_import.py", line 77, in custom_importer
> raise ImportError, 'Cannot import module %s' % str(e)
> ImportError: Cannot import module 'ldap'
> >>>
>
> On Wednesday, February 6, 2013 3:17:31 AM UTC-7, Nicholas Duffy wrote:
>>
>> Mistakenly ran in the shell but updated my post shortly after. 
>>
>> No not via the exe but via web2py.py. I've tried both locally debugging 
>> via Wing and on my server running but receive the same error. 
>>
>> I'm sure I'm doing something simple wrong. 
>>
>>

-- 

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




Re: [web2py] Re: Cannot import module 'ldap'

2013-02-06 Thread Nicholas Duffy
Upon further research it appears that I'm unable to import ldap in only one 
of my applications. It works in others, but just not this one. I copied the 
db.py from one of the working applications over but still no luck. I'll 
keep digging but any suggestions as to where to look would greatly be 
appreciated.

c:\web2py>python web2py.py -S training
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2013
Version 2.3.2 (2012-12-17 15:03:30) stable
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), 
IMAP(imaplib)
WARNING:web2py:import IPython error; use default python shell
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] 
on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import ldap
>>> ^Z


c:\web2py>python web2py.py -S apollo
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2013
Version 2.3.2 (2012-12-17 15:03:30) stable
Database drivers available: SQLite(sqlite3), MySQL(pymysql), 
PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), 
IMAP(imaplib)
WARNING:web2py:import IPython error; use default python shell
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] 
on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import ldap
Traceback (most recent call last):
  File "", line 1, in 
  File "c:\web2py\gluon\custom_import.py", line 77, in custom_importer
raise ImportError, 'Cannot import module %s' % str(e)
ImportError: Cannot import module 'ldap'
>>>

On Wednesday, February 6, 2013 3:17:31 AM UTC-7, Nicholas Duffy wrote:
>
> Mistakenly ran in the shell but updated my post shortly after. 
>
> No not via the exe but via web2py.py. I've tried both locally debugging 
> via Wing and on my server running but receive the same error. 
>
> I'm sure I'm doing something simple wrong. 
>
>

-- 

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




[web2py] Re: serving php and python in shared hosting

2013-02-06 Thread José Eloy

Maybe the solution is add a new RewriteRule, but I don't be an expert in 
apache configuration. Any idea? 

-- 

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




Re: [web2py] Re: Import problem in Web2py 2.3.2 vs 1.99.4

2013-02-06 Thread Álvaro J . Iradier
Works, but the identation at the "else:" on line 84 in custom_import.py is
wrong. FIxed identation, and it apparently works perfect.

Thanks very much!


On Wed, Feb 6, 2013 at 6:35 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> I agree. I am have attempted a fix. Can you try it?
>
>
> On Wednesday, 6 February 2013 01:23:06 UTC-6, Álvaro José Iradier wrote:
>
>> I agree they should get priority over system wide modules, but not over
>> imports for files on the same directory. So in Geraldo reports, it does not
>> make sense that in the situation:
>>
>> .../site-packages/geraldo/**generators/__init__.py -> from pdf import
>> PDFGenerator
>> .../site-packages/geraldo/**geraldo/generators/pdf.py -> PDFGenerator
>> class is in here
>> .../myapp/modules/pdf.py -> Nothing to do with Geraldo
>>
>> the pdf.py from modules/ is higher priority than the pdf.py from the
>> geraldo.generators package, when being imported from __init__.py in the
>> same folder.
>>
>> This behavior could unexpectedly break any module or package just because
>> the application uses a modules/whatever.py file, "whatever" being  the same
>> name as any other package. Furthermore, in this case the error when
>> importing geraldo.generators was something like "Can not import module
>> geraldo", which is quite misleading, and it took me some work to figure out
>> what was wrong.
>>
>> Maybe the rule should apply when importing from the web2py application,
>> or using local_import, but never when importing from other module files
>> where a simple filename collision inside any package can break the module.
>>
>> Thanks.
>>
>> On Tue, Feb 5, 2013 at 11:24 PM, Massimo Di Pierro > > wrote:
>>
>>> The rule is that if something is imported web2py should first look in
>>> app/modules/ because app-level modules should get priority else you cannot
>>> override system wide modules. So 2.3.2 is doing the right thing. This did
>>> not work well in previous versions.
>>>
>>>
>>> On Tuesday, 5 February 2013 14:40:41 UTC-6, Álvaro José Iradier wrote:

 Recently I updated web2py from 1.99.4 to 2.3.2. Suddenly, a PDF report
 stopped working.

 Digging into the problem, I found there is a *pdf.py* file in my
 application *modules/* folder. Also, I am using Geraldo Reports in *
 web2py/site-packages*.

 Geraldo reports has the following file: *geraldo/generators/pdf.py*
 and the __init__.py in geraldo/generators/__init__.py does:

 from pdf import PDFGenerator


 but when doing *import geraldo.generators*, that line fails, so
 importing geraldo.generators fails. It fails in 2.3.2, but works in 1.99.4.

 The fix has been to rename modules/pdf.py in my application to
 modules/pdfreport.py, because it looks like web2py is trying to import it
 in the geraldo/generators/__init.py sentence. ¿Is this the expected
 behavior, or should it look in the __init__,py folder first, as it did in
 1.99.4?

 Thanks.

>>>  --
>>>
>>> ---
>>> 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
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> (:**=:)
>>  Alvaro J. Iradier Muro - aira...@gmail.com
>>
>  --
>
> ---
> 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.
>
>
>



-- 
(:=:)
 Alvaro J. Iradier Muro - airad...@gmail.com

-- 

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




[web2py] Why must 'id' primary-key Field in DAL be an integer?

2013-02-06 Thread Derek
It doesn't have to be. Use the primary_key attribute.

-- 

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




[web2py] Why must 'id' primary-key Field in DAL be an integer?

2013-02-06 Thread Alec Taylor
https://github.com/web2py/web2py/blob/master/gluon/dal.py#L1776

The reason I ask is that I am following the OAuth2 spec which uses
hashes for IDs.

I mean, I can have two IDs; one which I never [ever!] use; but that
wouldn't be very efficient… in code conciseness or database design.

So why must 'id' primary-key Field in DAL be an integer?

Thanks for all information,

Alec Taylor

-- 

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




Re: [web2py] Re: Import problem in Web2py 2.3.2 vs 1.99.4

2013-02-06 Thread Massimo Di Pierro
I agree. I am have attempted a fix. Can you try it?

On Wednesday, 6 February 2013 01:23:06 UTC-6, Álvaro José Iradier wrote:
>
> I agree they should get priority over system wide modules, but not over 
> imports for files on the same directory. So in Geraldo reports, it does not 
> make sense that in the situation:
>
> .../site-packages/geraldo/generators/__init__.py -> from pdf import 
> PDFGenerator
> .../site-packages/geraldo/geraldo/generators/pdf.py -> PDFGenerator class 
> is in here
> .../myapp/modules/pdf.py -> Nothing to do with Geraldo
>
> the pdf.py from modules/ is higher priority than the pdf.py from the 
> geraldo.generators package, when being imported from __init__.py in the 
> same folder.
>
> This behavior could unexpectedly break any module or package just because 
> the application uses a modules/whatever.py file, "whatever" being  the same 
> name as any other package. Furthermore, in this case the error when 
> importing geraldo.generators was something like "Can not import module 
> geraldo", which is quite misleading, and it took me some work to figure out 
> what was wrong.
>
> Maybe the rule should apply when importing from the web2py application, or 
> using local_import, but never when importing from other module files where 
> a simple filename collision inside any package can break the module.
>
> Thanks.
>
> On Tue, Feb 5, 2013 at 11:24 PM, Massimo Di Pierro 
> 
> > wrote:
>
>> The rule is that if something is imported web2py should first look in 
>> app/modules/ because app-level modules should get priority else you cannot 
>> override system wide modules. So 2.3.2 is doing the right thing. This did 
>> not work well in previous versions.
>>
>>
>> On Tuesday, 5 February 2013 14:40:41 UTC-6, Álvaro José Iradier wrote:
>>>
>>> Recently I updated web2py from 1.99.4 to 2.3.2. Suddenly, a PDF report 
>>> stopped working.
>>>
>>> Digging into the problem, I found there is a *pdf.py* file in my 
>>> application *modules/* folder. Also, I am using Geraldo Reports in *
>>> web2py/site-packages*.
>>>
>>> Geraldo reports has the following file: *geraldo/generators/pdf.py*
>>> and the __init__.py in geraldo/generators/__init__.py does:
>>>
>>> from pdf import PDFGenerator
>>>
>>>
>>> but when doing *import geraldo.generators*, that line fails, so 
>>> importing geraldo.generators fails. It fails in 2.3.2, but works in 1.99.4.
>>>
>>> The fix has been to rename modules/pdf.py in my application to 
>>> modules/pdfreport.py, because it looks like web2py is trying to import it 
>>> in the geraldo/generators/__init.py sentence. ¿Is this the expected 
>>> behavior, or should it look in the __init__,py folder first, as it did in 
>>> 1.99.4?
>>>
>>> Thanks.
>>>
>>  -- 
>>  
>> --- 
>> 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.
>>  
>>  
>>
>
>
>
> -- 
> (:=:)
>  Alvaro J. Iradier Muro - aira...@gmail.com  
>

-- 

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




Re: [web2py] Re: Real Python for Web Development, featuring web2py

2013-02-06 Thread Jim S
+1

On Wednesday, February 6, 2013 8:27:45 AM UTC-6, software.ted wrote:
>
> ...let him do something more interesting for an example - like  a ticket 
> processing system, with reminders so that we can even learn about 
> scheduling aspect of web2py
>
>
> On Tue, Feb 5, 2013 at 9:52 PM, Niphlod >wrote:
>
>> +1 for web2py, -1 for blog as an example app.
>>
>>
>> On Tuesday, February 5, 2013 6:28:50 PM UTC+1, rochacbruno wrote:
>>>
>>>
>>>
>>> Take a look:
>>>
>>> http://www.kickstarter.com/projects/1369857650/real-python-for-web-development-featuring-web2py
>>>
>>> Why Web2py? 
>>>
>>> web2py is an open-source web framework for rapid development. You can 
>>> get up in running in less than 10 minutes and build a full-featured 
>>> application in under an hour. Much like the Python language itself, web2py 
>>> is designed for beginners to quickly get up to speed as well as advanced 
>>> users. 
>>>
>>>  -- 
>>  
>> --- 
>> 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.
>>  
>>  
>>
>
>
>
> -- 
>
> ...
> Teddy Lubasi Nyambe
> Opensource Zambia
> Lusaka, ZAMBIA
>
> Cell: +260 97 7760473
> website: http://www.opensource.org.zm
>
> ~/
> Human Knowledge belongs to the world! - AntiTrust
>
> Man is a tool-using animal. Without tools he is nothing, with tools he is 
> all - Thomas Carlyle 1795-1881
>
> /~ 
>

-- 

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




[web2py] Re: Scheduler Quick question

2013-02-06 Thread Niphlod
unless changes are in modules, scheduler loads a pristine environment at 
every task (meaning that if you change models or task functions, as soon as 
you save the file the scheduler will pick up the changes)

On Wednesday, February 6, 2013 5:35:10 PM UTC+1, Leonel Câmara wrote:
>
> Yes the scheduler certainly doesn't need to reboot every time the 
> webserver restarts. However it's pratical that it does as many times, 
> webserver reboots correspond with code updates that I want the scheduler to 
> see too.

-- 

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




[web2py] Re: Scheduler Quick question

2013-02-06 Thread Leonel Câmara
Yes the scheduler certainly doesn't need to reboot every time the webserver 
restarts. However it's pratical that it does as many times, webserver 
reboots correspond with code updates that I want the scheduler to see too.

-- 

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




[web2py] Re: Real Python for Web Development, featuring web2py

2013-02-06 Thread Monte Milanuk
I'm in... but I do agree that 'Yet Another Blog' example is a bit tired.  
Yes, its considered almost standard to do a blog or wiki as an example, and 
perhaps serves a purpose as a point of comparison between competing 
products/projects.  Personally, since the existing web2py docs do cover a 
basic blog/wiki, I'd rather see them start with a contacts database, and 
'grow' it into a library database, complete with all the tagging, rating, 
reviews, etc. that one might want.

On Tuesday, February 5, 2013 9:28:50 AM UTC-8, rochacbruno wrote:
>
>
>
> Take a look:
>
> http://www.kickstarter.com/projects/1369857650/real-python-for-web-development-featuring-web2py
>
> Why Web2py? 
>
> web2py is an open-source web framework for rapid development. You can get 
> up in running in less than 10 minutes and build a full-featured application 
> in under an hour. Much like the Python language itself, web2py is designed 
> for beginners to quickly get up to speed as well as advanced users. 
>
>

-- 

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




[web2py] Re: Image store with open does not work on GAE

2013-02-06 Thread Massimo Di Pierro
We can solve this but the internal logic is going to be convoluted. The 
problem is that you cannot read the content after then record has been 
created and not before. Can you help me test something?

db.define_table('blobs',
Field('image', 'upload'),
)
db.define_table('table1',
Field('image', 'upload',uploadfield=db.blobs.image),
)
db.table1.insert(image =  open('test.jpg', 'rb'))

Does this work? Can you then download the image?

On Sunday, 3 February 2013 03:30:20 UTC-6, Sebastian Cambeo wrote:
>
> OK, I created a minimal scenario for reproducing the error:
>
> append these lines to the welcome db.py, create test.jpg in root folder 
> and deploy directly to GAE:
>
> db.define_table('table1',
> Field('image', 'upload'),
> )
> db.table1.insert(image =  open('test.jpg', 'rb'))
>
>
> Then call welcome/appadmin and you will see that clicking on the "file" 
> link downloads an empty image because the blob data is empty.
> table1.idtable1.imagetable1.image_blob37001*file*None
>
>

-- 

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




Re: [web2py] Re: Real Python for Web Development, featuring web2py

2013-02-06 Thread Teddy Nyambe
...let him do something more interesting for an example - like  a ticket
processing system, with reminders so that we can even learn about
scheduling aspect of web2py


On Tue, Feb 5, 2013 at 9:52 PM, Niphlod  wrote:

> +1 for web2py, -1 for blog as an example app.
>
>
> On Tuesday, February 5, 2013 6:28:50 PM UTC+1, rochacbruno wrote:
>>
>>
>>
>> Take a look:
>> http://www.kickstarter.com/**projects/1369857650/real-**
>> python-for-web-development-**featuring-web2py
>>
>> Why Web2py?
>>
>> web2py is an open-source web framework for rapid development. You can get
>> up in running in less than 10 minutes and build a full-featured application
>> in under an hour. Much like the Python language itself, web2py is designed
>> for beginners to quickly get up to speed as well as advanced users.
>>
>>  --
>
> ---
> 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.
>
>
>



-- 
...
Teddy Lubasi Nyambe
Opensource Zambia
Lusaka, ZAMBIA

Cell: +260 97 7760473
website: http://www.opensource.org.zm

~/
Human Knowledge belongs to the world! - AntiTrust

Man is a tool-using animal. Without tools he is nothing, with tools he is
all - Thomas Carlyle 1795-1881

/~

-- 

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




[web2py] Re: How to dont show seconds in a time field

2013-02-06 Thread Gerd
Hi Annet and DenesL!

@DenesL: Yes, did restart it, nothings changed

@Annet: Thanks you very much, you got it

regards
Gerd

Am Mittwoch, 6. Februar 2013 13:31:24 UTC+1 schrieb Annet:
>
> Hi Gerd,
>
> So if i understand this right there is no possibility to change the 
>> representation in an update form?
>>
>
>
> Yes, besides, I am not sure whether IS_TIME() has a format property like 
> IS_DATE() and IS_DATETIME() have.
> In 2009 it hadn't, and Chris helped me solve the problem as follows:
>
> In db.py:
>
> istime = dict(type='time',requires=IS_TIME(error_message=T('no match 
> HH:MM')),widget=timeplain,comment=T('Format HH:MM'))
>
> Field('startTime',**istime),
> Field('endTime',**istime),
>
> In a module:
>
> def timeplain(field,value): 
> if value == None: 
> value = ''
> elif 'strftime' in dir(value):
> value = value.strftime('%H:%M') 
> id = '%s_%s' % (field._tablename, field.name) 
> return INPUT(_type='text',_id=id,_class='time_plain',_name=field.name
> ,value=str(value),requires=field.requires)
>
> and in case you need it, in a view:
>
>   {{=table.startTime.strftime("%H:%M")}}
>
>
> Kind regards,
>
> Annet
>

-- 

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




[web2py] Re: How to dont show seconds in a time field

2013-02-06 Thread Annet
Hi Gerd,

So if i understand this right there is no possibility to change the 
> representation in an update form?
>


Yes, besides, I am not sure whether IS_TIME() has a format property like 
IS_DATE() and IS_DATETIME() have.
In 2009 it hadn't, and Chris helped me solve the problem as follows:

In db.py:

istime = dict(type='time',requires=IS_TIME(error_message=T('no match 
HH:MM')),widget=timeplain,comment=T('Format HH:MM'))

Field('startTime',**istime),
Field('endTime',**istime),

In a module:

def timeplain(field,value): 
if value == None: 
value = ''
elif 'strftime' in dir(value):
value = value.strftime('%H:%M') 
id = '%s_%s' % (field._tablename, field.name) 
return 
INPUT(_type='text',_id=id,_class='time_plain',_name=field.name,value=str(value),requires=field.requires)

and in case you need it, in a view:

  {{=table.startTime.strftime("%H:%M")}}


Kind regards,

Annet

-- 

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




[web2py] Re: Scheduler Quick question

2013-02-06 Thread Tim Richardson


On Wednesday, 6 February 2013 23:13:31 UTC+11, Tim Richardson wrote:
>
>
>
> On Wednesday, 6 February 2013 02:46:57 UTC+11, Leonel Câmara wrote:
>>
>> Yes it exists, independently what I want is to stop and relaunch the 
>> process when the webserver reboots.
>
>
> Why?  
>

I'm a bit confused. A server is a machine which reboots, a webserver like 
apache is a process which can restart. 
It's my belief that you don't need to restart the scheduler just because 
the web server restarts.
If you want to make sure the scheduler is running if your host reboots 
their server, then you should contact them.
My linux shared hosting offers cron.
I also have an ec2 virtual machine running Ubuntu server; in that case, I 
suppose I would add the scheduler to the rc.local start scripts, although I 
haven't done either yet since I so far only have the scheduler on a windows 
deployment. 

-- 

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




[web2py] Re: How to dont show seconds in a time field

2013-02-06 Thread DenesL

Hi Gerd,

field.represent controls how the field is presented on output, field.widget 
controls presentation on input.

But having said that, your change to web2py.js should have worked, maybe it 
is cached, did you refresh/restart?.

Regards,
Denes

On Wednesday, February 6, 2013 2:34:05 AM UTC-5, Gerd wrote:
>
> Hi Annet!
>
> So if i understand this right there is no possibility to change the 
> representation in an update form?
>
> Thank you
> Gerd

-- 

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




[web2py] Re: Scheduler Quick question

2013-02-06 Thread Tim Richardson


On Wednesday, 6 February 2013 02:46:57 UTC+11, Leonel Câmara wrote:
>
> Yes it exists, independently what I want is to stop and relaunch the 
> process when the webserver reboots.


Why?  

-- 

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




Re: [web2py] Re: Cannot import module 'ldap'

2013-02-06 Thread Nicholas Duffy
Mistakenly ran in the shell but updated my post shortly after. 

No not via the exe but via web2py.py. I've tried both locally debugging via 
Wing and on my server running but receive the same error. 

I'm sure I'm doing something simple wrong. 

-- 

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




[web2py] Re: compute field doesn't work on update

2013-02-06 Thread palomar
up

Il giorno sabato 19 gennaio 2013 18:43:51 UTC+1, palomar ha scritto:
>
> I had the 2.1 and I've just updated to 2.3 (I hoped to solve the 
> problem...)
>
> request.vars.id is the vars from the ajax call; it works, I'm sure, 
> articolo.p_p is correctly updated 
>
> Il giorno sabato 19 gennaio 2013 18:03:34 UTC+1, palomar ha scritto:
>>
>> Other users have the same problem and, sorry but I can't find my 
>> solution; 
>> i tried with readable=true and writable=true, to update all the field 
>> interested in the compute function, to comment the line in DAL.py, but 
>> nothing. 
>>
>> I have this table:
>> db.define_table('magazzino',
>> Field('id_tipo', 'integer',default=0),
>> Field('p_p','double', default=0.0),
>> Field('pp_tot','double', writable=True, readable=True, compute=lambda 
>> r: r['id_tipo']==0 and r['p_p']*1 or r['p_p']*r['id_tipo']*-1),
>> )
>>
>> If I edit a row with a FORM the compute field works but if I edit it in a 
>> function with ajax don't...
>>
>> def modArtPrice():
>> newPp = 100
>> articolo = db.magazzino[request.vars.id]
>> articolo.id_tipo=articolo.id_tipo
>> articolo.p_p=newPp
>> articolo.update_record()
>>
>> what's wrong?
>> s.
>>
>

-- 

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




Re: [web2py] Re: Cannot import module 'ldap'

2013-02-06 Thread Nico Zanferrari
Nicholas, I'm sorry but this is not what Massimo asked for. You need to run
these commands from inside web2py, after you've run it with:

python web2py.py -S welcome

and not from a pure python shell.
Also, how do you normally run web2py? Launching web2py.exe ?

Cheers,
Nico


2013/2/6 Nicholas Duffy 

> C:\Console2>python
> Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
> on win
> 32
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import ldap
> >>> import ldap.filter
> >>> import sys
> >>> print sys.path
> ['', 'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg',
> 'C:\\Pytho
> n27\\lib\\site-packages\\pip-1.2.1-py2.7.egg',
> 'C:\\Windows\\system32\\python27.
> zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib',
> 'C:\\Python27\\lib\\plat-win',
> 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27',
> 'C:\\Python27\\lib\\site-packages',
>  'C:\\Users\\nick.duffy\\Dropbox\\Work\\Apollo\\MINDBODYAPI\\mbapi',
> 'C:\\Python
> 27\\lib\\site-packages\\win32',
> 'C:\\Python27\\lib\\site-packages\\win32\\lib',
> 'C:\\Python27\\lib\\site-packages\\Pythonwin']
>
> >>>
>
> On Tuesday, February 5, 2013 3:28:03 PM UTC-7, Massimo Di Pierro wrote:
>>
>> No idea. Whan you try open the web2py shell and try a manual import
>>
>> python web2py.py -S welcome
>> >>> import ldap
>> >>> import ldap.filter
>> >>> import sys
>> >>> print sys.path
>>
>> On Tuesday, 5 February 2013 16:20:05 UTC-6, Nicholas Duffy wrote:
>>>
>>> Thanks for the reply Massimo.
>>>
>>> Do you mean the web2py source? Because that is what I am using. I am
>>> able to import other packages that I've installed via binary in
>>> lib\site-packages like pyodbc and suds. I cannot seem to import ldap,
>>> though.
>>>
>>> On Tuesday, February 5, 2013 7:36:58 AM UTC-7, Massimo Di Pierro wrote:

 Since you are using the windows binary, it comes with its own python
 and it does not see packages you installed on you "other" python.

 Your best option is use the web2py source distribution. It will see
 packages you install.

 On Monday, 4 February 2013 17:09:13 UTC-6, Nicholas Duffy wrote:
>
> Hello all,
> -I have downloaded and installed python-ldap 2.4.10 from here:
> http://pypi.python.org/pypi/**python-ldap/2.4.10
> --Windows binary 2.4.10 for Python 2.7
> --I get no errors when trying to import in the shell, so it's
> installed.
> -I have followed the directions here to attempt to setup
> authentication with MS Active Directory: http://web2py.com/books/**
> default/chapter/29/09 
>
> However, immediately upon running my application, I receive this error:
> ImportError: Cannot import module 'ldap'
> File "C:\Python27\Lib\threading.py"**, line 524, in __bootstrap
>   self.__bootstrap_inner()
> File "C:\Python27\Lib\threading.py"**, line 551, in __bootstrap_inner
>   self.run()
> File "c:\web2py\gluon\rocket.py", line 1337, in run
>   self.run_app(conn)
> File "c:\web2py\gluon\rocket.py", line 1838, in run_app
>   output = self.app(environ, self.start_response)
> File "c:\web2py\gluon\main.py", line 725, in app_with_logging
>   ret[0] = wsgiapp(environ, responder2)
> File "c:\web2py\gluon\main.py", line 543, in wsgibase
>   serve_controller(request, response, session)
> File "c:\web2py\gluon\main.py", line 221, in serve_controller
>   run_models_in(environment)
> File "c:\web2py\gluon\compileapp.**py", line 539, in run_models_in
>   restricted(code, environment, layer=model)
> File "c:\web2py\gluon\restricted.**py", line 223, in restricted
>   sys.excepthook(etype, evalue, tb)
> File "c:\web2py\applications\**apollo\models\db.py", line 44, in
> 
>   from gluon.contrib.login_methods.**ldap_auth import ldap_auth
> File "c:\web2py\gluon\custom_**import.py", line 96, in custom_importer
>   return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
> File "c:\web2py\gluon\contrib\**login_methods\ldap_auth.py", line 14,
> in 
>   raise e
>
> What simple step am I missing? Thanks.
>
>
>  --
>
> ---
> 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.
>
>
>

-- 

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