[web2py] Re: Example JSON Code

2013-02-05 Thread Niphlod
yep

On Tuesday, February 5, 2013 1:04:27 AM UTC+1, 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.




Re: [web2py] Re: XML, sanitize

2013-02-05 Thread Martijn Hermans
Thanks once again :)

I really appreciate your quick response to these questions.

A happy web2py user.





2013/2/4 Massimo Di Pierro massimo.dipie...@gmail.com

 You will be fine. SPAN should be there by default. It is not and that is
 an oversight. FONT is not there because deprecated tag.


 On Monday, 4 February 2013 12:06:42 UTC-6, Martijn Hermans wrote:

 I've got a website in wich I want to allow the user some customization.

 To prevent my site from injection, I use : {{=XML(markup,sanitize=True)**
 }}

 This works perfect, except it doesn't allow the tags 'font' and 'span'.

 I know I can override this default behaviour, but I want to know if I
 expose my site to dangers if I allow the 'font' and 'span tags'.

 Is there a good reason they are not exposed by default???

  --

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




Re: [web2py] Re: skyrocketing memory. How to pinpoint the problem?

2013-02-05 Thread Michele Comitini
Pumplerod,

This is not normal, please send here the code (only what is needed no
private data) to reproduce the problem so that it can be investigated.
What is needed is:
model
controller
view


mic


2013/2/5 pumplerod pumple...@gmail.com:
 As a more complete test I did 3 things...

 1) replicated what my function through web2py was doing in a separate script
 and ran that thousands of times on the same server.  This did not severely
 impact memory usage.

 2) set up a web2py function in my controller to simply return a json obect.
 I am using the protocol: domain/app/controller/func.json  No processing,
 just a return statement.  I then ran this script from a separate host.
 Calling it 1000 times on multiple processors.  The memory shot up right
 away.

 3) reran, from the separate host the same script only this time not
 requesting a json object response.  domain/app/controller/func  This also
 made the memory peak to a point of crashing the machine.

 is this a leak or do I need to specify some sort of cache for web2py?


 On Monday, February 4, 2013 12:19:37 PM UTC-8, pumplerod wrote:

 To further elaborate.  I am running my web2py instance on a VPS at
 dreamhost.com with a memory allocation of 4Gig.  It is running under
 passenger.



 On Monday, February 4, 2013 12:16:38 PM UTC-8, pumplerod wrote:

 I had been having critical memory overflow problems and finally saw a
 post about a memory leak in the version I was using (2.1.x) so I have
 updated to the latest stable version (2.3.2), however I am still seeing my
 memory climb until the machine crashes.

 I'm using web2py as my interface which is accepting data, parsing it, and
 then appending to a neo4j database.  I thought, for a while, that neo4j was
 the culprit, however, after writing a script to emulate what web2py was
 doing and running it on a separate host I saw no memory jump.  It only
 happens while running web2py, and only when I'm receiving many hundreds of
 requests per min.  There is nothing else running on the machine, other than
 system tools.

 Within 5min I'm able to watch the memory go from a reasonable 730MB to
 over 2500MB.

 I'm using the default SQLite database and am only making 1 or 2 calls to
 the db upon each request.

 How can I track this down?  Should I be looking for something
 specifically in the logs?  Use particular parameters for the logger?

 --

 ---
 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] Organize/Format a list of checkboxes to be displayed over multiple coulumns

2013-02-05 Thread maverick
Hello,

I have a field like:

Field('reseller', label='Resellers (Optional)', 
requires=IS_IN_SET(session.resellers, multiple=True), 
  widget = SQLFORM.widgets.checkboxes.widget),

which is displayed as a list of checkboxes, which is what I want. But the 
list is very long and the submit button for the form ends up several pages 
below.

Is there an easy way to make the list of checkboxes appear over multiple 
columns?

i.e I want to go from:

1
2
3
4
5
6
7
8
9

to something like:

1 4 7   1 2 3
2 5 8  or  4 5 6 
3 6 9   7 8 9

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.




[web2py] Re: Invalid view for generic.load on server but works fine locally

2013-02-05 Thread Nicholas Duffy
Perfect, thank you very much!

On Monday, February 4, 2013 4:23:55 PM UTC-7, Anthony wrote:

 See http://web2py.com/books/default/chapter/29/10#Generic-views. The 
 framework disables generic views by default, though in db.py of the 
 scaffolding app, they are enabled on localhost only. Set 
 response.generic_patterns to enable generic.load when needed.

 Anthony

 On Monday, February 4, 2013 4:29:56 PM UTC-5, Nicholas Duffy wrote:

 Hello all,
 I have a view that looks like this:

 *studiomaster/index.html*
 {{extend 'layout.html'}}
 div id=studiochart class=single-chart/div

 {{=LOAD('studiomaster', 'grid.load', ajax=True, target='grid', 
 content='Loading...')}}

 The grid function returns a SQLFORM.grid - after filling in the fields 
 and headers - like this:
 *controllers/studiomaster.py*
 query = db.studio_master.id  0
 grid = SQLFORM.grid(query=query, fields=fields, headers=headers, 
 csv=True, paginate=10,
 editable=True, user_signature=False, 
 showbuttontext=False)
   
 return dict(grid=grid)

 This works perfectly fine locally, however, when I try this on my server, 
 I get 
 invalid view (studiomaster/grid.load)

 error. 

 What am I missing here?

 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.




[web2py] Cannot import module 'ldap'

2013-02-05 Thread Nicholas Duffy
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 module
  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 
module
  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.




[web2py] Re: skyrocketing memory. How to pinpoint the problem?

2013-02-05 Thread c h
are the parsed data (files?) being held in memory somehow?

are you building forms with dropdown lists that are growing as you add new 
data?

i suspect either something is being held in memory longer than you think it 
is, or you are doing something that is causing web2py to do a query under 
the covers that loads large amounts of data.

cfh

On Monday, February 4, 2013 12:19:37 PM UTC-8, pumplerod wrote:

 To further elaborate.  I am running my web2py instance on a VPS at 
 dreamhost.com with a memory allocation of 4Gig.  It is running under 
 passenger.



 On Monday, February 4, 2013 12:16:38 PM UTC-8, pumplerod wrote:

 I had been having critical memory overflow problems and finally saw a 
 post about a memory leak in the version I was using (2.1.x) so I have 
 updated to the latest stable version (2.3.2), however I am still seeing my 
 memory climb until the machine crashes.

 I'm using web2py as my interface which is accepting data, parsing it, and 
 then appending to a neo4j database.  I thought, for a while, that neo4j was 
 the culprit, however, after writing a script to emulate what web2py was 
 doing and running it on a separate host I saw no memory jump.  It only 
 happens while running web2py, and only when I'm receiving many hundreds of 
 requests per min.  There is nothing else running on the machine, other than 
 system tools.  

 Within 5min I'm able to watch the memory go from a reasonable 730MB to 
 over 2500MB.

 I'm using the default SQLite database and am only making 1 or 2 calls to 
 the db upon each request.

 How can I track this down?  Should I be looking for something 
 specifically in the logs?  Use particular parameters for the logger?



-- 

--- 
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: simulate a join in google app engine

2013-02-05 Thread c h
you have to write multiple queries, and depending on what data and how much 
you are joining you might use different techniques.  you might also 
consider adjusting your datamodel to not require a join.

wanna share some more info about your datamodel so we can give some more 
pointed feedback?

thanks,

christian

On Sunday, February 3, 2013 12:48:53 PM UTC-8, Hallak Sidali wrote:

 how to simulate a join in google app engine using web2py

-- 

--- 
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-05 Thread Tim Richardson


On Tuesday, 5 February 2013 06:34:12 UTC+11, Leonel Câmara wrote:

 Hey,

 I don't know if this is relevant but I'm using webfaction with their 
 wiki's install script.  
   
 I was wondering what's the easy way to make the new Scheduler run 
 automatically when my application reboots.

 Thanks

I think that the secheduler runs in its own process and communicates via 
database tables, so normally the scheduler exists independently of the web 
server process (I suppose by rebooting your application you mean rebooting 
the web server?). 

That's the way it works on windows, in any case. I use rocket and I can 
restart that process (or service in Windows speak) without needing to stop 
and start the scheduler service. It just runs regardless of what the web 
server is doing.
 

-- 

--- 
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: DAL IntegrityError on MSSQL after upgrade to 2.3.2

2013-02-05 Thread Tim Richardson


 It seems that the newer version of web2py deemed there were some 
 differences between how the table is defined in the web2py model file and 
 how it i

 Did the DAL migrate functionality change significantly between version 
 1.93.2 and 2.3.2? 
 Can anyone advise?

 many thanks, 

 Andrew.


I use windows and MSSQL but just beginning, so I'm curious to know: why not 
disable migration?

-- 

--- 
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: Web2Py on OpenShift

2013-02-05 Thread webpypy

Hi Andrew,

Now, I have an application hosted on openshift web2py 2.0.9.
and it is working fine.

If I upgrade to 2.3.2 (by clicking on upgrade now) and then some problems 
happened, 
How do i return back to 2.0.9 ?

Regards,

Ashraf

-- 

--- 
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: DAL IntegrityError on MSSQL after upgrade to 2.3.2

2013-02-05 Thread Andrew Buchan
Tim,

I had tried with various permutations of migrate and fake_migrate on the
tables and in the top level db definition, but it kept timing out/freezing.
I now managed to get it to work using only migrate_enabled=False at the db
definition.

The thing is, I want migration enabled. That's one of the key things I like
about web2py... However if I set fake_migrate_all=True and reload data
Admin, it freezes and I have to restart the server again...

I know that the database tables match the definitions, because it all work
with migration enabled in the previous version. All I want is to be able to
upgrade web2py to the latest version and keep the migration enabled
behaviour.

Unless I find a way of achieving this within web2py, I think I'll try the
following:

1. Rename the live database.
2. Create temporary blank database with old name of live database.
3. Point the DAL files running from version 2.3.2 to that database with
migrate enabled, so it creates the tables and accordingly the .table files
(using the hash generated from the connection string in the file names).
4. Delete temp database.
5. Rename live database back to old name.
6. Pray that I get no issues when I reload Data Admin :-)

I'll report back with how that works, unless anyone can suggest a smarter
way in the meantime. (I know I could use a blank db with another name, and
rename the .table files to reuse the hash from the connection string to
live, I'll see...)








On Tue, Feb 5, 2013 at 10:55 AM, Tim Richardson t...@growthpath.com.auwrote:


 It seems that the newer version of web2py deemed there were some
 differences between how the table is defined in the web2py model file and
 how it i

 Did the DAL migrate functionality change significantly between version
 1.93.2 and 2.3.2?
 Can anyone advise?

 many thanks,

 Andrew.


 I use windows and MSSQL but just beginning, so I'm curious to know: why
 not disable migration?

 --

 ---
 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] How to show no seconds in a time field

2013-02-05 Thread Gerd
Hi web2py-users!

I've got the following question: I've defined two field like this


Field('Beginn','time',requires=IS_EMPTY_OR(IS_TIME()),label=T('Start'),represent=lambda
 
value, row: value.strftime('%H:%M') if value else ''), 

Field('Ende','time',requires=IS_EMPTY_OR(IS_TIME()),label=T('End'),represent=lambda
 
value, row: value.strftime('%H:%M') if value else ''), 

In the view of the SQLFORM.grid it looks perfect (see screenshot, no 
seconds in the fields Beginn and Ende)


But if i open it to edit then it looks like this (the seconds in Beginn and 
Ende are shown):


And further if i activate one of the fields Beginn or Ende it dismisses the 
seconds:


I've changed the web2py.js to the following, but i did'nt help
  
jQuery(input.time,target).each(function(){jQuery(this).timeEntry({show24Hours:true,
 
showSeconds:false});});


Anyone know how to prevent this behaviour?

Thanks in advance,
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.




Re: [web2py] Re: DAL IntegrityError on MSSQL after upgrade to 2.3.2

2013-02-05 Thread Niphlod
I guess simply disabling migration on auth will work, e.g. 
auth.define_table(migrate=False)

PS: if migrations are fired it means that the .table files are out of sync 
with your current model.

PS2: if you're totally sure that your current model is in sync with the 
database (hence the only things out of sync are the table files) you should 
use fake_migrate, let it on for a single request (given you're not using 
lazy_tables, a single request will recreate the .table files) and then turn 
fake_migrate off.

PS3: if you know for sure that the model doesn't change keeping migration 
on it's just a relatively big performance penalty. That being said, it's 
useful to let models in sync with table files, so at the following model 
change you just have to turn them on for a single request, see the 
migration happening and then turn migrations off.

On Tuesday, February 5, 2013 1:51:56 PM UTC+1, Andrew Buchan wrote:

 Tim,

 I had tried with various permutations of migrate and fake_migrate on the 
 tables and in the top level db definition, but it kept timing out/freezing. 
 I now managed to get it to work using only migrate_enabled=False at the db 
 definition. 

 The thing is, I want migration enabled. That's one of the key things I 
 like about web2py... However if I set fake_migrate_all=True and reload data 
 Admin, it freezes and I have to restart the server again...

 I know that the database tables match the definitions, because it all work 
 with migration enabled in the previous version. All I want is to be able to 
 upgrade web2py to the latest version and keep the migration enabled 
 behaviour. 

 Unless I find a way of achieving this within web2py, I think I'll try the 
 following:

 1. Rename the live database.
 2. Create temporary blank database with old name of live database.
 3. Point the DAL files running from version 2.3.2 to that database with 
 migrate enabled, so it creates the tables and accordingly the .table files 
 (using the hash generated from the connection string in the file names).
 4. Delete temp database.
 5. Rename live database back to old name.
 6. Pray that I get no issues when I reload Data Admin :-)

 I'll report back with how that works, unless anyone can suggest a smarter 
 way in the meantime. (I know I could use a blank db with another name, and 
 rename the .table files to reuse the hash from the connection string to 
 live, I'll see...)








 On Tue, Feb 5, 2013 at 10:55 AM, Tim Richardson 
 t...@growthpath.com.aujavascript:
  wrote:


 It seems that the newer version of web2py deemed there were some 
 differences between how the table is defined in the web2py model file and 
 how it i

 Did the DAL migrate functionality change significantly between version 
 1.93.2 and 2.3.2? 
 Can anyone advise?

 many thanks, 

 Andrew.


 I use windows and MSSQL but just beginning, so I'm curious to know: why 
 not disable migration?
  
 -- 
  
 --- 
 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 javascript:.
 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] Process POST data from cross domain using xdr for ie

2013-02-05 Thread vivek
hi ,

 I am posting some data to web2py server from IE browser via 
XDomainRequest . at the server am using request.post_vars[something] to 
make use of the recieved data.

But the DB insertion shows new line , but  None as the field data. 

Something special I have to be aware of ?

Regards,
Vivek

-- 

--- 
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: wiki: how to cache media files?

2013-02-05 Thread paolo.vall...@gmail.com
Great! I've just tested it and it seems to work very well, I am getting the
304 that I was looking for. Now many resources are no longer sent to the
client saving bandwidth, I think many web2py applications will appreciate
this speed up.

@Niphlod, the header you have mentioned will force to keep the same file
even if I update it, this is not the behaviour that I need in my app.

One more think about the download function.
Do we support parallel requests? Namely, I have recently read that the
default web2py approach is to serializes parallel ajax requests due to the
session lock. If that is true for download as well, I think we should add
an session.forget somwhere.
What do you think?


 Paolo


2013/2/4 Massimo Di Pierro massimo.dipie...@gmail.com

 In trunk!


 On Monday, 4 February 2013 15:05:05 UTC-6, Niphlod wrote:

 Uhm, I was just thinking to return a string instead of the open stream.
 attached the patch (some refactoring bits added)

 @Paolo: turns out that wiki has it's own download() function to handle
 files . in order to return cache headers you should do:

 def yourwikiindex():
 zero = request.args(0) or 'index'
 if zero and zero.isdigit():
 response.headers['Cache-**Control'] = 'max-age=31536'
 response.headers['Expires'] = 'Thu, 31 Dec 2037 23:59:59 GMT'
 return auth.wiki()



 On Monday, February 4, 2013 7:34:58 PM UTC+1, Massimo Di Pierro wrote:

 Honestly I would like to refactor all this logic in web2py. It was
 already done for web3py:

 https://github.com/mdipierro/**web3py/blob/master/web3py/**stream.pyhttps://github.com/mdipierro/web3py/blob/master/web3py/stream.py

 Anyway, if you can help fix it in web2py, we can merge everything later

 Massimo

 On Monday, 4 February 2013 11:46:03 UTC-6, Paolo valleri wrote:

 I thought the same about postponing the opening of the file. Moreover,
 just after globals:344 in the stream(...) function I have added

 if isinstance(stream, file):
 stream_file_or_304_or_206(stre**am.namehttp://stream.name
 ,
   **chunk_size=chunk_size,
   **request=request,
   **headers=headers,
   **status=self.status)

 and finally I got a 304 :-). As a result we are on the right direction,
 although there is no reason to open the file and take only its name. We
 need definitely something better



  Paolo


 2013/2/4 Niphlod nip...@gmail.com



 On Monday, February 4, 2013 3:38:29 PM UTC+1, Paolo valleri wrote:

 Hi Niphlod, I am still trying to understand why the wiki uploads are
 not returned as 304.
 The function in charged to return either 200 or 304 is
 stream_file_or_304_or_206 in streamer.py. Moreover, this function is only
 called in globals.py inside stream(...). Please have a look at
 globals.py:344, In order to be called the parameter 'stream' must be a
 string but with 'common' downloads the stream is an open file. This is 
 also
 documented by the comment in dal.py:9096. is what I've written correct ?


 seems so, but in this case I think it should be patched (as soon as
 I'll get home).

 For downloads that on the table are merely strings (i.e. on the table
 there's the path to the actual file, usually in the uploads folder) the
 correct way should be to defer the opening of the file down the line to
 gluon.streamer.
 A lot of logic has been added to store files on pyfilesystem (and
 without much tests on that, I hope I won't brake anything) but I think 
 that
 for default upload file the logic needs to be revisited.

  --

 ---
 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_outhttps://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.




-- 

--- 
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: wiki: how to cache media files?

2013-02-05 Thread Niphlod


On Tuesday, February 5, 2013 2:49:24 PM UTC+1, Paolo valleri wrote:

 Great! I've just tested it and it seems to work very well, I am getting 
 the 304 that I was looking for. Now many resources are no longer sent to 
 the client saving bandwidth, I think many web2py applications will 
 appreciate this speed up.

 @Niphlod, the header you have mentioned will force to keep the same file 
 even if I update it, this is not the behaviour that I need in my app.


Tune it s you like. From my POV an embedded media never changes. What 
changes is the media itself (i.e. if I want to change the image in a page, 
I upload a new image and change the pointers to it). 
If it's not your usecase, send cache headers at least one day in the future 
to avoid users scanning through your wiki to request media again and again.
 


 One more think about the download function. 
 Do we support parallel requests? Namely, I have recently read that the 
 default web2py approach is to serializes parallel ajax requests due to the 
 session lock. If that is true for download as well, I think we should add 
 an session.forget somwhere.
 What do you think?


Didn't test it, but you can of course. measure it with session.forget() 
in the if zero.isdigit() and without 

-- 

--- 
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 is MongoDB for web2py DAL?

2013-02-05 Thread samuel bonilla
look:

mongodb on web2py
http://www.web2pyslices.com/slice/show/1580/save-the-earth-from-a-total-data-mess-with-mongodbadapter



El lunes, 4 de febrero de 2013 09:39:00 UTC-5, Phyo Arkar escribió:

 Hello Web2py.

 I haven't update Web2py for long but we are now trying something with 
 Mongodb using DAL.

 What should i expect.

 1- How many percent of current web2py queries needed to be re-written.
 2- What are supported by Web2py DAL for MongoDB , what are Not (compare to 
 SQL RDBMS)
 3- Any pitfalls?



 What i want  is i want to know how many changes should be needed , if i 
 switch from Mysql to Mongodb , with help of DAL.


 In our APP we use as little Joins as Possible , mostly simple select and 
 Inserts. I guess if Mongdob Adapater .
 We want to use JSON , Nested List of Dictionaries structures , when we 
 switch to MongoDB , while leaving most of Select and Insert codes unchanged 
 and drop joins if necessary. 


-- 

--- 
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] GAE deployment questions...from a total beginner!

2013-02-05 Thread Riccardo C
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] Form processing and css

2013-02-05 Thread Calycé
Hi all,

I have a problem with a form which is not processing and I don't know why.
First things first, here's the definition of the form (this is for a 
contact page) from default.py:
def contacts():
form = SQLFORM.factory(
   Field('Name', requires=IS_NOT_EMPTY()),
   Field('Email', requires=IS_NOT_EMPTY()),
   Field('Phone', requires=IS_NOT_EMPTY()),
   Field('Message', 'text', requires=IS_NOT_EMPTY
()),
  )
if form.process().accepted:
response.flash  = 'Form accepted'
elif form.errors:

response.flash = 'Form has errors'

return dict(form=form)

Note: I know that there's no processing execpt for the flash but I'll add 
the missing bits later on.

And now the view:
{{extend 'layout.html'}}
section id=content class=border-bottom
div class=wrapper
div class=grid_13 omega
h3 class=p7Contact Form/h3
!--=== Contact form ==--
form id=contact-form
div class=success
Contact form submitted!br
strongWe will be in touch soon./strong
/div
{{=form}}
/form
/div
/div
/section

When using this view the form is never processed. I mean, I'm not even 
capable of retrieving the values from the form.
Now, if i use the following view:
{{exten 'layout.html'}}
{{=form}}
the form can be processed.

I don't understand why my form is unable to processed when put inside a div 
?!? Can a style prevent the form processing ?

I welcome any idea/comment cause I'm lost on this one.

Oh, and my search did not returned anything interesting but my google fu 
might not be as efficient as yours ;-)


Calycé

-- 

--- 
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: Cannot import module 'ldap'

2013-02-05 Thread Massimo Di Pierro
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 module
   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 
 module
   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.




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

2013-02-05 Thread Massimo Di Pierro
Please open a ticket about this and link to this page. This should 
definitively be done automatically. It is a web2py bug if it does not.

On Monday, 4 February 2013 17:24:47 UTC-6, Sebastian Cambeo wrote:

 yes it does work ok GAE ;)

 I am using currently the following workaround, but this should obviously 
 be handled by web2py and not by me, so please fix this:

 file = open('test.jpg', 'rb')
 tmpId = db.table1.insert(image = file)

 if request.env.web2py_runtime_gae:
  db(db.table1.id==tmpId).update(image_blob = file.read())





-- 

--- 
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: Form processing and css

2013-02-05 Thread Anthony
{{=form}} creates the form/form tags for you, so you've actually put 
one form inside another form.

Anthony

On Tuesday, February 5, 2013 9:34:10 AM UTC-5, Calycé wrote:

 Hi all,

 I have a problem with a form which is not processing and I don't know why.
 First things first, here's the definition of the form (this is for a 
 contact page) from default.py:
 def contacts():
 form = SQLFORM.factory(
Field('Name', requires=IS_NOT_EMPTY()),
Field('Email', requires=IS_NOT_EMPTY()),
Field('Phone', requires=IS_NOT_EMPTY()),
Field('Message', 'text', requires=IS_NOT_EMPTY
 ()),
   )
 if form.process().accepted:
 response.flash  = 'Form accepted'
 elif form.errors:

 response.flash = 'Form has errors'

 return dict(form=form)

 Note: I know that there's no processing execpt for the flash but I'll add 
 the missing bits later on.

 And now the view:
 {{extend 'layout.html'}}
 section id=content class=border-bottom
 div class=wrapper
 div class=grid_13 omega
 h3 class=p7Contact Form/h3
 !--=== Contact form ==--
 form id=contact-form
 div class=success
 Contact form submitted!br
 strongWe will be in touch soon./strong
 /div
 {{=form}}
 /form
 /div
 /div
 /section

 When using this view the form is never processed. I mean, I'm not even 
 capable of retrieving the values from the form.
 Now, if i use the following view:
 {{exten 'layout.html'}}
 {{=form}}
 the form can be processed.

 I don't understand why my form is unable to processed when put inside a 
 div ?!? Can a style prevent the form processing ?

 I welcome any idea/comment cause I'm lost on this one.

 Oh, and my search did not returned anything interesting but my google fu 
 might not be as efficient as yours ;-)


 Calycé


-- 

--- 
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: Include odbc and mssql support with pypyodbc.py

2013-02-05 Thread Massimo Di Pierro
I tried:

from contrib.pypyodbc import pypyodbc as pyodbc 

and I get:

gluon.contrib.pypyodbc.OdbcNoLibrary: 'ODBC Library is not found'

Can you help?

On Monday, 4 February 2013 18:09:31 UTC-6, Derek wrote:

 Any way we can add this?

 http://code.google.com/p/pypyodbc/

 It's a pure python implementation of pyodbc. I've tested it with pypy1.9 
 on web2py 2.3.2 and it works fine (yes, I edited dal.py and renamed all 
 instances of pyodbc to pypyodbc). 


-- 

--- 
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: wiki: how to cache media files?

2013-02-05 Thread paolo.vall...@gmail.com
I am wondering to understand if from the theoretical point of view is true
or not that parallel requests are not handled in parallel. In the meanwhile
I will try to monitor the gain that we can have by session.forget in all
the downloads().

 Paolo


2013/2/5 Niphlod niph...@gmail.com



 On Tuesday, February 5, 2013 2:49:24 PM UTC+1, Paolo valleri wrote:

 Great! I've just tested it and it seems to work very well, I am getting
 the 304 that I was looking for. Now many resources are no longer sent to
 the client saving bandwidth, I think many web2py applications will
 appreciate this speed up.

 @Niphlod, the header you have mentioned will force to keep the same file
 even if I update it, this is not the behaviour that I need in my app.


 Tune it s you like. From my POV an embedded media never changes. What
 changes is the media itself (i.e. if I want to change the image in a page,
 I upload a new image and change the pointers to it).
 If it's not your usecase, send cache headers at least one day in the
 future to avoid users scanning through your wiki to request media again and
 again.



 One more think about the download function.
 Do we support parallel requests? Namely, I have recently read that the
 default web2py approach is to serializes parallel ajax requests due to the
 session lock. If that is true for download as well, I think we should add
 an session.forget somwhere.
 What do you think?


 Didn't test it, but you can of course. measure it with
 session.forget() in the if zero.isdigit() and without

 --

 ---
 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] best practice for migrating wiki pages, tags, and media between repositories?

2013-02-05 Thread Michael Beller
I'm developing locally and using Git to manage and push updates to my 
server (pythonganywhere) via github.

I've excluded databases in gitignore but need to migrate the wiki tables.

I think I could add !databases/*wiki* to the gitignore for the sqlite 
tables but I'm thinking ahead when I plan to shift to mysql for this app.

Do you create an export and import process for the data?

I also read that I'll need to regenerate the wiki html and perhaps can 
add this to the import script.

-- 

--- 
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-05 Thread Leonel Câmara
Yes it exists, independently what I want is to stop and relaunch the 
process when the webserver reboots.

-- 

--- 
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: Web2Py on OpenShift

2013-02-05 Thread Andrew
Hey Ashraf,

If you find a particular snapshot or release isn't working for you, you 
have a few options.

Since there are a few different scenarios I'll cover the most common ones 
only:

Scenario 1:
You've upgraded but nothing is working and you can't even get to your 
web2py instance in openshift. You want to hard-reset back to the last 
working commit you had.

cd rhc-project-dir
git log (review output and identify which was the last commit id you were 
working happily with)
git reset --hard commit-id-here (looks like a guid)

Scenario 2:
You've upgraded and the app is working but some functionality broke or is 
behaving differently. You didn't discover this until significant further 
development of your web2py application. Now you want to revert to the 
previous web2py version but want to make sure you don't lose your app 
changes. Note, this will erase history in your git log, if you don't want 
this, read-up on git revert and git rebase.

cd rhc-project-dir
git log (review output and identify which was the last commit id you were 
working happily with)
git stash
git reset --hard commit-id-here
git pop

Also, if you go to grab 2.3.2, it's set as a separate branch. So make sure 
you switch to that branch otherwise you'll get the latest web2py commit. 
Readup on git checkout -b  and make sure you use upstream (or whatever you 
called the remote template repo).

Disclaimer: I'm not a git expert, so you'll probably want to read up on 
this stuff and get more familiar with git SCM. 

Regards,
Andrew

On Tuesday, February 5, 2013 6:12:59 AM UTC-6, webpypy wrote:


 Hi Andrew,

 Now, I have an application hosted on openshift web2py 2.0.9.
 and it is working fine.

 If I upgrade to 2.3.2 (by clicking on upgrade now) and then some problems 
 happened, 
 How do i return back to 2.0.9 ?

 Regards,

 Ashraf


-- 

--- 
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: Form processing and css

2013-02-05 Thread Calycé
Well... hmmm... errr I probably need to buy a new pair of glasses... 
That's what happens when one is adapting an existing template...
shame on me...  I really should have spotted this by myself...
Thanks a lot Anthony

On Tuesday, February 5, 2013 3:41:35 PM UTC+1, Anthony wrote:

 {{=form}} creates the form/form tags for you, so you've actually put 
 one form inside another form.

 Anthony

 On Tuesday, February 5, 2013 9:34:10 AM UTC-5, Calycé wrote:

 Hi all,

 I have a problem with a form which is not processing and I don't know why.
 First things first, here's the definition of the form (this is for a 
 contact page) from default.py:
 def contacts():
 form = SQLFORM.factory(
Field('Name', requires=IS_NOT_EMPTY()),
Field('Email', requires=IS_NOT_EMPTY()),
Field('Phone', requires=IS_NOT_EMPTY()),
Field('Message', 'text', requires=IS_NOT_EMPTY
 ()),
   )
 if form.process().accepted:
 response.flash  = 'Form accepted'
 elif form.errors:

 response.flash = 'Form has errors'

 return dict(form=form)

 Note: I know that there's no processing execpt for the flash but I'll add 
 the missing bits later on.

 And now the view:
 {{extend 'layout.html'}}
 section id=content class=border-bottom
 div class=wrapper
 div class=grid_13 omega
 h3 class=p7Contact Form/h3
 !--=== Contact form ==--
 form id=contact-form
 div class=success
 Contact form submitted!br
 strongWe will be in touch soon./strong
 /div
 {{=form}}
 /form
 /div
 /div
 /section

 When using this view the form is never processed. I mean, I'm not even 
 capable of retrieving the values from the form.
 Now, if i use the following view:
 {{exten 'layout.html'}}
 {{=form}}
 the form can be processed.

 I don't understand why my form is unable to processed when put inside a 
 div ?!? Can a style prevent the form processing ?

 I welcome any idea/comment cause I'm lost on this one.

 Oh, and my search did not returned anything interesting but my google fu 
 might not be as efficient as yours ;-)


 Calycé



-- 

--- 
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: Include odbc and mssql support with pypyodbc.py

2013-02-05 Thread Mariano Reingart
I think pyodbc works great on windows, for unix you should compile it
with unixODBC support:

http://code.google.com/p/pyodbc/wiki/Building

Anyway, surely in unix you will not have a tipical ODBC database to
test (MS SQLServer, MS Access, etc.) ...

Best regards

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com


On Tue, Feb 5, 2013 at 12:45 PM, Massimo Di Pierro
massimo.dipie...@gmail.com wrote:
 I tried:

 from contrib.pypyodbc import pypyodbc as pyodbc

 and I get:

 gluon.contrib.pypyodbc.OdbcNoLibrary: 'ODBC Library is not found'

 Can you help?


 On Monday, 4 February 2013 18:09:31 UTC-6, Derek wrote:

 Any way we can add this?

 http://code.google.com/p/pypyodbc/

 It's a pure python implementation of pyodbc. I've tested it with pypy1.9
 on web2py 2.3.2 and it works fine (yes, I edited dal.py and renamed all
 instances of pyodbc to pypyodbc).

 --

 ---
 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] Auth with Wordpress

2013-02-05 Thread Kenneth
Hello,

I have a case where an old site is done with Wordpress as front and 
authentication from an external database. Showing of content is then 
handled with somekind of XML viewer. Site contains 12 manuals. Manual 13 is 
done with web2py and the idea is to though out the very old Wordpress and 
XML viewer and handle everything from web2py. But due to time constraints 
we need to have every as it is now and only show the new manual from 
web2py. 

But how do I handle that WP takes care of authentication and somehow gives 
the customer rights to view the manual. 

Any ideas how to do this?


Kenneth

-- 

--- 
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: wiki: how to cache media files?

2013-02-05 Thread Massimo Di Pierro
Not sure I understand the question.

There are two issues. One is about sessions. Distinct requests from the 
same user/session are serialized unless session._unlock(request) is called.
Requests belonging to different session are executed in different threads 
but to a max number of threads specified by the web server. They are only 
serielized if they use sqlite and perform write operations because sqlite 
blocks. Mind that multiple threads running on the same host may be executed 
under the same python process. In this case they will be concurrent but not 
parallel because of python GIL. This can be avoided by forking multiple 
processes.

On Tuesday, 5 February 2013 09:14:17 UTC-6, Paolo valleri wrote:

 I am wondering to understand if from the theoretical point of view is true 
 or not that parallel requests are not handled in parallel. In the meanwhile 
 I will try to monitor the gain that we can have by session.forget in all 
 the downloads().

  Paolo


 2013/2/5 Niphlod nip...@gmail.com javascript:



 On Tuesday, February 5, 2013 2:49:24 PM UTC+1, Paolo valleri wrote:

 Great! I've just tested it and it seems to work very well, I am getting 
 the 304 that I was looking for. Now many resources are no longer sent to 
 the client saving bandwidth, I think many web2py applications will 
 appreciate this speed up.

 @Niphlod, the header you have mentioned will force to keep the same file 
 even if I update it, this is not the behaviour that I need in my app.


 Tune it s you like. From my POV an embedded media never changes. What 
 changes is the media itself (i.e. if I want to change the image in a page, 
 I upload a new image and change the pointers to it). 
 If it's not your usecase, send cache headers at least one day in the 
 future to avoid users scanning through your wiki to request media again and 
 again.
  


 One more think about the download function. 
 Do we support parallel requests? Namely, I have recently read that the 
 default web2py approach is to serializes parallel ajax requests due to the 
 session lock. If that is true for download as well, I think we should add 
 an session.forget somwhere.
 What do you think?


 Didn't test it, but you can of course. measure it with 
 session.forget() in the if zero.isdigit() and without 
  
 -- 
  
 --- 
 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 javascript:.
 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: skyrocketing memory. How to pinpoint the problem?

2013-02-05 Thread greaneym
Hello,
In addition sending the model, view, controller code, you can try the 
following.

It looks like dreamhost is using debian linux. You can try using the strace 
command in a shell while your process is running. You can run it against 
different process ids (pid) to help figure out what is associated with the 
problem.

Here is a link that may be useful in running strace.
http://www.hokstad.com/5-simple-ways-to-troubleshoot-using-strace
Save the output in a file so you can look at it.

Also you can run top in a shell to see what pid, program is running more 
than others and that may help you as well.





-- 

--- 
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-05 Thread Annet
Hi Gerd,

Maybe Anthony's reply in this post answers your question:

https://groups.google.com/forum/?fromgroups=#!searchin/web2py/annet$20represent/web2py/dIRLNvDDC_A/WVNLYcwkF4kJ

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: wiki: how to cache media files?

2013-02-05 Thread Niphlod


On Tuesday, February 5, 2013 5:30:11 PM UTC+1, Massimo Di Pierro wrote:

 Not sure I understand the question.


I think the doubt lies into the fact that given 1 request for the wiki page 
and ,e.g., 4 requests for 4 embedded images the 5 requests would be 
concurrent or serialized. In my apps whenever I don't use session I put at 
the top a session.forget(), and I know for a fact that static files are 
handled concurrently (they are outside session logic in main.py). 

In theory to download something (either in the default download() or in the 
catch of the wiki) session is not touched, so in case the requests are in 
fact serialized a session.forget() could/should be added.
 

-- 

--- 
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] Real Python for Web Development, featuring web2py

2013-02-05 Thread Bruno Rocha
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.




Re: [web2py] Re: DAL IntegrityError on MSSQL after upgrade to 2.3.2

2013-02-05 Thread Andrew Buchan
Niphlod,

Thanks for all that information. I was getting issues with more than just
auth tables so had to take a different approach.

I carried out roughly the steps which I described above, and am happy to
report it is all working perfectly!

Regarding PS3, I thought migration only happened when you refreshed the
Data Admin page. Are you telling me that the migration check occurs on
every request?
I always have a mirror copy of the live application pointing to the same
database for development. I take it it's best practice for the live
application that takes all the real user requests to
have migrate_enabled=False, and only keep it on in the development one in
that case...

Thanks,

Andrew.






On Tue, Feb 5, 2013 at 1:10 PM, Niphlod niph...@gmail.com wrote:

 I guess simply disabling migration on auth will work, e.g.
 auth.define_table(migrate=False)

 PS: if migrations are fired it means that the .table files are out of sync
 with your current model.

 PS2: if you're totally sure that your current model is in sync with the
 database (hence the only things out of sync are the table files) you should
 use fake_migrate, let it on for a single request (given you're not using
 lazy_tables, a single request will recreate the .table files) and then turn
 fake_migrate off.

 PS3: if you know for sure that the model doesn't change keeping migration
 on it's just a relatively big performance penalty. That being said, it's
 useful to let models in sync with table files, so at the following model
 change you just have to turn them on for a single request, see the
 migration happening and then turn migrations off.


 On Tuesday, February 5, 2013 1:51:56 PM UTC+1, Andrew Buchan wrote:

 Tim,

 I had tried with various permutations of migrate and fake_migrate on the
 tables and in the top level db definition, but it kept timing out/freezing.
 I now managed to get it to work using only migrate_enabled=False at the
 db definition.

 The thing is, I want migration enabled. That's one of the key things I
 like about web2py... However if I set fake_migrate_all=True and reload data
 Admin, it freezes and I have to restart the server again...

 I know that the database tables match the definitions, because it all
 work with migration enabled in the previous version. All I want is to be
 able to upgrade web2py to the latest version and keep the migration enabled
 behaviour.

 Unless I find a way of achieving this within web2py, I think I'll try the
 following:

 1. Rename the live database.
 2. Create temporary blank database with old name of live database.
 3. Point the DAL files running from version 2.3.2 to that database with
 migrate enabled, so it creates the tables and accordingly the .table files
 (using the hash generated from the connection string in the file names).
 4. Delete temp database.
 5. Rename live database back to old name.
 6. Pray that I get no issues when I reload Data Admin :-)

 I'll report back with how that works, unless anyone can suggest a smarter
 way in the meantime. (I know I could use a blank db with another name, and
 rename the .table files to reuse the hash from the connection string to
 live, I'll see...)








 On Tue, Feb 5, 2013 at 10:55 AM, Tim Richardson 
 t...@growthpath.com.auwrote:


 It seems that the newer version of web2py deemed there were some
 differences between how the table is defined in the web2py model file and
 how it i

 Did the DAL migrate functionality change significantly between version
 1.93.2 and 2.3.2?
 Can anyone advise?

 many thanks,

 Andrew.


 I use windows and MSSQL but just beginning, so I'm curious to know: why
 not disable migration?

 --

 ---
 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_outhttps://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.




-- 

--- 
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: best practice for migrating wiki pages, tags, and media between repositories?

2013-02-05 Thread Michael Beller
Still climbing my initial learning curve, the databases/*wiki* files are 
the web2py table definition files I believe.  I will need to export the 
wiki data as part of the migration process.

One option I'm evaluating is to export the wiki data in CSV format.  I've 
exposed the wiki tables to appadmin so I can easily manage and export the 
data.  However, import attempts to insert the data rather than update 
existing data.  Therefore, I could create an empty table for the import and 
then a migration function to either update or insert the data into the wiki 
table.

Any advice?

On Tuesday, February 5, 2013 10:22:31 AM UTC-5, Michael Beller wrote:

 I'm developing locally and using Git to manage and push updates to my 
 server (pythonganywhere) via github.

 I've excluded databases in gitignore but need to migrate the wiki tables.

 I think I could add !databases/*wiki* to the gitignore for the sqlite 
 tables but I'm thinking ahead when I plan to shift to mysql for this app.

 Do you create an export and import process for the data?

 I also read that I'll need to regenerate the wiki html and perhaps can 
 add this to the import script.


-- 

--- 
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] Forcing SSL mode (on GAE)

2013-02-05 Thread Philip Kilner

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: wiki: how to cache media files?

2013-02-05 Thread paolo.vall...@gmail.com
Niphlod has written exactly what I have in mind.
Given the fact that distinct requests from the same user/session are
serialized as Massimo has outlined from my point of view we should add
session.forget() or session._unlock(request) as early as possible in the
download() function of globals.py
@Massimo, which are the difference between session.forget(request) and
session._unlock(request)? Which one is the better to use in this case?

 Paolo


2013/2/5 Niphlod niph...@gmail.com



 On Tuesday, February 5, 2013 5:30:11 PM UTC+1, Massimo Di Pierro wrote:

 Not sure I understand the question.


 I think the doubt lies into the fact that given 1 request for the wiki
 page and ,e.g., 4 requests for 4 embedded images the 5 requests would be
 concurrent or serialized. In my apps whenever I don't use session I put at
 the top a session.forget(), and I know for a fact that static files are
 handled concurrently (they are outside session logic in main.py).

 In theory to download something (either in the default download() or in
 the catch of the wiki) session is not touched, so in case the requests are
 in fact serialized a session.forget() could/should be added.


 --

 ---
 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: Include odbc and mssql support with pypyodbc.py

2013-02-05 Thread Derek
As I said, I edited dal.py and replaced references to pyodbc to pypyodbc 
and that seemed to work. I believe the only adapter referencing it as a 
driver was the mssql driver.

On Tuesday, February 5, 2013 7:45:28 AM UTC-7, Massimo Di Pierro wrote:

 I tried:

 from contrib.pypyodbc import pypyodbc as pyodbc 

 and I get:

 gluon.contrib.pypyodbc.OdbcNoLibrary: 'ODBC Library is not found'

 Can you help?

 On Monday, 4 February 2013 18:09:31 UTC-6, Derek wrote:

 Any way we can add this?

 http://code.google.com/p/pypyodbc/

 It's a pure python implementation of pyodbc. I've tested it with pypy1.9 
 on web2py 2.3.2 and it works fine (yes, I edited dal.py and renamed all 
 instances of pyodbc to pypyodbc). 



-- 

--- 
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] Is it possible to modify textarea cols of SQLFORM.grid ?

2013-02-05 Thread Calycé
Hi all,

Can someone tell me if it's possible to change the number of cols for a 
textarea when editing a record through SQLFORM.grid ?
I tried with maxtextlength but w/o success. I also saw that there is 
maxtextlengths but I'm unsure on how to use it and if it is what I need.


Calycé

-- 

--- 
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: RuntimeError: Unable to handle upload

2013-02-05 Thread Bill Thayer
Hi Alan. Seeing your code must have helped because I did get it to run. 

The following shows a demo script with functions to upload a file and 
download a file utilizing a table containing a blob field. It worked twice 
on a pdf for me. Note that I had to change the filename type from 'upload' 
to 'string' in order to bypass an error message in the 
dal._attempt_upload(fields).

# -*- coding: cp1252 -*-
import os, sys
from gluon import DAL, Field, fileutils
from easygui import fileopenbox, diropenbox

db = DAL('oracle://...',
 auto_import=True)  ## Still playing with this one to try and avoid 
re-defining table?

db.define_table('wiki_media',
Field('filename', 'upload', uploadfield='filedata'),
Field('title', 'string'),
Field('filedata', 'blob'),
migrate=False, fake_migrate=True)

def upload_file():
demonstrate uploading a file to database programatically,

stream=None
file_path=fileopenbox(msg='Pick a file', title='Picking files', 
default=None)
if file_path:
print 'file_path= ' + file_path
stream = open(file_path, 'rb')
else:
print 'file_path undefined'
return None

path,filename = os.path.split(file_path)
#workaround to possible suprise bug in web2py?
db.wiki_media.filename.type='string'

file_id=db.wiki_media.insert(filename=db.wiki_media.filename.store(stream, 
filename=filename, path=path), filedata=stream.read())
db.commit()
stream.close()
if file_id:
print 'file_id=' + str(file_id)
return file_id


def download_file(file_id, table='wiki_media'):
 In this demo will download the file with the given file_id from the
given table. Table must have a filename field of type upload and a
filedata field of type blob

table = db[table]
if file_id:
print 'file_id=' + str(file_id)
else:
print 'file_id is empty'
return None

directory=diropenbox(title='Select destination directory')

record = table(table.id==file_id)
(filename, stream) = table.filename.retrieve(record.filename)
pathname = os.path.join(directory,filename)

import shutil   #In fileutils.py the developer mentioned he 
suspects a bug in shutil.copyfileobj
#but I didn't know how to get the length of a 
cStringIO object to 
#use fileutils.copystream()

shutil.copyfileobj(stream,open(pathname,'wb'))

stream.close()

return


Hope it helps someone.

-Bill



-- 

--- 
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] skyrocketing memory. How to pinpoint the problem?

2013-02-05 Thread Todd Shifflett
I'm reading up on strace now.  in the meanwhile, here is the MVC code  (not 
sure if I can attach a file to google groups)….


Model:

-Nothing.  I have an empty model file.  Other than the default settings that 
come with a new controller.  
Ordinarily I am using a Model and writing to the SQLite db.  But this is the 
simplest case I could make that 
still replicates the problem.

View:

-Don't have this either.  I'm only ever returning a json object via REST so 
there's no need for a view.

Controller:  
You can see some of what normally gets loaded, which I've commented 
out.  I also tried to see if gc or cache would help.  
I've never used these before though so I may have been doing it 
incorrectly.

the RESTful query would look something like:   
http://domain.com/memclimb/request.json?jo={Test:memory}


request.py (controller)...
___vv__
@request.restful()
#@cache(request.env.path_info,time_expire=10,cache_model=cache.ram)
def test():
  #import gc
  import gluon.contrib.simplejson
  response.view = 'generic.'+request.extension
  #gc.enable()

  def GET(*args,**vars):

jsonObject = request.vars.jo
obj =  gluon.contrib.simplejson.loads(jsonObject)
return {'message': 'testing Memory.'}

  #gc.collect()
  return locals()
___^^

Only seems to be a problem under high traffic.  So I created this python script 
and ran 10 instances of it from another machine.  
It's common for our site to have 100 trying to hit it at about the same time, 
but I can see the memory climb even with only 10.

testLoad.py...
vv
#!/usr/bin/env python

import sys
import os
import urllib

def main():
  for i in range(1000):
result = 
urllib.urlopen('https://domain.com/memclimb/request/test.json?jo={Test:memory}')
json = result.read()
  print done…\n\t%s%json


if __name__ == '__main__':
  main()
__^^



On Feb 5, 2013, at 8:30 AM, greaneym wrote:

 Hello,
 In addition sending the model, view, controller code, you can try the 
 following.
 
 It looks like dreamhost is using debian linux. You can try using the strace 
 command in a shell while your process is running. You can run it against 
 different process ids (pid) to help figure out what is associated with the 
 problem.
 
 Here is a link that may be useful in running strace.
 http://www.hokstad.com/5-simple-ways-to-troubleshoot-using-strace
 Save the output in a file so you can look at it.
 
 Also you can run top in a shell to see what pid, program is running more 
 than others and that may help you as well.
 
 
 
 
 -- 
  
 --- 
 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.




Re: [web2py] Re: wiki: how to cache media files?

2013-02-05 Thread Massimo Di Pierro
I agree. In trunk.

they both unlock but session.forget(response) does not save the session. 
session._unlock(response) instead still saves the session when the request 
is completed.


On Tuesday, 5 February 2013 12:33:03 UTC-6, Paolo valleri wrote:

 Niphlod has written exactly what I have in mind. 
 Given the fact that distinct requests from the same user/session are 
 serialized as Massimo has outlined from my point of view we should add 
 session.forget() or session._unlock(request) as early as possible in the 
 download() function of globals.py
 @Massimo, which are the difference between session.forget(request) and 
 session._unlock(request)? Which one is the better to use in this case?

  Paolo


 2013/2/5 Niphlod nip...@gmail.com javascript:



 On Tuesday, February 5, 2013 5:30:11 PM UTC+1, Massimo Di Pierro wrote:

 Not sure I understand the question.


 I think the doubt lies into the fact that given 1 request for the wiki 
 page and ,e.g., 4 requests for 4 embedded images the 5 requests would be 
 concurrent or serialized. In my apps whenever I don't use session I put at 
 the top a session.forget(), and I know for a fact that static files are 
 handled concurrently (they are outside session logic in main.py). 

 In theory to download something (either in the default download() or in 
 the catch of the wiki) session is not touched, so in case the requests are 
 in fact serialized a session.forget() could/should be added.
  
  
 -- 
  
 --- 
 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 javascript:.
 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: Include odbc and mssql support with pypyodbc.py

2013-02-05 Thread Massimo Di Pierro
Which os? Not for me.

On Tuesday, 5 February 2013 12:53:07 UTC-6, Derek wrote:

 As I said, I edited dal.py and replaced references to pyodbc to pypyodbc 
 and that seemed to work. I believe the only adapter referencing it as a 
 driver was the mssql driver.

 On Tuesday, February 5, 2013 7:45:28 AM UTC-7, Massimo Di Pierro wrote:

 I tried:

 from contrib.pypyodbc import pypyodbc as pyodbc 

 and I get:

 gluon.contrib.pypyodbc.OdbcNoLibrary: 'ODBC Library is not found'

 Can you help?

 On Monday, 4 February 2013 18:09:31 UTC-6, Derek wrote:

 Any way we can add this?

 http://code.google.com/p/pypyodbc/

 It's a pure python implementation of pyodbc. I've tested it with pypy1.9 
 on web2py 2.3.2 and it works fine (yes, I edited dal.py and renamed all 
 instances of pyodbc to pypyodbc). 



-- 

--- 
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: Is it possible to modify textarea cols of SQLFORM.grid ?

2013-02-05 Thread Massimo Di Pierro
I normally use width

On Tuesday, 5 February 2013 12:55:37 UTC-6, Calycé wrote:

 Hi all,

 Can someone tell me if it's possible to change the number of cols for a 
 textarea when editing a record through SQLFORM.grid ?
 I tried with maxtextlength but w/o success. I also saw that there is 
 maxtextlengths but I'm unsure on how to use it and if it is what I need.


 Calycé


-- 

--- 
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: Is it possible to modify textarea cols of SQLFORM.grid ?

2013-02-05 Thread Derek
edit the web2py.css and change the width and height of 'textarea'.

On Tuesday, February 5, 2013 11:55:37 AM UTC-7, Calycé wrote:

 Hi all,

 Can someone tell me if it's possible to change the number of cols for a 
 textarea when editing a record through SQLFORM.grid ?
 I tried with maxtextlength but w/o success. I also saw that there is 
 maxtextlengths but I'm unsure on how to use it and if it is what I need.


 Calycé


-- 

--- 
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-05 Thread José Eloy
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: DAL IntegrityError on MSSQL after upgrade to 2.3.2

2013-02-05 Thread Niphlod


On Tuesday, February 5, 2013 6:33:07 PM UTC+1, Andrew Buchan wrote:

 Niphlod, 

 Thanks for all that information. I was getting issues with more than just 
 auth tables so had to take a different approach.

 I carried out roughly the steps which I described above, and am happy to 
 report it is all working perfectly!

 Regarding PS3, I thought migration only happened when you refreshed the 
 Data Admin page. Are you telling me that the migration check occurs on 
 every request?

 
just to confirm, the model is confronted to the .table files at EVERY 
request. 

Probably the first two best advices on how do I speed up my app? are a) 
turn the migrations off and b) the lazy_tables on. 

I always have a mirror copy of the live application pointing to the same 
 database for development. I take it it's best practice for the live 
 application that takes all the real user requests to 
 have migrate_enabled=False, and only keep it on in the development one in 
 that case...

 Thanks,

 Andrew.



-- 

--- 
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-05 Thread Niphlod
+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.




[web2py] Re: Include odbc and mssql support with pypyodbc.py

2013-02-05 Thread Derek
This was on Windows.

It appears to be looking in these locations:
/usr/lib/libodbc.so,/usr/lib/i386-linux-gnu/libodbc.so,/usr/lib/x86_64-linux-gnu/libodbc.so

So, if it's not in those locations, you might want to add your libodbc.so 
location.

line 462 of pypyodbc.py

On Tuesday, February 5, 2013 12:26:32 PM UTC-7, Massimo Di Pierro wrote:

 Which os? Not for me.

 On Tuesday, 5 February 2013 12:53:07 UTC-6, Derek wrote:

 As I said, I edited dal.py and replaced references to pyodbc to pypyodbc 
 and that seemed to work. I believe the only adapter referencing it as a 
 driver was the mssql driver.

 On Tuesday, February 5, 2013 7:45:28 AM UTC-7, Massimo Di Pierro wrote:

 I tried:

 from contrib.pypyodbc import pypyodbc as pyodbc 

 and I get:

 gluon.contrib.pypyodbc.OdbcNoLibrary: 'ODBC Library is not found'

 Can you help?

 On Monday, 4 February 2013 18:09:31 UTC-6, Derek wrote:

 Any way we can add this?

 http://code.google.com/p/pypyodbc/

 It's a pure python implementation of pyodbc. I've tested it with 
 pypy1.9 on web2py 2.3.2 and it works fine (yes, I edited dal.py and 
 renamed 
 all instances of pyodbc to pypyodbc). 



-- 

--- 
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] grid, user_signature, and apache auth

2013-02-05 Thread Mike
Hello,

I am using an SSO apache module to handle authentication which passes the 
username to web2py via the remote_user environment variable. I added some 
logic in the models to check for this and create a user if not already 
there. 

model file relevant lines: 
 
---

auth.define_tables(username=True, signature=False)
auth.settings.create_user_groups = False
auth.user = 
auth.get_or_create_user(dict(username=request.env['remote_user']))

controller: 
---

@auth.requires_login()
def switches_grid_manage():

form = SQLFORM.grid(db.switches,onupdate=auth.archive,
user_signature=True,
create=auth.has_membership('admins'),
editable=auth.has_membership('admins'),
deletable=auth.has_membership('admins'),
maxtextlength=35,
paginate=52
)   

if auth.has_membership('admins'):
quick_link=A('Quick 
Insert',_href=URL('switches_quick_insert'))
else: quick_link=' '

return locals()


As far as I can tell I am logged in, I am able to see this grid and the 
quick_link hyperlink but I can't see an edit button on the grid unless I 
change user_signature to False. I assume I am not mapping the login 
function correctly? Can anyone offer me some pointers here?

Thanks in advance for any assistance.

--Mike


-- 

--- 
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] Import problem in Web2py 2.3.2 vs 1.99.4

2013-02-05 Thread Álvaro José Iradier
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] error in GAE

2013-02-05 Thread samuel bonilla
i'm runing my app on GAE and i get this error :

http://web2pyutil.appspot.com/web2pyutil

Internal errorTicket issued: 
unknownhttp://web2pyutil.appspot.com/admin/default/ticket/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.




[web2py] Re: Cannot import module 'ldap'

2013-02-05 Thread Nicholas Duffy
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 module
   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 
 module
   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.




[web2py] Re: Include odbc and mssql support with pypyodbc.py

2013-02-05 Thread Massimo Di Pierro
What you are telling me is that pypyodbc does not require additional python 
packages but it requires odbc.

On Tuesday, 5 February 2013 14:02:54 UTC-6, Derek wrote:

 This was on Windows.

 It appears to be looking in these locations:

 /usr/lib/libodbc.so,/usr/lib/i386-linux-gnu/libodbc.so,/usr/lib/x86_64-linux-gnu/libodbc.so

 So, if it's not in those locations, you might want to add your libodbc.so 
 location.

 line 462 of pypyodbc.py

 Yes, so it appears the OS.Exists(path) for those three locations didn't 
 exist. So either your libodbc is in a different place, or you don't have it 
 installed.

 On Tuesday, February 5, 2013 12:26:32 PM UTC-7, Massimo Di Pierro wrote:

 Which os? Not for me.

 On Tuesday, 5 February 2013 12:53:07 UTC-6, Derek wrote:

 As I said, I edited dal.py and replaced references to pyodbc to pypyodbc 
 and that seemed to work. I believe the only adapter referencing it as a 
 driver was the mssql driver.

 On Tuesday, February 5, 2013 7:45:28 AM UTC-7, Massimo Di Pierro wrote:

 I tried:

 from contrib.pypyodbc import pypyodbc as pyodbc 

 and I get:

 gluon.contrib.pypyodbc.OdbcNoLibrary: 'ODBC Library is not found'

 Can you help?

 On Monday, 4 February 2013 18:09:31 UTC-6, Derek wrote:

 Any way we can add this?

 http://code.google.com/p/pypyodbc/

 It's a pure python implementation of pyodbc. I've tested it with 
 pypy1.9 on web2py 2.3.2 and it works fine (yes, I edited dal.py and 
 renamed 
 all instances of pyodbc to pypyodbc). 



-- 

--- 
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: Import problem in Web2py 2.3.2 vs 1.99.4

2013-02-05 Thread Massimo Di Pierro
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: error in GAE

2013-02-05 Thread Massimo Di Pierro
Look in the GAE log for the actual error.

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: 
 unknownhttp://web2pyutil.appspot.com/admin/default/ticket/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.




[web2py] Re: Cannot import module 'ldap'

2013-02-05 Thread Massimo Di Pierro
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 module
   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 
 module
   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.




[web2py] Re: 2.2.1 auth.wiki() automatically adds users to wiki_editor group. Bug or feature?

2013-02-05 Thread Michael Beller
I'm still having this error in 2.3.2

Every new user is added to wiki_editor group.  Even if I remove the user 
from the group, the user still has access to the wiki menu (I've specified 
menugroups - see below) and when the user logsout and logsin again they are 
automatically added back to the wiki_editor group.

I have the following statement in my model after auth.define_tables:

auth.wiki(resolve=False, manage_permissions=True, 
menugroups=['wiki_editor','wiki_author'])

On Thursday, November 8, 2012 5:25:43 PM UTC-5, Massimo Di Pierro wrote:

 Please open a ticket. Will fix this tonight.

 On Thursday, 8 November 2012 14:50:51 UTC-6, Dragan Matic wrote:

 I can confirm and replicate this bug, the same happens on windows 
 binaries and on ubuntu with source with latest stable version - 2.2.1. 

 Here are the steps to replicate the bug:

 1. create new app
 2. create new page (default/wikipage.html) and controller that returns 
 auth.wiki(manage_permissions=True)
 3. go to wikipage, I am now redirected to user login
 4. register first user, go to default/wikipage
 5. create first wiki page, accept defaults and submit
 6. logout, register second user
 7. go to appadmin, check auth_membership table, second user is not a 
 member of wiki_editor
 8. with second user visit default/wikipage
 9. go to appadmin, check auth_membership table, second user has now 
 automatically become a member of wiki_editor


 On Thursday, November 8, 2012 5:23:24 PM UTC+1, Massimo Di Pierro wrote:

 The rule is the first user to register is also a wiki_editor. This 
 should not happen for other users. If it happens it is a bug. Can you 
 confirm this is working as intended?

 On Thursday, 8 November 2012 08:00:31 UTC-6, Dragan Matic wrote:

 I am doing an auth.wiki(manage_permissions=True). 

 Basically, I want to have a wiki writer and a wiki_reader who will not 
 be able to edit wiki posts. Two users (reader and writer) are registered 
 and two groups are automatically opened (user_1 and user_2). For every 
 wiki 
 post user_1 and user_2 are set to read it and only user_1 can edit it. 
 However, whenever wiki reader logs in, a row is automatically inserted 
 into 
 auth_membership table which maps wiki_reader user to wiki_editor group, so 
 he can also edit posts. Is this a bug or is there a way to set a user to 
 be 
 a wiki reader only?

 Thanks
 Dragan



-- 

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

2013-02-05 Thread Massimo Di Pierro
https://stripe.com/blog/announcing-mosql

-- 

--- 
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-05 Thread samuel bonilla
but a ge this error in the console

/root//Desktop/webdev/google_appengine/appcfg.py
--email=my_em...@gmail.com--passin update /home/www-data/web2py

05:57 PM Host: appengine.google.com
05:57 PM Application: web2pyutil; version: 5
05:57 PM
Starting update of app: web2pyutil, version: 5
05:57 PM Getting current resource limits.
05:57 PM Scanning files on local disk.
Could not guess mimetype for
applications/init/static/plugin_ckeditor/ckeditor.pack.  Using
application/octet-stream.
05:57 PM Scanned 500 files.
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/font/fontawesome-webfont.ttf.  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.backup.  Using
application/octet-stream.
Could not guess mimetype for
applications/init/static/menu/css/bootstrap.css..  Using
application/octet-stream.
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

Re: [web2py] Re: error in GAE

2013-02-05 Thread samuel bonilla
i'm using: linux backtrack 5.

2013/2/5 samuel bonilla pythonn...@gmail.com

 but a ge this error in the console

 /root//Desktop/webdev/google_appengine/appcfg.py --email=
 my_em...@gmail.com --passin update /home/www-data/web2py

 05:57 PM Host: appengine.google.com
 05:57 PM Application: web2pyutil; version: 5
 05:57 PM
 Starting update of app: web2pyutil, version: 5
 05:57 PM Getting current resource limits.
 05:57 PM Scanning files on local disk.
 Could not guess mimetype for
 applications/init/static/plugin_ckeditor/ckeditor.pack.  Using
 application/octet-stream.
 05:57 PM Scanned 500 files.
 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/font/fontawesome-webfont.ttf.  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.backup.  Using
 application/octet-stream.
 Could not guess mimetype for
 applications/init/static/menu/css/bootstrap.css..  Using
 application/octet-stream.
 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
 

Re: [web2py] Re: error in GAE

2013-02-05 Thread samuel bonilla
i'm using: linux backtrack 5 r3...

2013/2/5 samuel bonilla pythonn...@gmail.com

 but a ge this error in the console

 /root//Desktop/webdev/google_appengine/appcfg.py --email=
 my_em...@gmail.com --passin update /home/www-data/web2py

 05:57 PM Host: appengine.google.com
 05:57 PM Application: web2pyutil; version: 5
 05:57 PM
 Starting update of app: web2pyutil, version: 5
 05:57 PM Getting current resource limits.
 05:57 PM Scanning files on local disk.
 Could not guess mimetype for
 applications/init/static/plugin_ckeditor/ckeditor.pack.  Using
 application/octet-stream.
 05:57 PM Scanned 500 files.
 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/font/fontawesome-webfont.ttf.  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.backup.  Using
 application/octet-stream.
 Could not guess mimetype for
 applications/init/static/menu/css/bootstrap.css..  Using
 application/octet-stream.
 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
 

Re: [web2py] Re: error in GAE

2013-02-05 Thread Javier Quarite
On Tue, Feb 5, 2013 at 6:03 PM, samuel bonilla pythonn...@gmail.com 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/fontawesome-webfont.ttf.  Using
 application/octet-stream.
 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/menu/css/bootstrap.css.original.  Using
 application/octet-stream.
 Could not guess mimetype for
 applications/init/static/bootstrap/css/bootstrap.css.united.  Using
 application/octet-stream.
 Could not guess mimetype for
 applications/init/static/bootstrap/css/bootstrap.css.original.  Using
 application/octet-stream.
 Could not guess 

Re: [web2py] mosql

2013-02-05 Thread Bruno Rocha
Looks awesome..

I already used the Mongo Data Wrapper (
https://github.com/citusdata/mongo_fdw) to replicate my Postgres data to
Mongo, I will take a closer look on this.


Thanks for sharing.

-- 

--- 
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: Include odbc and mssql support with pypyodbc.py

2013-02-05 Thread Derek
Yup. It uses ctypes to access your existing odbc libraries.

On Tuesday, February 5, 2013 3:22:45 PM UTC-7, Massimo Di Pierro wrote:

 What you are telling me is that pypyodbc does not require additional 
 python packages but it requires odbc.

 On Tuesday, 5 February 2013 14:02:54 UTC-6, Derek wrote:

 This was on Windows.

 It appears to be looking in these locations:

 /usr/lib/libodbc.so,/usr/lib/i386-linux-gnu/libodbc.so,/usr/lib/x86_64-linux-gnu/libodbc.so

 So, if it's not in those locations, you might want to add your libodbc.so 
 location.

 line 462 of pypyodbc.py

 Yes, so it appears the OS.Exists(path) for those three locations didn't 
 exist. So either your libodbc is in a different place, or you don't have it 
 installed.

 On Tuesday, February 5, 2013 12:26:32 PM UTC-7, Massimo Di Pierro wrote:

 Which os? Not for me.

 On Tuesday, 5 February 2013 12:53:07 UTC-6, Derek wrote:

 As I said, I edited dal.py and replaced references to pyodbc to 
 pypyodbc and that seemed to work. I believe the only adapter referencing 
 it 
 as a driver was the mssql driver.

 On Tuesday, February 5, 2013 7:45:28 AM UTC-7, Massimo Di Pierro wrote:

 I tried:

 from contrib.pypyodbc import pypyodbc as pyodbc 

 and I get:

 gluon.contrib.pypyodbc.OdbcNoLibrary: 'ODBC Library is not found'

 Can you help?

 On Monday, 4 February 2013 18:09:31 UTC-6, Derek wrote:

 Any way we can add this?

 http://code.google.com/p/pypyodbc/

 It's a pure python implementation of pyodbc. I've tested it with 
 pypy1.9 on web2py 2.3.2 and it works fine (yes, I edited dal.py and 
 renamed 
 all instances of pyodbc to pypyodbc). 



-- 

--- 
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: Cannot import module 'ldap'

2013-02-05 Thread Brian M
Have you installed python-ldap - http://pypi.python.org/pypi/python-ldap/ ?

On Tuesday, February 5, 2013 4:20:05 PM 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 module
   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 
 module
   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.




[web2py] Re: Cannot import module 'ldap'

2013-02-05 Thread Nicholas Duffy
C:\Console2python
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 module
   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 
 module
   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.




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

2013-02-05 Thread Álvaro J . Iradier
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.dipie...@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+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] Re: How to dont show seconds in a time field

2013-02-05 Thread Gerd
Hi Annet!

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

Thank you
Gerd

Am Dienstag, 5. Februar 2013 17:33:56 UTC+1 schrieb Annet:

 Hi Gerd,

 Maybe Anthony's reply in this post answers your question:


 https://groups.google.com/forum/?fromgroups=#!searchin/web2py/annet$20represent/web2py/dIRLNvDDC_A/WVNLYcwkF4kJ

 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.