Re: [web2py] Re: web2py and python3

2018-12-21 Thread max


*Did some quick tests with python 3.5.2  and it seems now web2py master branch 
is python3 compatible.*


*Is there anything , I should worry before switching it to a production modus.*




On Thursday, May 11, 2017 at 2:08:43 PM UTC+2, Richard wrote:
>
> No problem... I can't say when Massimo's gonna disclose his new framework, 
> you have to ask him... But it should be soon as he compromise his self 
> saying he has one in the pipeline... Keep tune...
>
> :)
>
> Richard
>
> On Thu, May 11, 2017 at 3:49 AM, Muhammad Hashim Malik <
> has...@rehmansoft.com > wrote:
>
>> Dear Richard
>>
>> I know web2py can be used with python3, but, I want to play with web3py 
>> and waiting for that badly. Please dont' mind my restless waiting for new 
>> framework.
>>
>> Truly,
>> Malik Muhammad Hashim
>>
>>
>>
>>
>> *Malik M. Hashim*
>> PO MCC(East)
>> +92-300-3754107
>>
>>
>>
>> On Tue, May 2, 2017 at 8:51 PM, Richard Vézina > > wrote:
>>
>>> Muhammad,
>>>
>>> I don't recall any promise about a date mention by Massimo... Thanks to 
>>> consider that all this is open source project and there is no specific 
>>> timeline attach to these initiatives...
>>>
>>> web2py is still there and I guess we all can be confident that Massimo 
>>> will take care to soften the transition between web2py and possibly named 
>>> web3py future framework...
>>>
>>> If you just wait a new web2py version that will support python 3, I 
>>> guess it coming, but it not ready yet, you may use the trunk/latest on 
>>> github which I heard works for the most part with python 3. You may also 
>>> consider reporting issue which will help us to fix as much as them as 
>>> possible before the next release (please read the README before use python 
>>> 3 and backup your app as there is no way back to python 2 - of course you 
>>> may always revert change if you app is properly tracked by version control 
>>> but I don't suggest to rely over it)...
>>>
>>> Thanks
>>>
>>> Richard
>>>
>>> On Sun, Apr 30, 2017 at 11:31 PM, Muhammad Hashim Malik <
>>> has...@rehmansoft.com > wrote:
>>>
 Badly waiting for web3py. It was announced that web3py will be 
 available​ at the end of April. 

 On 12-Apr-2017 6:37 PM, "Massimo Di Pierro" >>> > wrote:

 May be some code will be released at the end of April. Very preliminary 
 but I will be looking for feedback.

 On Wednesday, 12 April 2017 07:56:17 UTC-5, JorgeH wrote:
>
>
>
> On Wednesday, April 12, 2017 at 6:37:44 AM UTC-5, Massimo Di Pierro 
> wrote:
>>
>>
>>
>> I am working on web3py which is not to be confused with web2py for 
>> python 3. For this reason it will have another name. It will not be 
>> compatible with web2py (python 2 or python 3) but it will have a lot of 
>> the 
>> features that you like and more and be 10x faster.
>>
>
> Great news Massimo! 
> Any hint  on a temptative release date? 
>
 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/UKcWKU66qnA/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com .
 For more options, visit https://groups.google.com/d/optout.


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

>>>
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/web2py/UKcWKU66qnA/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> web2py+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received

Re: [web2py] Re: Slow TTFB debugging with Wing IDE

2016-04-13 Thread Max Slimmer
I'm doing that with sessions.
I'm pretty sure this is something to do with the IDE. I'll keep
investigating.

On Fri, Apr 8, 2016 at 1:27 AM, Niphlod  wrote:

> just call session.forget(response). You can read from the session as you
> like.
> session.forget() isn't going to add concurrency, it just not saves the
> session even in the event it got modifiedbut it still locks.
>
>
> On Thursday, April 7, 2016 at 9:12:13 PM UTC+2, MDSIII wrote:
>>
>> Thanks for the quick reply Niphlod. That was the first thing I tried but
>> it didn't help. Am I doing forget() correctly if I read a session attribute
>> and then call forget but never write to the session (until later of course)?
>>
>> Something I forgot to mention, some, but not all, the controller
>> functions access the DB (sqlite) but just read.
>>
>> On Thursday, April 7, 2016 at 12:04:41 PM UTC-7, Niphlod wrote:
>>>
>>> IMHO it's just sessions being locked to prevent concurrent
>>> modifications.
>>>
>>> if your ajax requests aren't using the session, put a
>>>
>>> session.forget(response)
>>>
>>> at the top of your function.
>>>
>>> http://web2py.com/books/default/chapter/29/04/the-core#session
>>>
>>> On Thursday, April 7, 2016 at 8:46:16 PM UTC+2, MDSIII wrote:
>>>>
>>>> Running web2py from the Wing IDE, so using the built-in rocket server,
>>>> I see long Waiting times in Chrome Dev Tools for my ajax requests. I'm
>>>> getting times in excess of 6 or 8 seconds.
>>>> This is a single page application that fires off a bunch (7 or 8) ajax
>>>> requests after the initial page load. I'm not sure how to confirm it but it
>>>> seems as though the server is handling these requests serially.
>>>> When I make a request to one of these long wait controller functions
>>>> singly (either non-xhr or with xhr) it returns pretty quick (< 1 sec.).
>>>> If I start web2py from console I don't see these long wait times.
>>>>
>>>> I'm pretty sure this is due to how wing manages worker threads but I'm
>>>> hoping someone here also uses Wing for development and knows why this
>>>> happens and a "fix". I don't remember it always being like this on previous
>>>> versions.
>>>>
>>>> Using wing 5.1.10
>>>> and web2py 2.13.4
>>>>
>>>> Thanks,
>>>>
>>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/Hf_HtBX9r6M/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
--Max III

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


[web2py] Intergrating another python tool in web2py

2015-04-21 Thread max

I would like to runs a  typesetting tool which generates a  TEI xml from a 
word doc ,  after a file is uploaded to web2py.
I have the ubuntu script configuration from web2py with the user www-data 
running the web2py framework.
I have given the typesetting script the www-data  rights , but it cannot  
set the rights.
Does somebody have any idea, how I can give the rights?

Thanks for anybody for any idea?



import os
import shutil
import subprocess
def metypeset_conversion(filename):
app_path = '/home/www-data/web2py/applications/HEIDIEditor/'
metypeset_path = app_path+'static/meTypeset/bin/meTypeset.py'
file_type = 'docx'
file_path  =app_path+ 'uploads/'+filename
output_path  = app_path +'uploads/'+ filename.rsplit('.', 1)[0]
if not os.path.exists(output_path):
 os.makedirs(output_path)
cmd = [metypeset_path , file_type +' '+file_path+' '+output_path]

try:
#os.setuid(1000)
#os.setgid(1000)
retcode =  subprocess.call(cmd)
except OSError as e:
retcode = [cmd, e]
return dict(retcode=retcode)

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


[web2py] sqlfrom grid results none

2014-10-14 Thread max

i see everywhere, there is none returned in the ,   SQLFORM.grid when there 
is no value in the table. is there a way to globally disable this. i can 
 do a dom manipulation using a jquery function, which is not very clean. 
has somebody any idea.
thanks for any advice.
dulip

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


[web2py] Re: update database row without changing contents

2013-11-20 Thread max
thanks a lot

On Tuesday, November 19, 2013 10:42:52 PM UTC+1, Niphlod wrote:
>
> use callbacks: they'll make your life easier
>
>
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks
>
> On Tuesday, November 19, 2013 9:54:00 PM UTC+1, max wrote:
>>
>> I have two seperate tables, which are updated using web2py forms.
>> first table has fields using calculate attbitute of the values from 
>> second table.
>> I want to update the first table, when i change something something in 
>> the second table.
>> is that possible?
>>
>>
>>
>>

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


[web2py] update database row without changing contents

2013-11-19 Thread max
I have two seperate tables, which are updated using web2py forms.
first table has fields using calculate attbitute of the values from second 
table.
I want to update the first table, when i change something something in the 
second table.
is that possible?



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


[web2py] drop down list as auto-complete

2012-12-29 Thread max
In my dependancy tables I have thousands of entries.
e.g.

frg.define_table('group',
   Field('name','string'),
)
 
frg.define_table('kundenstamm',
Field('a20',frg.group),
)

frg.kundenstamm.a20.requires = IS_IN_DB(frg, frg.group.id, '%(id)s , 
%(name)s',zero=T('Choose'))


I  have thousands of values in group.
So in my SQLFORM in kundenstamm , I need a auto-complete instead of a drop 
down.
is it possible?



-- 





[web2py] Re: default tab key behavior change in fields

2012-08-21 Thread max
All the other small problems other than general integration solved.

There i need some help.



 http://code.jquery.com/jquery-latest.js"</a>;>


$(document).ready(function(){

//textboxes = $("input.double");
//textboxes = $(":input:not(:submit)");
textboxes = $(":input:not(:hidden)");

$(textboxes).click(function(){
if ($.browser.mozilla) {
  $(textboxes).keypress (checkForEnter);
}
else {
  $(textboxes).keydown (checkForEnter);
}
  });
  
});

function checkForEnter (event) {
  if (event.keyCode == 13) {
currentBoxNumber = textboxes.index(this);
if (textboxes[currentBoxNumber + 1] != null) {
  nextBox = textboxes[currentBoxNumber + 1]
  nextBox.focus();
  nextBox.select();
  if (currentBoxNumber <textboxes.length-2){
event.preventDefault();
  }
}
else{
  return false;
  //event.preventDefault();
}

  }
}



Am Dienstag, 21. August 2012 15:13:21 UTC+2 schrieb max:
>
> Hi,
> This is the script, i have generated but anyhow, it jumps to next key and 
> tries to validate and the  it looses focus.
> Another problem is,  my script only work for a certain kind of  input 
> fields. is there a way to get all the input fields when i add it into 
> web2py_ajax.html
>
>
> 
> $(document).ready(function(){
>
> textboxes = $("input.double");
>
> $(".double").click(function(){
> if ($.browser.mozilla) {
>   $(textboxes).keypress (checkForEnter);
> }
> else {
>   $(textboxes).keydown (checkForEnter);
> }
>   });
> });
>
> function checkForEnter (event) {
>   if (event.keyCode == 13) {
> currentBoxNumber = textboxes.index(this);
> if (textboxes[currentBoxNumber + 1] != null) {
>   nextBox = textboxes[currentBoxNumber + 1]
>   nextBox.focus();
>   nextBox.select();
>
> }
> else{
>   event.preventDefault();
>   return false;
>   }
> 
>   }
> }
> 
>
> Am Montag, 20. August 2012 21:51:10 UTC+2 schrieb Anthony:
>>
>> Either directly in layout.html or in a JS file loaded into every page, 
>> include the code that checks for enter key presses in input fields (use the 
>> $('input') jQuery selector to find all input fields on the page).
>>
>> Anthony
>>
>> On Monday, August 20, 2012 8:56:18 AM UTC-4, max wrote:
>>>
>>> hi anthony, i can include the change in the views/xyz.html , but how 
>>> cupld i set it globally  for all the forms?
>>>
>>>
>>> Am Montag, 13. August 2012 15:50:25 UTC+2 schrieb max:
>>>>
>>>> thank anthony.
>>>>
>>>> Am Montag, 13. August 2012 15:30:24 UTC+2 schrieb Anthony:
>>>>>
>>>>> On Monday, August 13, 2012 9:24:13 AM UTC-4, max wrote:
>>>>>>
>>>>>> I want to add the enter key instead of tab keys to the forms.
>>>>>> is it possible to intergrate into web2py.
>>>>>>
>>>>>
>>>>> Sure, but this has to be handled on the client side via Javascript. 
>>>>> Here's one solution: http://thinksimply.com/blog/jquery-enter-tab.
>>>>>
>>>>> Anthony 
>>>>>
>>>>

-- 





[web2py] Re: default tab key behavior change in fields

2012-08-21 Thread max
Hi,
This is the script, i have generated but anyhow, it jumps to next key and 
tries to validate and the  it looses focus.
Another problem is,  my script only work for a certain kind of  input 
fields. is there a way to get all the input fields when i add it into 
web2py_ajax.html



$(document).ready(function(){

textboxes = $("input.double");

$(".double").click(function(){
if ($.browser.mozilla) {
  $(textboxes).keypress (checkForEnter);
}
else {
  $(textboxes).keydown (checkForEnter);
}
  });
});

function checkForEnter (event) {
  if (event.keyCode == 13) {
currentBoxNumber = textboxes.index(this);
if (textboxes[currentBoxNumber + 1] != null) {
  nextBox = textboxes[currentBoxNumber + 1]
  nextBox.focus();
  nextBox.select();

}
else{
  event.preventDefault();
  return false;
  }

  }
}


Am Montag, 20. August 2012 21:51:10 UTC+2 schrieb Anthony:
>
> Either directly in layout.html or in a JS file loaded into every page, 
> include the code that checks for enter key presses in input fields (use the 
> $('input') jQuery selector to find all input fields on the page).
>
> Anthony
>
> On Monday, August 20, 2012 8:56:18 AM UTC-4, max wrote:
>>
>> hi anthony, i can include the change in the views/xyz.html , but how 
>> cupld i set it globally  for all the forms?
>>
>>
>> Am Montag, 13. August 2012 15:50:25 UTC+2 schrieb max:
>>>
>>> thank anthony.
>>>
>>> Am Montag, 13. August 2012 15:30:24 UTC+2 schrieb Anthony:
>>>>
>>>> On Monday, August 13, 2012 9:24:13 AM UTC-4, max wrote:
>>>>>
>>>>> I want to add the enter key instead of tab keys to the forms.
>>>>> is it possible to intergrate into web2py.
>>>>>
>>>>
>>>> Sure, but this has to be handled on the client side via Javascript. 
>>>> Here's one solution: http://thinksimply.com/blog/jquery-enter-tab.
>>>>
>>>> Anthony 
>>>>
>>>

-- 





[web2py] Re: default tab key behavior change in fields

2012-08-20 Thread max
hi anthony, i can include the change in the views/xyz.html , but how cupld 
i set it globally  for all the forms?


Am Montag, 13. August 2012 15:50:25 UTC+2 schrieb max:
>
> thank anthony.
>
> Am Montag, 13. August 2012 15:30:24 UTC+2 schrieb Anthony:
>>
>> On Monday, August 13, 2012 9:24:13 AM UTC-4, max wrote:
>>>
>>> I want to add the enter key instead of tab keys to the forms.
>>> is it possible to intergrate into web2py.
>>>
>>
>> Sure, but this has to be handled on the client side via Javascript. 
>> Here's one solution: http://thinksimply.com/blog/jquery-enter-tab.
>>
>> Anthony 
>>
>

-- 





Re: [web2py] enter a 'comma' instead of dot for floating point numbers.

2012-08-13 Thread max
thank a lot. helps me to do what i want.

Am Montag, 13. August 2012 16:00:17 UTC+2 schrieb rochacbruno:
>
> take a look on custom validators 
> http://rochacbruno.com.br/custom-validator-for-web2py-forms/ 
>  Em 13/08/2012 10:54, "max" > escreveu:
>
>> One of my users use german keyboard. is there any possibility for the dot 
>> in a floating point number identified as comma.
>> for me  global replacing is also o.k.
>>
>> Example:
>> 1223.12 as 122,23 for all the values in forms.
>>
>>
>>
>>
>>  -- 
>>  
>>  
>>  
>>
>

-- 





[web2py] enter a 'comma' instead of dot for floating point numbers.

2012-08-13 Thread max
One of my users use german keyboard. is there any possibility for the dot 
in a floating point number identified as comma.
for me  global replacing is also o.k.

Example:
1223.12 as 122,23 for all the values in forms.




-- 





[web2py] Re: default tab key behavior change in fields

2012-08-13 Thread max
thank anthony.

Am Montag, 13. August 2012 15:30:24 UTC+2 schrieb Anthony:
>
> On Monday, August 13, 2012 9:24:13 AM UTC-4, max wrote:
>>
>> I want to add the enter key instead of tab keys to the forms.
>> is it possible to intergrate into web2py.
>>
>
> Sure, but this has to be handled on the client side via Javascript. Here's 
> one solution: http://thinksimply.com/blog/jquery-enter-tab.
>
> Anthony 
>

-- 





[web2py] default tab key behavior change in fields

2012-08-13 Thread max
I want to add the enter key instead of tab keys to the forms.
is it possible to intergrate into web2py.

-- 





[web2py] Change action of the submit button

2012-07-28 Thread max
I have a  requirement , that when I post values of a crud form, that  
values of some fields copied to another table.

How can I add this action to the submit button or inside the procedure?


-- 





[web2py] Form field deactivate

2012-05-22 Thread max
I have a table with  two fields.
EN  | SP
Hello | Hola
I | Yo

Both the fields A and B represent the same vale in  two languages.
I want in a drop-down field  , the  Spanish  value automatically selected, 
when english value is set to a specific word.
It  should also work , if I set the spanish word.

Thankful for any ideas!









[web2py] Re: postgres "there is already a transaction in progress"

2012-01-04 Thread max
Hello Massimo,

i do have the same problem, postgres server error log:
Jan  4 23:39:01 server postgres[5285]: [3-1] 2012-01-04 23:39:01 CET dbname 
dbuser WARNING:  there is already a transaction in progress
Jan  4 23:39:01 server postgres[5286]: [3-1] 2012-01-04 23:39:01 CET dbname 
dbuser WARNING:  there is already a transaction in progress

I have tried the -N option you suggested, but it the warnings appear with 
no difference!

*System details:*
postgres version: psql (PostgreSQL) 8.3.12
web2py version: 1.99.2 (up to date)

The way James suggested ist not acceptable for me... ^^ It makes me very 
nervous if hundred of warnings appear every day ;)
But maybe the web2py-"problem" of transaction handling James suggested is 
 the reason, but i don't have enough detail knowledge of the DAL.

Does anybody have the same problem or recently solved it? Any suggestions?

Max

Ps.: Thanks Massimo for such a piece of great work. I am german student and 
learned programming over the past study-year with your framework!
Thank you! It is a great experience and makes a lot of fun.


[web2py] DAL reserved keywords (Inherited method from dictionary)

2011-09-05 Thread max
Hi web2py users,

currently i am working with the newest version of dal with an existing (and 
currently in use by other users) database structure (Postgres), so i can't 
change any field-name or something like that. In this Database is the field 
'values' defined. But if I try to connect via psycopg2 driver und dal.py i 
get an error:

Traceback (most recent call last):
  File "test.py", line 87, in 
db = DB('bi_2302').get_db()
  File "test.py", line 59, in get_db
converted.append(Field(str(field)))
  File "/home/mao/dal.py", line 5307, in __init__
raise SyntaxError, 'Field: invalid field name: %s' % fieldname
SyntaxError: Field: invalid field name: values

 The simple reason (it took me a long time thinking about that) is that the 
DAL class has an Inherited method from dict called values. So i cant call 
the field:

db = DAL('postgres://testuser:testpassword@testhost/testdb')
db.define_table('testtab', Field('test'), Field('values'))
db(db.testtab.values).select()

Do you have any ideas for a workaround or is there a possibility avoid this 
problem.

Greets Max


[web2py] Re: FORM Field change keyboary reaction type

2011-06-20 Thread max
thanks  a lot for the advice.

On Jun 19, 6:58 pm, pbreit  wrote:
> Any behaviors you see are provided by the browser. What you are seeing on a
> multi-down is that some browsers let you press enter to select the current
> entry and move to the next field. To do what you want, you'd need to trap
> keyboard entry using JavaScript, perhaps with onkeydown/onkeypress/onkeyup
> and event.keycode('13')
>
> Here's a short discussion that might 
> help:http://forums.devx.com/showthread.php?t=6688
>
> But I would strongly recommend against changing this since most users expect
> enter to submit the form.


[web2py] FORM Field change keyboary reaction type

2011-06-19 Thread max
Is there any way to change the behaviour of the field in web2py.
I want to use the ente rkey in the   number side of the keyboard for
jumping into the next field.
looks like there is something similar in the  multiple value columns.



[web2py] Re: entry level permissions

2011-06-17 Thread max
thanks
On Jun 17, 8:17 pm, Anthony  wrote:
> On Friday, June 17, 2011 2:08:45 PM UTC-4, max wrote:
>
> > i want to give for ceratin records of a table different user
> > permissions.
> > can the authentication of web2py used for this?
>
> Look at add_permission and has_permission 
> here:http://web2py.com/book/default/chapter/08#Authorization. You can specify
> permissions for tables and record ID's.
>
> Or, if you're using CRUD, you can link auth with 
> CRUD:http://web2py.com/book/default/chapter/08#Authorization-and-CRUD.
>
> Anthony


[web2py] entry level permissions

2011-06-17 Thread max
i want to give for ceratin records of a table different user
permissions.
can the authentication of web2py used for this?


[web2py] genrate daily value form for a month

2011-06-11 Thread max
I am trying to generate a custom form depending on he month for user
to add values to each day key
is there any idea how to do it dynamically?


[web2py] splitting the field values of a list:string field

2011-06-03 Thread max
I have the following use case.
--
User has to input a  unknown number of strings in a pref-defined
format.
eg.  a#b#c , a1#b1#c1, a2#b1#c2

Currently i am using the list:string  and allow the user to directly
add the string with a hash sign.

But I would prefer to format the input like this,

myfield:   name [a1]  name2 [b1] name3 [c1]  where the [] are input
fields of a form horizontally. and the + sign of the web2py list adds
more from the same format.

For me it is ok. that everything in the myfield is saved in the |a|b|
c| format.

thanks for any ideas.




[web2py] Re: Size of the list:string input box

2011-06-03 Thread max
thanks.

On May 21, 5:14 pm, Anthony  wrote:
> On Saturday, May 21, 2011 3:56:13 AM UTC-4, max wrote:
>
> > I am using the   list string to enter data where the number of input
> > texts.
> > Can I customize the size of the input boxes  in one form because i am
> > inserting large texts?
> > Can't use the type 'text' because the number of entries is not
> > previuosly known.
>
> You should be able to handle that with CSS -- 
> seehttp://web2py.com/book/default/chapter/07#CSS-Conventions.
>
> Anthony


[web2py] Re: template in crud

2011-06-03 Thread max
i will go for the controller version. thanks a lot.


On Jun 2, 3:14 am, Richard Vézina  wrote:
> You have typo.. (see quote in red)
>
> Why do you want to do that like this?
>
> In controller you could go like this :
>
> db.tablename.fieldname.readable = True or False
>
> If you need to hide field base on user group membership you will have to
> define the readable/writable field for each group in your function... You
> could also use function decorators and CRUD...
>
> Richard
>
> On Mon, May 30, 2011 at 10:16 AM, max  wrote:
> > Hi all,
> > I have been searching for a customizable way to select and deselect
> > fields.
> > i have found this way
>
> > tempate_01 = {'myfiled':False, 'myscofield':True}
> > read this values in the db defitionion.
> >   Field('myfield', type='text',readable=template_01['myfiled']),
>
> > is this a good way to do this?
> > Because i generally don't like writing lots of global variables,
> > thanks
>
>


[web2py] template in crud

2011-05-30 Thread max
Hi all,
I have been searching for a customizable way to select and deselect
fields.
i have found this way

tempate_01 = {'myfiled':False, 'myscofield':True}
read this values in the db defitionion.
   Field('myfield', type='text',readable=template_01'myfiled']),

is this a good way to do this?
Because i generally don't like writing lots of global variables,
thanks


[web2py] making table data avaialable to a javascript application

2011-05-26 Thread max
Hi,
I am  trying to integrate my database data into a  ajax application as
follows
http://dev.sencha.com/deploy/ext-4.0.1/examples/view/animated-dataview.html

How would I open/interface my table data to the java script
application?

Thanks


[web2py] Size of the list:string input box

2011-05-21 Thread max
I am using the   list string to enter data where the number of input
texts.
Can I customize the size of the input boxes  in one form because i am
inserting large texts?
Can't use the type 'text' because the number of entries is not
previuosly known.




[web2py] Cant logout

2011-01-31 Thread Max Slimmer
I have a case were I catch a js event and need to logout. So I tried
to send a request via AJAX to .../index/logout  the request gets there
and but it isn't reseting auth here is my logout function
def logout():
session.authorized = None
session.auth = None
session.forget()
redirect(URL(r=request, f='index'))

this returns the login page to ajax request and I get the loging page
in the request text. I couldn't figure out how to get this back to the
browser so tried location.href = ' url to index'

This in turn takes me to the index method in the controller, however
the @auth.requires_login() doesnt think that auth is None and in fact
it isn't.
I found that if I add session.clear() to the logout function all works
OK. Is there an explanation for this. If nothing else, maybe the
session.clear() should be included in distro.

thanks,

max


[web2py] Re: default values in options widget

2010-12-21 Thread max
ok actually I thought I have sovled my problem with writing None values to 
the database with this:

>>> IS_IN_SET({None :'unknown', 'option_1:'Option 1'}, zero = None)

in stead of:

>>> IS_IN_SET(['unknown', 'option_1'], zero = None)

but you are right, this only works when I use curd.create the first time. If 
I try to edit my record with crud.update later, the mapping does not work 
and the options widget selects a arbitrary value from the dictionary (in 
case of crud.create, too). But I'd like to have the 'unknown' label in case 
of None value in database. You think setting the default value to the field?

db.mytable.myfield.default = defaultvalue
does actually only work with string widget, options widget shows no 
response.

thanks so far


[web2py] Re: default values in options widget

2010-12-21 Thread max
Hi,

sorry i was to hasty posting my problem. The easiest way to solve this 
problem is to change:
db.mytable.options_1.requires = [IS_IN_SET(['option_1', 'option_2', 
'option_3', 'option_4', 'unknown'], zero = None)] 
into:
db.mytable.options_1.requires = [IS_IN_SET({'option_1' : 'Option 1', 
'option_2' : 'Option 2', 'option_3 : 'Option 3'', 'option_4' : 'Option 4', 
None: 'unknown'}, zero = None)]

documentation:
IS_IN_SET({'id1':'first label', 'id2':'second label'})('id1')
http://web2py.com/examples/static/epydoc/web2py.gluon.validators.IS_IN_SET-class.html

thanks
max


[web2py] default values in options widget

2010-12-21 Thread max
Hi,
is it possible to set a default value to a widgets.options.widget?

model:
db = DAL('sqlite://storage.sqlite')
db.define_table('mytable',
Field('options_1', 'text', widget =
SQLFORM.widgets.options.widget ),
Field('options_2', 'text', widget =
SQLFORM.widgets.options.widget ))

db.mytable.options_1.requires = [IS_IN_SET(['option_1', 'option_2',
'option_3', 'option_4', 'unknown'], zero = None)]
db.mytable.options_2.requires = [IS_IN_SET(['option_1', 'option_2',
'option_3', 'option_4', 'unknown'], zero = None)]

controller:
from gluon.tools import Crud

def index():
crud = Crud(globals(), db)
if request.args(0):
values = db(db.mytable.id ==
request.args(0)).select(db.mytable.ALL)[0]
form = crud.update(db.mytable, request.args(0), onvalidation =
validate_values)
#
# How to set the default value (unknown)
# mean stuff like
# if values.option_1 == None:
# db.mytable.option_1 = 'unknown'
# or
#
# if values.option_2 == None:
# form.custom.dspval.option_2 = 'unknown'
#
# This does not work properly! Any suggestions?
# Is it posible to create an optionswidget, which must not be
selected and can be empty?
#
else:
values = None
form = crud.create(db.mytable)
return dict(form = form, values = values)

def validate_values(form):
for value in form.vars:
if form.vars[value] == 'unknown':
form.vars[value] = None

In this special case the user have to select 'unknown' if he didn't
know the value during record creation, but later (during update), the
user must not select a value, None values are automatically set to
unknown.

thanks
max


[web2py] Re: uft 8

2010-08-03 Thread max
yes. it shows incorrectly in the browser.

On Aug 2, 7:13 pm, Jason Brower  wrote:
> by false do you mean incorrectly in the webbrowser?
> The area that is printing this is python not the html though you should
> have it there. :)
> I am not sure where it is set python side, but I do know my finnish
> äÄöÖåÅ all work for me.
> Best Regards,
> Jason
>
> On Mon, 2010-08-02 at 02:09 -0700, max wrote:
> > dera develpoers,
>
> > i am adding  just a german ä in the menu list. like this.
> > T('täter') for translation
> > and the web2py shows it false in the browser, althoguth i have setup
> > utf-8.
>
> >     > > in layout.html
>
> > does anybody have similar experiences?


[web2py] Re: uft 8

2010-08-03 Thread max
yes. it shows incorrectly in the browser.

On Aug 2, 7:13 pm, Jason Brower  wrote:
> by false do you mean incorrectly in the webbrowser?
> The area that is printing this is python not the html though you should
> have it there. :)
> I am not sure where it is set python side, but I do know my finnish
> äÄöÖåÅ all work for me.
> Best Regards,
> Jason
>
> On Mon, 2010-08-02 at 02:09 -0700, max wrote:
> > dera develpoers,
>
> > i am adding  just a german ä in the menu list. like this.
> > T('täter') for translation
> > and the web2py shows it false in the browser, althoguth i have setup
> > utf-8.
>
> >     > > in layout.html
>
> > does anybody have similar experiences?


[web2py] Re: uft 8

2010-08-03 Thread max
yes. it shows incorrectly in the browser.

On Aug 2, 7:13 pm, Jason Brower  wrote:
> by false do you mean incorrectly in the webbrowser?
> The area that is printing this is python not the html though you should
> have it there. :)
> I am not sure where it is set python side, but I do know my finnish
> äÄöÖåÅ all work for me.
> Best Regards,
> Jason
>
> On Mon, 2010-08-02 at 02:09 -0700, max wrote:
> > dera develpoers,
>
> > i am adding  just a german ä in the menu list. like this.
> > T('täter') for translation
> > and the web2py shows it false in the browser, althoguth i have setup
> > utf-8.
>
> >     > > in layout.html
>
> > does anybody have similar experiences?


[web2py] uft 8

2010-08-02 Thread max
dera develpoers,

i am adding  just a german ä in the menu list. like this.
T('täter') for translation
and the web2py shows it false in the browser, althoguth i have setup
utf-8.

in layout.html

does anybody have similar experiences?


[web2py] Re: translation data in a database

2010-07-13 Thread max
thanks  a lot.

On 12 Jul., 00:22, mdipierro  wrote:
> My advice it keep using the web2py translation but create a database
> copy and work on it.
> This may be useful
> web2py/scripts/sync_languages.py
>
> On 11 Lug, 17:16, max  wrote:
>
> > thanks for the reply.
> > I have lots of small data tables, where i  have the translations. They
> > are really a lot and I handle 5 langauges simmultaneously.
> > I have to add new words  often and in the database i can add them once
> > and then it is ok.
> > but in the texts i have to write them manually and it is harder to
> > organize them.
> > max
>
> > On 11 Jul., 14:10, Kenneth  wrote:
>
> > > The reason for not using a database is speed, I think. It is much
> > > faster to read a text file than read the texts from a database.
>
> > > What kind of a problem do you have with the text files?
>
> > > Kenneth
>
> > > On Jul 11, 9:59 am, max  wrote:
>
> > > > I am  writing a enterprise multi-linugual web application  using
> > > > web2py.
> > > > I am having a hard time converting the csv files, language files in
> > > > the text format.
> > > > Is there any way that I can save the translation data in a database.
> > > > thanks a lot.


[web2py] Re: translation data in a database

2010-07-11 Thread max
thanks for the reply.
I have lots of small data tables, where i  have the translations. They
are really a lot and I handle 5 langauges simmultaneously.
I have to add new words  often and in the database i can add them once
and then it is ok.
but in the texts i have to write them manually and it is harder to
organize them.
max

On 11 Jul., 14:10, Kenneth  wrote:
> The reason for not using a database is speed, I think. It is much
> faster to read a text file than read the texts from a database.
>
> What kind of a problem do you have with the text files?
>
> Kenneth
>
> On Jul 11, 9:59 am, max  wrote:
>
> > I am  writing a enterprise multi-linugual web application  using
> > web2py.
> > I am having a hard time converting the csv files, language files in
> > the text format.
> > Is there any way that I can save the translation data in a database.
> > thanks a lot.


[web2py] translation data in a database

2010-07-11 Thread max
I am  writing a enterprise multi-linugual web application  using
web2py.
I am having a hard time converting the csv files, language files in
the text format.
Is there any way that I can save the translation data in a database.
thanks a lot.


[web2py] Customize SQLForm with autocomplete widget

2010-03-05 Thread max
I have a SQLForm with a widget , but i want to output it in a
customized way.
I tried the following example in book page 211.
{{extend 'layout.html'}}
 
  Your name is 
  
 

But  then the autocmplete widget doesn't work.

My requirement is that I display the fields horizontally.

can somebody give me a tip?

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



[web2py] auto complete for more than one field.

2010-03-02 Thread max
I  tried the  following example in the book for auto complete, but it
didn't work,
def month_input():
can't understandy why, there is no ouput for the simple example.

then i tried the following example, clienttools / autosuggest, which
worked for me.

but now i have the problem of having more than one autocomplete fields
in one form.
how can i do it?

any idea is appreciated.

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



[web2py] soaplib

2010-02-09 Thread max
I am trying to generate a soap web client for a wsdl service.
With java, i can generate all the soap operations from the swdl file.
Is there any way, I could do it in python?
the zs1-2 library  seems to be depreciated for python2.6
In web discussions, I see python soap libraries are always
problemfil .is it ture?
I searched soappy and etc. and they are pretty old.


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



[web2py:33192] Customize user login

2009-10-20 Thread max

As per  Book (page 241  version 2) I have defined my own table for the
authentification in the db.py
In the database i see my new fields.
auth=Auth(globals(),db)  # authentication/
authorization

auth_table = db.define_table(
auth.settings.table_user_name,
 Field('cluster_user_name', length=128, default=''),
 Field('first_name', length=128, default=''),
 Field('last_name', length=128, default=''),
 Field('email', length=128, default='', unique=True),
 Field('password', 'password', length=256,
 readable=False, label='Password'),
 Field('registration_key', length=128, default= '',
 writable=False, readable=False))

auth_table.first_name.requires = \
 IS_NOT_EMPTY(error_message=auth.messages.is_empty)
auth_table.last_name.requires = \
 IS_NOT_EMPTY(error_message=auth.messages.is_empty)
#auth_table.password.requires = [IS_STRONG(), CRYPT()]
auth_table.email.requires = [
 IS_EMAIL(error_message=auth.messages.invalid_email),
 IS_NOT_IN_DB(db, auth_table.email)]
auth.settings.table_user = auth_table
auth.settings.login_methods.append(ldap_auth(bind_dn='HRA
dadasa',bind_pw='asdasd',server='ad.con.de',base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=uni-
heidelberg,dc=de',mode='ad',secure=True))
auth.define_tables()
But now i want to customize the login form for the user.
How can I do it in web2py?



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



[web2py:32407] RESTful Web Services

2009-10-07 Thread max

Dear developers.

My web2py search engine needs get content from a REST API from a Java
application server.
How would I do it best with Web2py?

Has somebody any experience with web2py or python rest clietns.

I also need to implement REST Services through Web2py  ? Is there any
example application, which I refer to.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31596] Re: full text index for postgres

2009-09-24 Thread max

Thanks massimo, worked for me.


On 22 Sep., 15:28, mdipierro  wrote:
> No but assuming you have done this:
>
> 1. ALTER TABLE blog_entry ADD COLUMN body_tsv tsvector;
> 2. CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE ON
> blog_entry
> FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger(body_tsv,
> 'pg_catalog.english', body);
> 3.CREATE INDEX blog_entry_tsv ON blog_entry USING gin(body_tsv);
>
> You can write this:
>
> 4. SELECT title FROM blog_entry WHERE body_tsv @@ plainto_tsquery
> ('hello world');
>
> as
>
> db("body_tsv @@ plainto_tsquery('hello world')").select
> (db.blog_entry.title)
>
> I have not tried it but it should work.
>
> Massimo
>
> On Sep 22, 4:34 am, max  wrote:
>
> > I have created a  full text index on a postgres database.
> > Is there any web2py type search syntax for tsvector search without
> > using the sql syntax?
>
> > This is a example way how i create  the fulltext index.
>
> > 1. ALTER TABLE blog_entry ADD COLUMN body_tsv tsvector;
> > 2. CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE ON
> > blog_entry
> > FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger(body_tsv,
> > 'pg_catalog.english', body);
> > 3.CREATE INDEX blog_entry_tsv ON blog_entry USING gin(body_tsv);
> > 4. SELECT title FROM blog_entry WHERE body_tsv @@ plainto_tsquery
> > ('hello world');
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:31455] full text index for postgres

2009-09-22 Thread max

I have created a  full text index on a postgres database.
Is there any web2py type search syntax for tsvector search without
using the sql syntax?

This is a example way how i create  the fulltext index.

1. ALTER TABLE blog_entry ADD COLUMN body_tsv tsvector;
2. CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE ON
blog_entry
FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger(body_tsv,
'pg_catalog.english', body);
3.CREATE INDEX blog_entry_tsv ON blog_entry USING gin(body_tsv);
4. SELECT title FROM blog_entry WHERE body_tsv @@ plainto_tsquery
('hello world');






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



[web2py:30297] Re: Is auth comptible with MS active directory?

2009-09-07 Thread max

Hi Massimo,

The script is an example for our AD and it works for me to get all the
data except the password hash.

I wanted to test if i am making mistakes  when connecting to the
server.

But I had to give an adminstrator account and a password to do the
search. Otherwise Ad doesn't allow the search.
But in my ldap_auth.py,  I couldn't  succeed configuring it.
1. First problem was how do i give the admin user and password. (it is
ok for me to have it hard coded in the dap_auth.py)
2. How can the web2py get authentication for a non-admin user ? (I
actually don't need to have  the hash in the local auth database
table.)

Thank youvery much!



On 7 Sep., 17:04, mdipierro  wrote:
> It is not clear from your message if this script works and you provide
> it as an example or if not.
>
> Massimo
>
> On Sep 7, 9:26 am, max  wrote:
>
> > Hi Everybody,
> > I wrote another script to access our ms active directory,
> > If someone have idea t osolve the long overdue problem would be
> > thankful.
>
> > import ldap
>
> > def main():
> >   server = "ad.mydmoan.com"
> >   who = "user"
> >   cred = "password"
> >   keyword = "d...@mydomain.com"
> >   base_dn = "ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com"
> >   mode='ad'
> >   secure='secure'
> >   try:
> > l = ldap.open(server)
> > l.simple_bind_s(who, cred)
> > l.protocol_version = 3
> > l.set_option(ldap.OPT_REFERRALS, 0)
> > print "Successfully bound to server.\n"
> > print "Searching..\n"
> > my_search(l, keyword)
> > #ldap_auth_aux
> > (who,cred,ldap_server=server,ldap_mode=mode,ldap_port=636,ldap_basedn=base_dn)
> >   except ldap.LDAPError, error_message:
> > print "Couldn't Connect. %s " % error_message
>
> > def my_search(l, keyword):
> >   base_dn = "ou=users,ou=kjc,ou=institute,dc=ad,dc=domain,dc=com"
> >   scope = ldap.SCOPE_SUBTREE
> >   filter = "(&(objectClass=user)(mail="+ keyword+"))"
> >   retrieve_attributes = None
> >   count = 0
> >   result_set = []
> >   result_data=[]
> >   timeout = 0
> >   try:
> > result_id = l.search(base, scope, filter, retrieve_attributes)
> > while 1:
> >   result_type, result_data = l.result(result_id, timeout)
> >   if (result_data == []):
> > break
> >   else:
> > if result_type == ldap.RES_SEARCH_ENTRY:
> >   result_set.append(result_data)
> >   if len(result_set) == 0:
> > print "No Results."
> > return
> >   #print result_set
> >   for i in range(len(result_set)):
> > #print i
> > for entry in result_set[i]:
> > try:
> > #print  entry
> > print entry[1]['mail'][0]
> > #print entry[1]['unicodePwd'][0]
> > print entry[1]['sAMAccountName'][0]
> > #print entry[1]['memberOf']
> > #print entry[1]['proxyAddresses'][0]
> > print entry[1]['uidNumber'][0]
>
> > count = count + 1
> > except:
> > pass
> >   except ldap.LDAPError, error_message:
> > print error_message
>
> > if __name__=='__main__':
> >  main()
>
> > On 5 Sep., 16:36, max  wrote:
>
> > > After lots of tests and research of ldap_auth , I have some questions
>
> > > 1. Does the mode="ad"  identify the Active directory in ldap_ath_aux?
> > > 2. In my active directory server to  use "search_ext_s" i need a
> > > administrator account,
> > >  What i think is general to all ad servers.
> > > How can i define it in ldap_auth_aux
> > > 3. And in a search result element i don't get the hash_value for the
> > > password after successful bind .
> > > Then the question is how web2py auth can authenticate when it doesn't
> > > get the password from the ad?
>
> > > thanks for any idea!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:30288] Re: Is auth comptible with MS active directory?

2009-09-07 Thread max

Hi Everybody,
I wrote another script to access our ms active directory,
If someone have idea t osolve the long overdue problem would be
thankful.

import ldap

def main():
  server = "ad.mydmoan.com"
  who = "user"
  cred = "password"
  keyword = "d...@mydomain.com"
  base_dn = "ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com"
  mode='ad'
  secure='secure'
  try:
l = ldap.open(server)
l.simple_bind_s(who, cred)
l.protocol_version = 3
l.set_option(ldap.OPT_REFERRALS, 0)
print "Successfully bound to server.\n"
print "Searching..\n"
my_search(l, keyword)
#ldap_auth_aux
(who,cred,ldap_server=server,ldap_mode=mode,ldap_port=636,ldap_basedn=base_dn)
  except ldap.LDAPError, error_message:
print "Couldn't Connect. %s " % error_message

def my_search(l, keyword):
  base_dn = "ou=users,ou=kjc,ou=institute,dc=ad,dc=domain,dc=com"
  scope = ldap.SCOPE_SUBTREE
  filter = "(&(objectClass=user)(mail="+ keyword+"))"
  retrieve_attributes = None
  count = 0
  result_set = []
  result_data=[]
  timeout = 0
  try:
result_id = l.search(base, scope, filter, retrieve_attributes)
while 1:
  result_type, result_data = l.result(result_id, timeout)
  if (result_data == []):
break
  else:
if result_type == ldap.RES_SEARCH_ENTRY:
  result_set.append(result_data)
  if len(result_set) == 0:
print "No Results."
return
  #print result_set
  for i in range(len(result_set)):
#print i
for entry in result_set[i]:
try:
#print  entry
print entry[1]['mail'][0]
#print entry[1]['unicodePwd'][0]
print entry[1]['sAMAccountName'][0]
#print entry[1]['memberOf']
#print entry[1]['proxyAddresses'][0]
print entry[1]['uidNumber'][0]


count = count + 1
except:
pass
  except ldap.LDAPError, error_message:
print error_message



if __name__=='__main__':
 main()


On 5 Sep., 16:36, max  wrote:
> After lots of tests and research of ldap_auth , I have some questions
>
> 1. Does the mode="ad"  identify the Active directory in ldap_ath_aux?
> 2. In my active directory server to  use "search_ext_s" i need a
> administrator account,
>  What i think is general to all ad servers.
> How can i define it in ldap_auth_aux
> 3. And in a search result element i don't get the hash_value for the
> password after successful bind .
> Then the question is how web2py auth can authenticate when it doesn't
> get the password from the ad?
>
> thanks for any idea!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:30124] Is auth comptible with MS active directory?

2009-09-05 Thread max

After lots of tests and research of ldap_auth , I have some questions

1. Does the mode="ad"  identify the Active directory in ldap_ath_aux?
2. In my active directory server to  use "search_ext_s" i need a
administrator account,
 What i think is general to all ad servers.
How can i define it in ldap_auth_aux
3. And in a search result element i don't get the hash_value for the
password after successful bind .
Then the question is how web2py auth can authenticate when it doesn't
get the password from the ad?

thanks for any idea!

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



[web2py:29969] Book2 and LDAP auth

2009-09-03 Thread max

Now I bought   the second version of the book to read more about the
ldap authentication.
I did the following and i can't understand why it doesn't work.
Here is my controller in the order

from gluon.tools import *
auth=Auth(globals(),db)  # authentication/
authorization
auth.settings.hmac_key='5dfd1d8c4-6ebf-4ecd-98cf-abc1e34273dc'
auth.define_tables() # creates all needed
tables
crud=Crud(globals(),db)  # for CRUD helpers using
auth
service=Service(globals())

from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods.append(ldap_auth
(mode='ad',server='ad.domain.com',base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=domain,dc=de'))

i can't understand what is wrong there. i just want to use the ldap
authentication and doesn't want local auth tables.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29783] Re: Comma creates an invalid request?

2009-09-01 Thread max

I am interested in knowing  how can i do this for %
routes_in=(('(?P.*?),(?P.*)':'\g?other=\g'),)

What does p ,q and other define in the routes_in file?


On 1 Sep., 03:49, mdipierro  wrote:
> In my mind I think of a URL as a filename,so I think of request.args
> as objects that can be used to build actual filenames. Allowing non [a-
> zA-Z0-9_] characters in args may create potential directory traversal
> attacks when args is used in this way.
>
> On Aug 31,8:33 pm,"mr.freeze"  wrote:
>
> > Why are special characters allowed in request.vars but not
> > request.args by default?
>
> > i.e. why does this 
> > work:http://127.0.0.1:8000/test/appadmin/state?london,_ontario
>
> > But not this?:http://127.0.0.1:8000/test/appadmin/state/london,_ontario
>
> >  Just curious.
>
> > On Aug 31, 7:58 pm, mdipierro  wrote:
>
> > > Yes. in web2py URL are validated and special characters are not
> > > allowed (by default). Spaces are replaced with _.
> > > This can be changed by mappying parts of the URL, like the part after
> > > the comma, into a variable. Example:
>
> > >http://127.0.0.1:8000/a/b/c,d
>
> > > you can create a file routes.py in web2py/ and in it
>
> > > routes_in=(('(?P.*?),(?P.*)':'\g?other=\g'),)
>
> > > then in app a, controller b.py and function c you can access
>
> > > request.vars.other
>
> > > which will contain 'd'.
>
> > > Massimo
>
> > > On Aug 31, 6:38 pm, "mr.freeze"  wrote:
>
> > > > It fails for me when passed as an argument even when it is URL
> > > > encoded:http://127.0.0.1:8000/test/default/index/london%2C_ontario-Invalid
> > > > request.
>
> > > > Passing as a query string works even when not 
> > > > encoded:http://127.0.0.1:8000/test/default/index?city=london,_ontario-Works
> > > > fine.
>
> > > > Massimo, can you confirm that this is the expected behavior?
>
> > > > On Aug 31, 7:56 am, mdipierro  wrote:
>
> > > > > Your url does not pass validation and it is invalid. To allow this you
> > > > > must create a routes_in for fit.
>
> > > > > On Aug 30, 9:20 pm, Derek  wrote:
>
> > > > > > Hi,
>
> > > > > > I'm doing some geocoding. I have a geocoder.py file with an index
> > > > > > function.
>
> > > > > > A url like:
>
> > > > > > /geocoder/index/london
>
> > > > > > uses the value 'london' (stored in request.args[0]) just fine. But 
> > > > > > if
> > > > > > I add acomma, as in:
>
> > > > > > /geocoder/index/london,_ontario
>
> > > > > > I get an "Invalid request" error. It's not even a web2py ticket.
>
> > > > > > Any thoughts?
>
> > > > > > Thanks,
>
> > > > > > Derek
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29699] Re: Comma creates an invalid request?

2009-08-31 Thread max

I have the same problem for other language symbols such as ö ,ä, ß in
German.
What do you mean routes_in for it?

My symbols look like %C3%9F  for ß.




On 31 Aug., 14:56, mdipierro  wrote:
> Your url does not pass validation and it is invalid. To allow this you
> must create a routes_in for fit.
>
> On Aug 30, 9:20 pm, Derek  wrote:
>
> > Hi,
>
> > I'm doing some geocoding. I have a geocoder.py file with an index
> > function.
>
> > A url like:
>
> > /geocoder/index/london
>
> > uses the value 'london' (stored in request.args[0]) just fine. But if
> > I add a comma, as in:
>
> > /geocoder/index/london,_ontario
>
> > I get an "Invalid request" error. It's not even a web2py ticket.
>
> > Any thoughts?
>
> > Thanks,
>
> > Derek
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29682] unicode in request.args

2009-08-31 Thread max

I have a unicode string in my multilinugal search.
When I insert a german alphabet ß. "großbritannien " .

I got this code in th my search.

region_search=gro%C3%9Fbritannien/time_search=1800/page=153/box=20/
I want to pass this word and I get an invalid request in the server.









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



[web2py:29408] Re: ldap authentification AD

2009-08-26 Thread max

Hi Fran,
I also tried this one using another example.

import ldap
l=ldap.initialize('ldap://ad.mydomain.com')
l.simple_bind_s('cn=myuser
ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com','password')

then i get  (97, [])


On 26 Aug., 14:10, max  wrote:
> > Do you have this needed line anywhere?
> > from gluon.contrib.login_methods.ldap_auth import ldap_auth
> Yes.
>
> > Do you have ldap installed in the version of Python that you're
> > running?
> > try:
> > import ldap
>
> i installed python-ldap 2.3.9 and import ldap functions without
> failures.
>
>
>
> > > auth.settings.login_methods=[ldap_auth
> > > (mode='ad',server='ad.mydoman.com',
> > > base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com')]
>
> > What is the login that your users use?
> > usern...@ad.domain.com?
>
> as a windows user we log as  in Domain AD (main domain
> controller)
> emails are  @ad.mydomain.com
>
> > I would expect it to be usern...@domain.com & hence:
> > base_dn='ou=users,ou=kjc,ou=institute,dc=mydomain,dc=com'
>
> i tried it also without dc=ad but doesn't accept my password.
>
> I changed the form just to accept the username instead of email but
> also didn't work.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29406] Re: ldap authentification AD

2009-08-26 Thread max


>
> Do you have this needed line anywhere?
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
Yes.
>
> Do you have ldap installed in the version of Python that you're
> running?
> try:
> import ldap

i installed python-ldap 2.3.9 and import ldap functions without
failures.
>
> > auth.settings.login_methods=[ldap_auth
> > (mode='ad',server='ad.mydoman.com',
> > base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com')]
>
> What is the login that your users use?
> usern...@ad.domain.com?
>

as a windows user we log as  in Domain AD (main domain
controller)
emails are  @ad.mydomain.com


> I would expect it to be usern...@domain.com & hence:
> base_dn='ou=users,ou=kjc,ou=institute,dc=mydomain,dc=com'
>

i tried it also without dc=ad but doesn't accept my password.

I changed the form just to accept the username instead of email but
also didn't work.



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



[web2py:29384] ldap authentification AD

2009-08-26 Thread max

i am having the active active directory authentification problm
althoght i have tried lot of different variation using cas.
I will be happy if some one just show me a simple model/db.py where it
is correctly configured.

i exclude misbaviors from my Active Directory Autentification server
as I get it worked using java and php.

I just changed the cas_user table to do the ad authentification.
This is how my db.py looks like.


auth=Auth(globals(),db)  # authentication/
authorization
auth.settings.login_methods=[ldap_auth
(mode='ad',server='ad.mydoman.com',
base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com')]

auth.settings.table_user =db.define_table("cas_user",
  db.Field("name",length=128,default=""),
  db.Field("email", length=128,default=""),
  db.Field("password",'password',readable=False,
label="Password"),
  db.Field('verification',default=''),
  db.Field('last_attempt_time','integer',default=0),
  db.Field('failed_attempts','integer',default=0))#, readable=False,
default="")

t = auth.settings.table_user
t.name.requires = IS_NOT_EMPTY()
t.email.requires = IS_NOT_EMPTY()
t.password.requires = CRYPT()
t.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db, db.cas_user.email)]
auth.define_tables()

crud=Crud(globals(),db)

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



[web2py:29381] Re: web2py book, 2nd Ed

2009-08-26 Thread max

i am having the paper version of web2py. is there any way that  i can
get the rest pages, till i persuade  my boss to buy me the new online
version.



On 26 Aug., 11:34, mdipierro  wrote:
> The new web2py book is available on lulu.com
>
>  http://www.lulu.com/content/e-book/web2py/4968879
>
> Lots of new stuff with100 more pages (341 pages in total). Covers
> Auth, Crud, Services, interaction with Pyjamas, PyAMF, and better
> deployment recipes.
>
> Same price as before ($12.5) and same ID (which means if you bought
> the old one you should be able to get the new one for free).
>
> I am also looking into posting it on scribd (free viewing but no
> download) and it will be published printed by Wiley soon.
>
> Thanks to all those who collaborated by sending corrections. I hope I
> acknowledged everybody properly in the introduction. If I forgot you
> let me know.
>
> Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29378] Re: compressing the data sent through network

2009-08-26 Thread max

thanks massimo i use Apache+mod_wsgi and i will try it.

On 26 Aug., 11:35, mdipierro  wrote:
> If you use Apache+mod_wsgi, you can configure apache to do it. The
> built-in web server does support compression.
>
> Massimo
>
> On Aug 26, 4:06 am, max  wrote:
>
> > Does anybody have experience in sending compressed data using web2py?
>
> > I am writing a multi-langual, multimedia search engine using web2py
> > and in some of my search results i get thousands of images and it
> > takes longer for them to load althogh the calculation in backend  fast
> > enough ist.
>
> > If somebody has any ideas, i am thankful.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29375] compressing the data sent through network

2009-08-26 Thread max

Does anybody have experience in sending compressed data using web2py?

I am writing a multi-langual, multimedia search engine using web2py
and in some of my search results i get thousands of images and it
takes longer for them to load althogh the calculation in backend  fast
enough ist.

If somebody has any ideas, i am thankful.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29325] ldap authentification AD cas

2009-08-25 Thread max

i installed python-ldap and now i can load it.  Then i tried it with
cas by  changing the cas_auth by editting it like this.
But it still it works only for the local database.
What i need is that  the web2py user (ad user name )identifies against
the active directory  password after first registration (with or
without password).

auth=Auth(globals(),db)  # authentication/
authorization
auth.settings.login_methods=[ldap_auth
(mode='ad',server='ad.mydomain.com',
base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com')]

auth.settings.table_user =db.define_table("cas_user",
  db.Field("name",length=128,default=""),
  db.Field("email", length=128,default=""),
  db.Field("password",'password',readable=False,
label="Password"),
  db.Field('verification',default=''),
  db.Field('last_attempt_time','integer',default=0),
  db.Field('failed_attempts','integer',default=0))#, readable=False,
default="")

t = auth.settings.table_user
t.name.requires = IS_NOT_EMPTY()
t.email.requires = IS_NOT_EMPTY()
t.password.requires = CRYPT()
t.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db, db.cas_user.email)]
auth.define_tables()

crud=Crud(globals(),db)
crud.settings.auth=auth  # enforces authorization
on crud

db.define_table('ticket',
SQLField('ctime','integer',default=now),
SQLField('url'),
    SQLField('code'),
SQLField('cas_user',db.cas_user))

db.cas_user.name.requires=IS_NOT_EMPTY()
db.cas_user.email.requires=[IS_EMAIL(),IS_NOT_IN_DB
(db,'cas_user.email')]

On 25 Aug., 14:20, max  wrote:
> i installed python-ldap and now i can load it.  Then i tried it with
> cas by  changing the cas_auth by editting it like this.
> But it still it works only for the local database.
> What i need is that  the web2py user (ad user name )identifies against
> the active directory  password after first registration (with or
> without password).
>
> auth=Auth(globals(),db)  # authentication/
> authorization
> auth.settings.login_methods=[ldap_auth
> (mode='ad',server='ad.mydomain.com',
> base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com')]
>
> auth.settings.table_user =db.define_table("cas_user",
>   db.Field("name",length=128,default=""),
>   db.Field("email", length=128,default=""),
>   db.Field("password",'password',readable=False,
> label="Password"),
>   db.Field('verification',default=''),
>   db.Field('last_attempt_time','integer',default=0),
>   db.Field('failed_attempts','integer',default=0))#, readable=False,
> default="")
>
> t = auth.settings.table_user
> t.name.requires = IS_NOT_EMPTY()
> t.email.requires = IS_NOT_EMPTY()
> t.password.requires = CRYPT()
> t.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db, db.cas_user.email)]
> auth.define_tables()
>
> crud=Crud(globals(),db)
> crud.settings.auth=auth  # enforces authorization
> on crud
>
> db.define_table('ticket',
> SQLField('ctime','integer',default=now),
> SQLField('url'),
> SQLField('code'),
> SQLField('cas_user',db.cas_user))
>
> db.cas_user.name.requires=IS_NOT_EMPTY()
> db.cas_user.email.requires=[IS_EMAIL(),IS_NOT_IN_DB
> (db,'cas_user.email')]
>
> On 25 Aug., 13:22, max  wrote:
>
> > thanks. now i installed it.
> > On 25 Aug., 11:52, mdipierro  wrote:
>
> > > Do you have python ldap API installed? It does not come with web2py.
>
> > > On Aug 25, 4:41 am, max  wrote:
>
> > > > I tried to add the following code in the db.py
>
> > > > from gluon.contrib.login_methods.ldap_auth import ldap_auth
> > > > auth.settings.login_methods = [ldap_auth(mode='ad',
> > > > server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]
>
> > > > but it gives the failure.
> > > > gluon.contrib.login_methods.ldap_auth import ldap_auth  File "/srv/www/
> > > > web2py/gluon/contrib/login_methods/ldap_auth.py", line 1, in
> > > > import ldapImportError: No module named ldap
>
> > > > But if i insert the code in the controller the import shows no
> > > > failures.
> > > > does anybody have any idea?
>
> > > >

[web2py:29323] Re: Solved: ldap authentification AD

2009-08-25 Thread max

i installed python-ldap and now i can load it.  Then i tried it with
cas by  changing the cas_auth by editting it like this.
But it still it works only for the local database.
What i need is that  the web2py user (ad user name )identifies against
the active directory  password after first registration (with or
without password).


auth=Auth(globals(),db)  # authentication/
authorization
auth.settings.login_methods=[ldap_auth
(mode='ad',server='ad.mydomain.com',
base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com')]

auth.settings.table_user =db.define_table("cas_user",
  db.Field("name",length=128,default=""),
  db.Field("email", length=128,default=""),
  db.Field("password",'password',readable=False,
label="Password"),
  db.Field('verification',default=''),
  db.Field('last_attempt_time','integer',default=0),
  db.Field('failed_attempts','integer',default=0))#, readable=False,
default="")

t = auth.settings.table_user
t.name.requires = IS_NOT_EMPTY()
t.email.requires = IS_NOT_EMPTY()
t.password.requires = CRYPT()
t.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db, db.cas_user.email)]
auth.define_tables()

crud=Crud(globals(),db)
crud.settings.auth=auth  # enforces authorization
on crud


db.define_table('ticket',
SQLField('ctime','integer',default=now),
SQLField('url'),
    SQLField('code'),
SQLField('cas_user',db.cas_user))

db.cas_user.name.requires=IS_NOT_EMPTY()
db.cas_user.email.requires=[IS_EMAIL(),IS_NOT_IN_DB
(db,'cas_user.email')]








On 25 Aug., 13:22, max  wrote:
> thanks. now i installed it.
> On 25 Aug., 11:52, mdipierro  wrote:
>
> > Do you have python ldap API installed? It does not come with web2py.
>
> > On Aug 25, 4:41 am, max  wrote:
>
> > > I tried to add the following code in the db.py
>
> > > from gluon.contrib.login_methods.ldap_auth import ldap_auth
> > > auth.settings.login_methods = [ldap_auth(mode='ad',
> > > server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]
>
> > > but it gives the failure.
> > > gluon.contrib.login_methods.ldap_auth import ldap_auth  File "/srv/www/
> > > web2py/gluon/contrib/login_methods/ldap_auth.py", line 1, in
> > > import ldapImportError: No module named ldap
>
> > > But if i insert the code in the controller the import shows no
> > > failures.
> > > does anybody have any idea?
>
> > > On 7 Aug., 15:32, max  wrote:
>
> > > > thanks, fran
>
> > > > On 7 Aug., 14:10, Fran  wrote:
>
> > > > > On Aug 7, 8:19 am, max  wrote:
>
> > > > > > How can i configure the Active directory authentification using CAS?
> > > > > > should i have to uncomment and edit the
> > > > > > ""
> > > > > > auth.settings.login_methods.append(ldap_auth
> > > > > > (mode='ad',server='my.domain.controller',base_dn="ou=Users,dc=domain,dc=com",bind_dn="cn=Administrator,ou=Users,d
> > > > > > c=domain,dc=com",bind_pass="password"))
> > > > > > ""
> > > > > > or is there anyway to configure it application based?
>
> > > > > You can use AD without CAS...just for a single application...this is
> > > > > the usual usage.
> > > > > I don't have experience of using it with CAS...I just downloaded the
> > > > > CAS appliance & it doesn't seem to use Auth, so would need converting
> > > > > to use Auth before it could be made to work with ldap_auth.
>
> > > > > The best docs for LDAP authentication are currently within the source
> > > > > (the new book also has some, but the source is fine):
> > > > > gluon/contrib/login_methods/ldap_auth.py
>
> > > > > So to use AD, you need to have 2 lines in your model (on top of the
> > > > > usual Auth lines):
> > > > > from gluon.contrib.login_methods.ldap_auth import ldap_auth
> > > > > auth.settings.login_methods.append(ldap_auth(mode='ad',
> > > > > server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com'))
>
> > > > > This mode means that password is cached in DB & so you can access
> > > > > using last password known to the app in case AD is down.
> > > > > To not have this method, make the 2nd line instead:
> > > > > auth.settings.login_methods = [ldap_auth(mode='ad',
> > > > > server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]
>
> > > > > F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29320] Solved: ldap authentification AD

2009-08-25 Thread max


thanks. now i installed it.
On 25 Aug., 11:52, mdipierro  wrote:
> Do you have python ldap API installed? It does not come with web2py.
>
> On Aug 25, 4:41 am, max  wrote:
>
> > I tried to add the following code in the db.py
>
> > from gluon.contrib.login_methods.ldap_auth import ldap_auth
> > auth.settings.login_methods = [ldap_auth(mode='ad',
> > server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]
>
> > but it gives the failure.
> > gluon.contrib.login_methods.ldap_auth import ldap_auth  File "/srv/www/
> > web2py/gluon/contrib/login_methods/ldap_auth.py", line 1, in
> > import ldapImportError: No module named ldap
>
> > But if i insert the code in the controller the import shows no
> > failures.
> > does anybody have any idea?
>
> > On 7 Aug., 15:32, max  wrote:
>
> > > thanks, fran
>
> > > On 7 Aug., 14:10, Fran  wrote:
>
> > > > On Aug 7, 8:19 am, max  wrote:
>
> > > > > How can i configure the Active directory authentification using CAS?
> > > > > should i have to uncomment and edit the
> > > > > ""
> > > > > auth.settings.login_methods.append(ldap_auth
> > > > > (mode='ad',server='my.domain.controller',base_dn="ou=Users,dc=domain,dc=com",bind_dn="cn=Administrator,ou=Users,d
> > > > > c=domain,dc=com",bind_pass="password"))
> > > > > ""
> > > > > or is there anyway to configure it application based?
>
> > > > You can use AD without CAS...just for a single application...this is
> > > > the usual usage.
> > > > I don't have experience of using it with CAS...I just downloaded the
> > > > CAS appliance & it doesn't seem to use Auth, so would need converting
> > > > to use Auth before it could be made to work with ldap_auth.
>
> > > > The best docs for LDAP authentication are currently within the source
> > > > (the new book also has some, but the source is fine):
> > > > gluon/contrib/login_methods/ldap_auth.py
>
> > > > So to use AD, you need to have 2 lines in your model (on top of the
> > > > usual Auth lines):
> > > > from gluon.contrib.login_methods.ldap_auth import ldap_auth
> > > > auth.settings.login_methods.append(ldap_auth(mode='ad',
> > > > server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com'))
>
> > > > This mode means that password is cached in DB & so you can access
> > > > using last password known to the app in case AD is down.
> > > > To not have this method, make the 2nd line instead:
> > > > auth.settings.login_methods = [ldap_auth(mode='ad',
> > > > server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]
>
> > > > F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29315] ldap authentification AD

2009-08-25 Thread max

I tried to add the following code in the db.py

from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods = [ldap_auth(mode='ad',
server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]

but it gives the failure.
gluon.contrib.login_methods.ldap_auth import ldap_auth  File "/srv/www/
web2py/gluon/contrib/login_methods/ldap_auth.py", line 1, in
import ldapImportError: No module named ldap

But if i insert the code in the controller the import shows no
failures.
does anybody have any idea?

On 7 Aug., 15:32, max  wrote:
> thanks, fran
>
> On 7 Aug., 14:10, Fran  wrote:
>
> > On Aug 7, 8:19 am, max  wrote:
>
> > > How can i configure the Active directory authentification using CAS?
> > > should i have to uncomment and edit the
> > > ""
> > > auth.settings.login_methods.append(ldap_auth
> > > (mode='ad',server='my.domain.controller',base_dn="ou=Users,dc=domain,dc=com",bind_dn="cn=Administrator,ou=Users,d
> > > c=domain,dc=com",bind_pass="password"))
> > > ""
> > > or is there anyway to configure it application based?
>
> > You can use AD without CAS...just for a single application...this is
> > the usual usage.
> > I don't have experience of using it with CAS...I just downloaded the
> > CAS appliance & it doesn't seem to use Auth, so would need converting
> > to use Auth before it could be made to work with ldap_auth.
>
> > The best docs for LDAP authentication are currently within the source
> > (the new book also has some, but the source is fine):
> > gluon/contrib/login_methods/ldap_auth.py
>
> > So to use AD, you need to have 2 lines in your model (on top of the
> > usual Auth lines):
> > from gluon.contrib.login_methods.ldap_auth import ldap_auth
> > auth.settings.login_methods.append(ldap_auth(mode='ad',
> > server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com'))
>
> > This mode means that password is cached in DB & so you can access
> > using last password known to the app in case AD is down.
> > To not have this method, make the 2nd line instead:
> > auth.settings.login_methods = [ldap_auth(mode='ad',
> > server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]
>
> > F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29025] Solved: select box

2009-08-20 Thread max

Thanks. that was it.

On Aug 20, 4:09 pm, "mr.freeze"  wrote:
> Does this do what you want?
> form = FORM(SELECT('20','40',_name="tipo"), INPUT(_type='submit',
> _value=" Search"))
>
> On Aug 20, 8:47 am, max  wrote:
>
> > i just want to make a select box in the form and , i get the select
> > box , but can't get the values as i intedend.
> > there's something wrong in the  way i write. can someone just give me
> > a tipp?
>
> > form2 = FORM(INPUT(SELECT(_name="tipo",OPTION('20','40')), INPUT
> > (_type='submit', _value=" Search"))
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29006] select box

2009-08-20 Thread max

i just want to make a select box in the form and , i get the select
box , but can't get the values as i intedend.
there's something wrong in the  way i write. can someone just give me
a tipp?

form2 = FORM(INPUT(SELECT(_name="tipo",OPTION('20','40')), INPUT
(_type='submit', _value=" Search"))

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



[web2py:28893] Issue Solved: simple join in DAL

2009-08-18 Thread max

thanks. got it worked.


On 18 Aug., 14:52, mdipierro  wrote:
> there is one missing piece of information. If result in the view the
> same as result_dict in the controller? If so, you loop over result
> which means it is a list not a dictionary. While you initialize
> result_dict as a dict, as the name suggests. Perhpas you want
>
> for i in s:
>   result_dict[i]=(my_db.details.lokid == i).select
> (my_db.details.row1,my_db.details.row2,my_db.details.row3)[0]
>
> and
>
> {{for record in result.values():}}
>{{ if record.lokid:}}
>  {{=XML(record.lokid)}}
>{{pass}}
> {{pass}}
>
> anyway, if result is a dict, items will not be sorted.
>
> On Aug 18, 7:32 am, max  wrote:
>
> > that doesn't give my desired result and i get the failure in my view
> > when i want to run throught the dictionary:
> > I am doing this in the view.
>
> > {{for record in result:}}
> >{{ if record.lokid:}}
> >  {{=XML(record.lokid)}}
> >{{pass}}
> > {{pass}}
>
> > AttributeError: 'int' object has no attribute 'lokid'
> > But when i did the
>
> > result_dict=(my_db.details.lokid == i).select
> > (my_db.details.row1,my_db.details.row2,my_db.details.row3)
>
> > Then i got the last  searched element correctly in the view.
> > Sorry for trouble, as i am new into python.
>
> > On 18 Aug., 12:19, mdipierro  wrote:
>
> > > for i in s:
> > >   result_dict[i]=(my_db.details.lokid == i).select
> > > (my_db.details.row1,my_db.details.row2,my_db.details.row3)[0]
>
> > > or
>
> > > for i in s:
> > >   result_dict[i]=(my_db.details.lokid == i).select
> > > (my_db.details.row1,my_db.details.row2,my_db.details.row3).as_list()
> > > [0]
>
> > > On Aug 18, 4:32 am, max  wrote:
>
> > > > Massiomo, Thanks for the reply.
>
> > > > Got the code working and now I have a python problem where i can't put
> > > > the end results in a dictionary where my view can output it.
> > > > result_dict={}
> > > > s = list(set([row.lokid for row in s1]).union(set([row.lokid for row
> > > > in s2])))
> > > > what i tried was
> > > > _
> > > > for i in s:
> > > >   result_dict[i]=(my_db.details.lokid == i).select
> > > > (my_db.details.row1,my_db.details.row2,my_db.details.row3)
> > > > _
>
> > > > But this doesn't work.
> > > > Cany anybody give just an idea?
> > > > Thanks
>
> > > > On 17 Aug., 17:42, mdipierro  wrote:
>
> > > > > I do not think this can be done in query (not a web2py issue but a SQL
> > > > > issue).
>
> > > > > You need to do
>
> > > > > s1=db(q1).select(db.details.lokid)
> > > > > s2=db(q2).select(db.keywords.lokid)
> > > > > s = list(set([row.lokid for row in s1]).union(set([row.lokid for row
> > > > > in s2])))
>
> > > > > Perhaps somebody else has a better suggestion.
>
> > > > > On Aug 17, 9:52 am, max  wrote:
>
> > > > > > sorry for the failure  in copy and pasting as i have a lot more 
> > > > > > fields
> > > > > > and i just kept it simple.
>
> > > > > > First Table:
> > > > > > my_db.define_table('details',
> > > > > > SQLField('lokid'),
> > > > > > SQLField(''titel'),
> > > > > > )
>
> > > > > > Second table:
> > > > > > my_db.define_table('keywords',
> > > > > > SQLField('lokid',my_db.lokid)),
> > > > > > SQLField('keyword')
> > > > > > )
>
> > > > > > my search form looks
> > > > > > form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
> > > > > > (_type='submit', _value="mySearch"))
>
> > > > > > my queries are like:
>
> > > > > >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> > > > > >  q2 = (my_db.keywords.keyword.like('%%%s%%' % my_search))
>
> > > > > > __
>
> > > > > > On 17 Aug., 16:10, mdipierro  wrote:
>
> > > > > > > Sorry, I still think your tables h

[web2py:28890] Re: simple join in DAL

2009-08-18 Thread max

that doesn't give my desired result and i get the failure in my view
when i want to run throught the dictionary:
I am doing this in the view.

{{for record in result:}}
   {{ if record.lokid:}}
 {{=XML(record.lokid)}}
   {{pass}}
{{pass}}


AttributeError: 'int' object has no attribute 'lokid'
But when i did the

result_dict=(my_db.details.lokid == i).select
(my_db.details.row1,my_db.details.row2,my_db.details.row3)

Then i got the last  searched element correctly in the view.
Sorry for trouble, as i am new into python.


On 18 Aug., 12:19, mdipierro  wrote:
> for i in s:
>   result_dict[i]=(my_db.details.lokid == i).select
> (my_db.details.row1,my_db.details.row2,my_db.details.row3)[0]
>
> or
>
> for i in s:
>   result_dict[i]=(my_db.details.lokid == i).select
> (my_db.details.row1,my_db.details.row2,my_db.details.row3).as_list()
> [0]
>
> On Aug 18, 4:32 am, max  wrote:
>
> > Massiomo, Thanks for the reply.
>
> > Got the code working and now I have a python problem where i can't put
> > the end results in a dictionary where my view can output it.
> > result_dict={}
> > s = list(set([row.lokid for row in s1]).union(set([row.lokid for row
> > in s2])))
> > what i tried was
> > _
> > for i in s:
> >   result_dict[i]=(my_db.details.lokid == i).select
> > (my_db.details.row1,my_db.details.row2,my_db.details.row3)
> > _
>
> > But this doesn't work.
> > Cany anybody give just an idea?
> > Thanks
>
> > On 17 Aug., 17:42, mdipierro  wrote:
>
> > > I do not think this can be done in query (not a web2py issue but a SQL
> > > issue).
>
> > > You need to do
>
> > > s1=db(q1).select(db.details.lokid)
> > > s2=db(q2).select(db.keywords.lokid)
> > > s = list(set([row.lokid for row in s1]).union(set([row.lokid for row
> > > in s2])))
>
> > > Perhaps somebody else has a better suggestion.
>
> > > On Aug 17, 9:52 am, max  wrote:
>
> > > > sorry for the failure  in copy and pasting as i have a lot more fields
> > > > and i just kept it simple.
>
> > > > First Table:
> > > > my_db.define_table('details',
> > > > SQLField('lokid'),
> > > > SQLField(''titel'),
> > > > )
>
> > > > Second table:
> > > > my_db.define_table('keywords',
> > > > SQLField('lokid',my_db.lokid)),
> > > > SQLField('keyword')
> > > > )
>
> > > > my search form looks
> > > > form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
> > > > (_type='submit', _value="mySearch"))
>
> > > > my queries are like:
>
> > > >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> > > >  q2 = (my_db.keywords.keyword.like('%%%s%%' % my_search))
>
> > > > __
>
> > > > On 17 Aug., 16:10, mdipierro  wrote:
>
> > > > > Sorry, I still think your tables have something missing since q1 and
> > > > > q2 reference fields that do not exist.
>
> > > > > On Aug 17, 8:47 am, max  wrote:
>
> > > > > > Sorry, made a failure in my posting. I corrected it now.
>
> > > > > > First Table:
> > > > > > my_db.define_table('details',
> > > > > > SQLField('lokid'),
> > > > > > SQLField(''details'),
> > > > > > )
>
> > > > > > Second table:
> > > > > > my_db.define_table('keywords',
> > > > > > SQLField('lokid',my_db.lokid))
> > > > > > SQLField('lokid',my_db.keyword))
>
> > > > > > my search form looks
> > > > > > form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
> > > > > > (_type='submit', _value="mySearch"))
>
> > > > > > my queries are like:
>
> > > > > >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> > > > > >  q2 = (my_db.keywords.details.like('%%%s%%' % my_search))
>
> > > > > > I have to search for keyword in  table 'keywords' and get the lokid
> > > > > > for table 'details' and show the values. At the same t

[web2py:28884] Re: simple join in DAL

2009-08-18 Thread max

Massiomo, Thanks for the reply.

Got the code working and now I have a python problem where i can't put
the end results in a dictionary where my view can output it.
result_dict={}
s = list(set([row.lokid for row in s1]).union(set([row.lokid for row
in s2])))
what i tried was
_
for i in s:
  result_dict[i]=(my_db.details.lokid == i).select
(my_db.details.row1,my_db.details.row2,my_db.details.row3)
_

But this doesn't work.
Cany anybody give just an idea?
Thanks


On 17 Aug., 17:42, mdipierro  wrote:
> I do not think this can be done in query (not a web2py issue but a SQL
> issue).
>
> You need to do
>
> s1=db(q1).select(db.details.lokid)
> s2=db(q2).select(db.keywords.lokid)
> s = list(set([row.lokid for row in s1]).union(set([row.lokid for row
> in s2])))
>
> Perhaps somebody else has a better suggestion.
>
> On Aug 17, 9:52 am, max  wrote:
>
> > sorry for the failure  in copy and pasting as i have a lot more fields
> > and i just kept it simple.
>
> > First Table:
> > my_db.define_table('details',
> > SQLField('lokid'),
> > SQLField(''titel'),
> > )
>
> > Second table:
> > my_db.define_table('keywords',
> > SQLField('lokid',my_db.lokid)),
> > SQLField('keyword')
> > )
>
> > my search form looks
> > form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
> > (_type='submit', _value="mySearch"))
>
> > my queries are like:
>
> >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> >  q2 = (my_db.keywords.keyword.like('%%%s%%' % my_search))
>
> > __
>
> > On 17 Aug., 16:10, mdipierro  wrote:
>
> > > Sorry, I still think your tables have something missing since q1 and
> > > q2 reference fields that do not exist.
>
> > > On Aug 17, 8:47 am, max  wrote:
>
> > > > Sorry, made a failure in my posting. I corrected it now.
>
> > > > First Table:
> > > > my_db.define_table('details',
> > > > SQLField('lokid'),
> > > > SQLField(''details'),
> > > > )
>
> > > > Second table:
> > > > my_db.define_table('keywords',
> > > > SQLField('lokid',my_db.lokid))
> > > > SQLField('lokid',my_db.keyword))
>
> > > > my search form looks
> > > > form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
> > > > (_type='submit', _value="mySearch"))
>
> > > > my queries are like:
>
> > > >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> > > >  q2 = (my_db.keywords.details.like('%%%s%%' % my_search))
>
> > > > I have to search for keyword in  table 'keywords' and get the lokid
> > > > for table 'details' and show the values. At the same time i have to
> > > > search the 'detai'ls table and show it's own values for the same
> > > > query.
> > > > Optimally i put both the results in a dictionary and sort and it and
> > > > put in my view. My problem is how can i combine the search.
>
> > > > On 17 Aug., 15:26, mdipierro  wrote:
>
> > > > > I do not understand. Moreover in
>
> > > > >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> > > > >  q1 = (my_db.keywords.schlagwortzo.like('%%%s%%' % my_search))
>
> > > > > table details does not have a titel (nor title) field and table
> > > > > keywords does not have a schlagwortzo field.
>
> > > > > Something is missing.
>
> > > > > On Aug 17, 8:19 am, max  wrote:
>
> > > > > > I am having a small problem, that i can't solve  using the example 
> > > > > > in
> > > > > > book.
>
> > > > > > I want to  search in two tables for one search word and output only
> > > > > > rows in one table. I can't write the joined statement using web2py 
> > > > > > DAL
> > > > > > commands.
>
> > > > > > First Table:
> > > > > > my_db.define_table('details',
> > > > > > SQLField('lokid'),
> > > > > > SQLField(''details'),
> > > > > > )
>
> > > > > > Second table:
> > > > > > my_db.define_table('keywords',
> > > > > > SQLField('lokid',my_db.details))
>
> > > > > > my search form looks
> > > > > > form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
> > > > > > (_type='submit', _value="mySearch"))
>
> > > > > > my queries are like:
>
> > > > > >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> > > > > >  q1 = (my_db.keywords.schlagwortzo.like('%%%s%%' % my_search))
>
> > > > > > I have to combine these commands.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28818] Re: simple join in DAL

2009-08-17 Thread max

sorry for the failure  in copy and pasting as i have a lot more fields
and i just kept it simple.


First Table:
my_db.define_table('details',
SQLField('lokid'),
SQLField(''titel'),
)

Second table:
my_db.define_table('keywords',
SQLField('lokid',my_db.lokid)),
SQLField('keyword')
)

my search form looks
form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
(_type='submit', _value="mySearch"))

my queries are like:

 q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
 q2 = (my_db.keywords.keyword.like('%%%s%%' % my_search))

__



On 17 Aug., 16:10, mdipierro  wrote:
> Sorry, I still think your tables have something missing since q1 and
> q2 reference fields that do not exist.
>
> On Aug 17, 8:47 am, max  wrote:
>
> > Sorry, made a failure in my posting. I corrected it now.
>
> > First Table:
> > my_db.define_table('details',
> > SQLField('lokid'),
> > SQLField(''details'),
> > )
>
> > Second table:
> > my_db.define_table('keywords',
> > SQLField('lokid',my_db.lokid))
> > SQLField('lokid',my_db.keyword))
>
> > my search form looks
> > form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
> > (_type='submit', _value="mySearch"))
>
> > my queries are like:
>
> >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> >  q2 = (my_db.keywords.details.like('%%%s%%' % my_search))
>
> > I have to search for keyword in  table 'keywords' and get the lokid
> > for table 'details' and show the values. At the same time i have to
> > search the 'detai'ls table and show it's own values for the same
> > query.
> > Optimally i put both the results in a dictionary and sort and it and
> > put in my view. My problem is how can i combine the search.
>
> > On 17 Aug., 15:26, mdipierro  wrote:
>
> > > I do not understand. Moreover in
>
> > >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> > >  q1 = (my_db.keywords.schlagwortzo.like('%%%s%%' % my_search))
>
> > > table details does not have a titel (nor title) field and table
> > > keywords does not have a schlagwortzo field.
>
> > > Something is missing.
>
> > > On Aug 17, 8:19 am, max  wrote:
>
> > > > I am having a small problem, that i can't solve  using the example in
> > > > book.
>
> > > > I want to  search in two tables for one search word and output only
> > > > rows in one table. I can't write the joined statement using web2py DAL
> > > > commands.
>
> > > > First Table:
> > > > my_db.define_table('details',
> > > > SQLField('lokid'),
> > > > SQLField(''details'),
> > > > )
>
> > > > Second table:
> > > > my_db.define_table('keywords',
> > > > SQLField('lokid',my_db.details))
>
> > > > my search form looks
> > > > form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
> > > > (_type='submit', _value="mySearch"))
>
> > > > my queries are like:
>
> > > >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> > > >  q1 = (my_db.keywords.schlagwortzo.like('%%%s%%' % my_search))
>
> > > > I have to combine these commands.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28811] Re: simple join in DAL

2009-08-17 Thread max

Sorry, made a failure in my posting. I corrected it now.

First Table:
my_db.define_table('details',
SQLField('lokid'),
SQLField(''details'),
)

Second table:
my_db.define_table('keywords',
SQLField('lokid',my_db.lokid))
SQLField('lokid',my_db.keyword))

my search form looks
form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
(_type='submit', _value="mySearch"))

my queries are like:

 q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
 q2 = (my_db.keywords.details.like('%%%s%%' % my_search))

I have to search for keyword in  table 'keywords' and get the lokid
for table 'details' and show the values. At the same time i have to
search the 'detai'ls table and show it's own values for the same
query.
Optimally i put both the results in a dictionary and sort and it and
put in my view. My problem is how can i combine the search.




On 17 Aug., 15:26, mdipierro  wrote:
> I do not understand. Moreover in
>
>  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
>  q1 = (my_db.keywords.schlagwortzo.like('%%%s%%' % my_search))
>
> table details does not have a titel (nor title) field and table
> keywords does not have a schlagwortzo field.
>
> Something is missing.
>
> On Aug 17, 8:19 am, max  wrote:
>
> > I am having a small problem, that i can't solve  using the example in
> > book.
>
> > I want to  search in two tables for one search word and output only
> > rows in one table. I can't write the joined statement using web2py DAL
> > commands.
>
> > First Table:
> > my_db.define_table('details',
> > SQLField('lokid'),
> > SQLField(''details'),
> > )
>
> > Second table:
> > my_db.define_table('keywords',
> > SQLField('lokid',my_db.details))
>
> > my search form looks
> > form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
> > (_type='submit', _value="mySearch"))
>
> > my queries are like:
>
> >  q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
> >  q1 = (my_db.keywords.schlagwortzo.like('%%%s%%' % my_search))
>
> > I have to combine these commands.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28809] simple join in DAL

2009-08-17 Thread max

I am having a small problem, that i can't solve  using the example in
book.

I want to  search in two tables for one search word and output only
rows in one table. I can't write the joined statement using web2py DAL
commands.

First Table:
my_db.define_table('details',
SQLField('lokid'),
SQLField(''details'),
)

Second table:
my_db.define_table('keywords',
SQLField('lokid',my_db.details))

my search form looks
form2 = FORM(INPUT(_type="text", _name='my_search'), INPUT
(_type='submit', _value="mySearch"))

my queries are like:

 q1 = (my_db.details.titel.lower().like('%%%s%%' % my_search))
 q1 = (my_db.keywords.schlagwortzo.like('%%%s%%' % my_search))

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



[web2py:28429] Re: Chceking the url

2009-08-12 Thread max

thanks massimo

On 12 Aug., 12:02, mdipierro  wrote:
> Should be
>
> 
>
>
> you can do
>
> {{import os}}
> {{if os.path.exists(os.path.join(request.folder,'static/my_pics/%s' %
> myrows.id)):}}
> 
> {{else:}}
> No image
> {{pass}}
>
> On Aug 12, 4:15 am, max  wrote:
>
> > I am using
> >
> > to dynamically load  the pictures.
> > Sometimes the pictures are not for some ids. Is there any way to chcke
> > if the picture is available using the request?
> > Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28412] Chceking the url

2009-08-12 Thread max

I am using
   
to dynamically load  the pictures.
Sometimes the pictures are not for some ids. Is there any way to chcke
if the picture is available using the request?
Thanks

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



[web2py:28155] Re: ldap authentification

2009-08-07 Thread max

thanks, fran

On 7 Aug., 14:10, Fran  wrote:
> On Aug 7, 8:19 am, max  wrote:
>
> > How can i configure the Active directory authentification using CAS?
> > should i have to uncomment and edit the
> > ""
> > auth.settings.login_methods.append(ldap_auth
> > (mode='ad',server='my.domain.controller',base_dn="ou=Users,dc=domain,dc=com",bind_dn="cn=Administrator,ou=Users,d
> > c=domain,dc=com",bind_pass="password"))
> > ""
> > or is there anyway to configure it application based?
>
> You can use AD without CAS...just for a single application...this is
> the usual usage.
> I don't have experience of using it with CAS...I just downloaded the
> CAS appliance & it doesn't seem to use Auth, so would need converting
> to use Auth before it could be made to work with ldap_auth.
>
> The best docs for LDAP authentication are currently within the source
> (the new book also has some, but the source is fine):
> gluon/contrib/login_methods/ldap_auth.py
>
> So to use AD, you need to have 2 lines in your model (on top of the
> usual Auth lines):
> from gluon.contrib.login_methods.ldap_auth import ldap_auth
> auth.settings.login_methods.append(ldap_auth(mode='ad',
> server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com'))
>
> This mode means that password is cached in DB & so you can access
> using last password known to the app in case AD is down.
> To not have this method, make the 2nd line instead:
> auth.settings.login_methods = [ldap_auth(mode='ad',
> server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]
>
> F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28143] ldap authentification

2009-08-07 Thread max

How can i configure the Active directory authentification using CAS?
should i have to uncomment and edit the
""
auth.settings.login_methods.append(ldap_auth
(mode='ad',server='my.domain.controller',base_dn="ou=Users,dc=domain,dc=com",bind_dn="cn=Administrator,ou=Users,d
c=domain,dc=com",bind_pass="password"))
""
or is there anyway to configure it application based?

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



[web2py:28084] get the row id from form

2009-08-06 Thread max

i am inserting Form values  into a postgres database.
For on-the fly parsing of other data, i need the  entry id of the
database, which was inserted by my form.
I am getting this values by calculating field values and it is so
ugly.
Is there any web2py way of just getting the entry id of the currently
added form entry?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:28083] utf- 8 chinese characters

2009-08-06 Thread max

I am inserting parsed text from a utf-8 xml file into a mysql
database.
there is a little problem, where i have to clarify.

In my xml file i have entries like this.
高中语文教学目标与检测(下编)<中学语文

when i parse the data only the second entry is correctly inserted.

I use the myDatabase.executesql() command.
insert into refs_test(title,abbrev_series_title) values ("8bed
\u6587,Zxyw", "\xe4\xb8\xad\xe5\xad\xa6\xe8\xaf\xad\xe6\)

i tried to encode all the strings using encode.(utf-8)   then every
entry was in  (\xe4\xb8\xad\x)
but in the database i see the same.

if i print the sql command in the console i have the correct string
and it works when i copy and paste it.

can somebody give me a tipp?

thanks!



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



[web2py:27682] Re: executing a sql script

2009-07-31 Thread max

thanks for the answer massimo.

xml parsing  i have done with dom parser.

for me the difficult part is to how i intgrate my xml parsing program
to the files which i have uploaded throgh web2py.
I want it  this way.

1. Upload the xml file and a zip file
   implemented with web2py
2. parse the content from the xml file and insert the data into a
mysql databse
i can generate the sql insert statesments with my xml parser.
interesting in knowing how i can insert this commands on the fly.
3. copy the content of the zip file to a specific folder other than
upload folder
have  written a simple file copy mechanism,  how can i execute this
script using web2py




On 30 Jul., 17:49, mdipierro  wrote:
> Is you problem parsing the xml data?
> I am not expert but Python comes with this 
> parser:http://docs.python.org/library/xml.sax.html
>
> massimo
>
> On Jul 30, 8:49 am, max  wrote:
>
> > I am trying to execute  upload a xml parser into my application and
> > parse it on the fly and insert the data into a database which is
> > connected to the web2py.
> > I have already written  a program to upload the xml file and the
> > files  (which are desribed in the xml)  seperately.
> > Can somebody give me some idea how this is done using web2py?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:27615] executing a sql script

2009-07-30 Thread max

I am trying to execute  upload a xml parser into my application and
parse it on the fly and insert the data into a database which is
connected to the web2py.
I have already written  a program to upload the xml file and the
files  (which are desribed in the xml)  seperately.
Can somebody give me some idea how this is done using web2py?

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



[web2py:26402] Re: UTf-8 output

2009-07-13 Thread max

thank you both, i think your suggestion with the database encoding is
correct as ,utf-8 encoding worked correct for a postgres database.
I will try to correct the mysql database and post if I get problems.


On Jul 13, 12:15 pm, AchipA  wrote:
> You don't need the change anything in the layouts or the controller,
> or to be precise, you can, but that's only going to cause more
> problems down the line. The Right Way (TM) is to do a database dump,
> fix the encodings, and import back.
>
> The collations don't matter in this regard -> it's the TABLE that has
> the charset mismatched, compared to whoever is writing the DB. That's
> why I said do SHOW TABLE MYTABLE. Either mytable is 8859-1 and you're
> writing utf8 to it, or the other way round (did you fill that table
> from PHP without defining the encoding ?).
>
> On Jul 13, 11:58 am, max  wrote:
>
> > How do I stop double encoding or the treating of data as binary
> > storage?
>
> > What I tried  was:
> > changed the encoding of the of the controller and layouts to see if i
> > am double encoding.
> > But got the same display as in my previous port.
>
> >  the output from mysql in my database
>
> > SHOW COLLATION LIKE 'utf8%';
> > ++-+-+-+--+-+
> > | Collation  | Charset | Id  | Default | Compiled | Sortlen |
> > ++-+-+-+--+-+
> > | utf8_general_ci| utf8|  33 | Yes | Yes  |   1 |
> > | utf8_bin   | utf8|  83 | | Yes  |   1 |
> > | utf8_unicode_ci| utf8| 192 | | Yes  |   8 |
> > | utf8_icelandic_ci  | utf8| 193 | | Yes  |   8 |
> > | utf8_latvian_ci| utf8| 194 | | Yes  |   8 |
> > | utf8_romanian_ci   | utf8| 195 | | Yes  |   8 |
> > | utf8_slovenian_ci  | utf8| 196 | | Yes  |   8 |
> > | utf8_polish_ci | utf8| 197 | | Yes  |   8 |
> > | utf8_estonian_ci   | utf8| 198 | | Yes  |   8 |
> > | utf8_spanish_ci| utf8| 199 | | Yes  |   8 |
> > | utf8_swedish_ci| utf8| 200 | | Yes  |   8 |
> > | utf8_turkish_ci| utf8| 201 | | Yes  |   8 |
> > | utf8_czech_ci  | utf8| 202 | | Yes  |   8 |
> > | utf8_danish_ci | utf8| 203 | | Yes  |   8 |
> > | utf8_lithuanian_ci | utf8| 204 | | Yes  |   8 |
> > | utf8_slovak_ci | utf8| 205 | | Yes  |   8 |
> > | utf8_spanish2_ci   | utf8| 206 | | Yes  |   8 |
> > | utf8_roman_ci  | utf8| 207 | | Yes  |   8 |
> > | utf8_persian_ci| utf8| 208 | | Yes  |   8 |
> > | utf8_esperanto_ci  | utf8| 209 | | Yes  |   8 |
> > | utf8_hungarian_ci  | utf8| 210 | | Yes  |   8 |
>
> > On Jul 13, 10:29 am, AchipA  wrote:
>
> > > Doublecheck that you actually have properly encoded data in the
> > > database ('show table X' should tell you the encoding of the table
> > > itself). Often 'displaying correctly' is misleading because of the
> > > possibility of making the same encoding mistake both ways (=treat
> > > mysql as binary storage). The other common problem is that you might
> > > be double-encoding (see the length of utf-8 chars -> if they are 4 or
> > > more, you're encoding already encoded data).
>
> > > On Jul 12, 9:49 pm, max  wrote:
>
> > > > I am implementing a search application using web2py.
> > > > I get the data from a  mysql data base where the data is inserted in
> > > > utf-8.
> > > > But when i access the data using web2py  connection data is not
> > > > displayed correctly.
> > > > I am sure, the mysql data is correctly encoded as other applications
> > > > accessing the same data show them correctly.
> > > > Some hints in this usergroup such as
> > > > #!/usr/bin/env python
> > > > # -*- coding: UTF-8 -*
> > > > in the default.py didn't help me.
> > > > max
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:26398] Re: UTf-8 output

2009-07-13 Thread max

How do I stop double encoding or the treating of data as binary
storage?

What I tried  was:
changed the encoding of the of the controller and layouts to see if i
am double encoding.
But got the same display as in my previous port.

 the output from mysql in my database

SHOW COLLATION LIKE 'utf8%';
++-+-+-+--+-+
| Collation  | Charset | Id  | Default | Compiled | Sortlen |
++-+-+-+--+-+
| utf8_general_ci| utf8|  33 | Yes | Yes  |   1 |
| utf8_bin   | utf8|  83 | | Yes  |   1 |
| utf8_unicode_ci| utf8| 192 | | Yes  |   8 |
| utf8_icelandic_ci  | utf8| 193 | | Yes  |   8 |
| utf8_latvian_ci| utf8| 194 | | Yes  |   8 |
| utf8_romanian_ci   | utf8| 195 | | Yes  |   8 |
| utf8_slovenian_ci  | utf8| 196 | | Yes  |   8 |
| utf8_polish_ci | utf8| 197 | | Yes  |   8 |
| utf8_estonian_ci   | utf8| 198 | | Yes  |   8 |
| utf8_spanish_ci| utf8| 199 | | Yes  |   8 |
| utf8_swedish_ci| utf8| 200 | | Yes  |   8 |
| utf8_turkish_ci| utf8| 201 | | Yes  |   8 |
| utf8_czech_ci  | utf8| 202 | | Yes  |   8 |
| utf8_danish_ci | utf8| 203 | | Yes  |   8 |
| utf8_lithuanian_ci | utf8| 204 | | Yes  |   8 |
| utf8_slovak_ci | utf8| 205 | | Yes  |   8 |
| utf8_spanish2_ci   | utf8| 206 | | Yes  |   8 |
| utf8_roman_ci  | utf8| 207 | | Yes  |   8 |
| utf8_persian_ci| utf8| 208 | | Yes  |   8 |
| utf8_esperanto_ci  | utf8| 209 | | Yes  |   8 |
| utf8_hungarian_ci  | utf8| 210 | | Yes  |   8 |



On Jul 13, 10:29 am, AchipA  wrote:
> Doublecheck that you actually have properly encoded data in the
> database ('show table X' should tell you the encoding of the table
> itself). Often 'displaying correctly' is misleading because of the
> possibility of making the same encoding mistake both ways (=treat
> mysql as binary storage). The other common problem is that you might
> be double-encoding (see the length of utf-8 chars -> if they are 4 or
> more, you're encoding already encoded data).
>
> On Jul 12, 9:49 pm, max  wrote:
>
> > I am implementing a search application using web2py.
> > I get the data from a  mysql data base where the data is inserted in
> > utf-8.
> > But when i access the data using web2py  connection data is not
> > displayed correctly.
> > I am sure, the mysql data is correctly encoded as other applications
> > accessing the same data show them correctly.
> > Some hints in this usergroup such as
> > #!/usr/bin/env python
> > # -*- coding: UTF-8 -*
> > in the default.py didn't help me.
> > max
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:26396] Re: UTf-8 output

2009-07-13 Thread max

This is what i get when i  see the data from the other search
interface using php.

Dongxiyang kao meiyue tongji zhuan 東西洋考每月統記傳

But in web2py search interface, i see like this

Dongxiyang kao meiyue tongji zhuan æ ±è¥¿æ´‹è€ƒæ¯ æœˆçµ±è¨˜å‚³



On Jul 12, 9:54 pm, mdipierro  wrote:
> can you provide an example of what you mean by "not displayed
> correcly"?
>
> On Jul 12, 2:49 pm, max  wrote:
>
> > I am implementing a search application using web2py.
> > I get the data from a  mysql data base where the data is inserted in
> > utf-8.
> > But when i access the data using web2py  connection data is not
> > displayed correctly.
> > I am sure, the mysql data is correctly encoded as other applications
> > accessing the same data show them correctly.
> > Some hints in this usergroup such as
> > #!/usr/bin/env python
> > # -*- coding: UTF-8 -*
> > in the default.py didn't help me.
> > max
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:26365] UTf-8 output

2009-07-12 Thread max

I am implementing a search application using web2py.
I get the data from a  mysql data base where the data is inserted in
utf-8.
But when i access the data using web2py  connection data is not
displayed correctly.
I am sure, the mysql data is correctly encoded as other applications
accessing the same data show them correctly.
Some hints in this usergroup such as
#!/usr/bin/env python
# -*- coding: UTF-8 -*
in the default.py didn't help me.
max

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