[web2py:23876] Re: Login_next

2009-06-11 Thread annet

Fran,

No, the version in trunk that fixed my problem was r1016.


> I have pages which have a List at the top of the page (created by
> crud.select) & underneath a create form (created by crud.create).
> With r896 & earlier, submitting a new record would refresh the List.
> r897 & later need a manual refresh (URL bar otherwise it wants to
> resubmit the form data)


I have something similar, just the other way around first the form
then the table:

@auth.requires_membership('site_manager')
def crud_openinghour():
...
form=crud.create(db.openingstijd)
form[0][-1][1].append(INPUT(_type='reset',_value='Reset'))
form[0][-1][1].append(INPUT
(_type='button',_value='Cancel',_onclick="window.location='%s';"%URL
(r=request,f='index')))
records=db((db.openingstijd.bedrijf==auth.user.bedrijf)&
(db.openingstijd.dag==db.dag.id))\
.select(db.openingstijd.ALL,db.dag.dag,orderby=db.openingstijd.dag|
db.openingstijd.van_tijd)
return dict(form=form,records=records)


Version r1016 did not break this functionality.


Kind regards,

Annet.
--~--~-~--~~~---~--~~
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:23877] Static files

2009-06-11 Thread annet

In web2py I have 5 applications which make use of the same static
files, at the moment each application has its own static files folder
containing these files. I wonder whether it is possible to remove the
static files the applications have in common from all applications but
one and reference the static files in this application from the other
applications?

For example, have application core's static files folder contain the
calendar.css, jquery.js and calendar.js files and reference them from
application site's web2py_ajax file in the following way:






Will this work, or am I overlooking something that will cause this to
break.


Kind regards,

Annet.
--~--~-~--~~~---~--~~
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:23878] Static files

2009-06-11 Thread annet

In web2py I have 5 applications which make use of the same static
files, at the moment each application has its own static files folder
containing these files. I wonder whether it is possible to remove the
static files the applications have in common from all applications but
one and reference the static files in this application from the other
applications?

For example, have application core's static files folder contain the
calendar.css, jquery.js and calendar.js files and reference them from
application site's web2py_ajax file in the following way:






Will this work, or am I overlooking something that will cause this to
break. What about moving the static files the applications have in
common to a location outside the applications? What would be the best
location?


Kind regards,
Annet.
--~--~-~--~~~---~--~~
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:23879] MIME type

2009-06-11 Thread annet

Massimo,

In Safari, the web inspector displays warning messages like these:

Resource interpreted as stylesheet but transferred with MIME type text/
html
Resource interpreted as script but transferred with MIME type text/
html
Resource interpreted as image but transferred with MIME type text/html

Is there a way to fix this?


Annet.
--~--~-~--~~~---~--~~
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:23880] Re: global logging to file

2009-06-11 Thread Iceberg

Not at all.

The cache.ram in log.py is to make sure the logger is inited only
once, otherwise we will see more and more duplicate log appearing in
the log file as Hans mentioned in his earlier posts. The only downside
is that you need to restart web2py if you change (but usually you
don't need to) log definition.

As to the "OPTIONAL in controller" part, you can ignore it. They are
just a rough demo and not necessary.

On Jun11, 3:17am, mdipierro  wrote:
> Why do you need to cache the logging module? Is this only for speed?
>
> On Jun 10, 1:44 pm, Iceberg  wrote:
>
> > After changing from FileHandler to RotatingFileHandler, now I think
> > the per-app log can be turned on by default (otherwise new comers
> > won't notice this good feature).
>
> > The only thing I am still not sure is whether one can use logging and
> > its FileHander (or RotatingFileHander) on GAE's readonly filesystem.
> > Tests are welcome.
>
> > Anyway, this is my latest code. Maybe it can help you.
>
> >   import logging
> >   def _init_log(level=logging.DEBUG):
> >     import os,logging.handlers
> >     logger=logging.getLogger(request.application)
> >     logger.setLevel(level)
> >     if request.env.web2py_runtime_gae: # if running on Google App
> > Engine
> >       handler=logging.handlers.HTTPHandler(
> >         request.env.http_host,URL(r=request,f='log')) # assuming there
> > is an optional log action
> >     else:
> >       handler=logging.handlers.RotatingFileHandler(
> >         os.path.join
> > (request.folder,'app.log'),maxBytes=1024*1024,backupCount=2)
> >     handler.setLevel(level)
> >     handler.setFormatter(logging.Formatter(
> >       "%(asctime)s %(levelname)s %(funcName)s():%(lineno)d %(message)
> > s"))
> >     logger.addHandler(handler)
> >     return logger
> >   logging=cache.ram('mylog',lambda:_init_log(),time_expire=)
>
> > OPTIONAL in controller:
>
> > def log():
> >   if request.vars: # append
> >     history=cache.ram('log_in_cache',lambda:[],time_expire=)
> >     history.append(request.vars)
> >     cache.ram('log_in_cache',lambda h=history:h,time_expire=0)#set
> >   else: # show
> >     return {'':TABLE(*[TR(item) for item in
> >       cache.ram('log_in_cache',lambda:None,time_expire=)])}

--~--~-~--~~~---~--~~
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:23881] Re: MIME type

2009-06-11 Thread dlypka

I have a similar problem:

I cannot get

to work on IE 8 or Opera.

IT DOES WORK on Chrome 2.0

I spent the last 3 days on this problem. Finally I had to cut and
paste all of my .js files
to be in place in the .html file which needs them. Now I finally have
my web2py app working on 3 browsers.


On Jun 11, 4:05 am, annet  wrote:
> Massimo,
>
> In Safari, the web inspector displays warning messages like these:
>
> Resource interpreted as stylesheet but transferred with MIME type text/
> html
> Resource interpreted as script but transferred with MIME type text/
> html
> Resource interpreted as image but transferred with MIME type text/html
>
> Is there a way to fix this?
>
> Annet.
--~--~-~--~~~---~--~~
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:23882] Re: Controlling lazy T

2009-06-11 Thread Carl

subject=str(T('Lazy subjects')) did it.

what's useful is that I can use subject=str(T(subject)) and bury this
statement inside my email() wrapper so that different calling code can
use (or not use) T appropriately.

This was an awkward gotcha for me. Any place that this could be
documented? Happy to add it if you point in the right direction.

C

On Jun 10, 10:50 pm, mdipierro  wrote:
> If you run the code locally (whithout GAE) and click on [admin]/
> [Languages]/[update languages] the string "Lazy subjects" will be
> added to the the language files.
>
> The problem may be that you need:
>
> subject=str(T('Lazy subjects'))
>
> Massimo
>
> On Jun 10, 3:27 pm, Carl  wrote:
>
>
>
> > I am using web2py on GAE.
>
> > I am sending emails using GAE. I'd delimited the subject line with T
> > ( ... ) and, you guessed it, GAE didn't like it at all.
>
> > How can I have the subject string translated *before* the call to
> > GAE's platform?
>
> > example code:
>
> > bSuccess = mail.send(to=to,subject=T('Lazy subjects'),message=message)
>
> > Carl
--~--~-~--~~~---~--~~
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:23883] Re: MIME type

2009-06-11 Thread annet

I do not know if it is a copy and paste error, but did not you forget
the closing  tag.




Kind regards,

Annet.



--~--~-~--~~~---~--~~
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:23884] Status of Appliance patches to work on GAE?

2009-06-11 Thread dlypka

There was  thread a few weeks ago where a developer said he was
working to update the Appliances to work on GAE.
For example, I know that TonyBlog needs a few lines changed to handle
the blob on GAE.

What is the status of the GAE patches?  Are the Appliances here
http://mdp.cti.depaul.edu/appliances recently updated for GAE?
It would be good to include the time of last update beside each file.
--~--~-~--~~~---~--~~
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:23885] Firefox

2009-06-11 Thread annet

While testing my application in Firefox I encountered the following
problem:

I have a master-detail view: the master displays a table, when the
user clicks the following link:



{{=A(club.bedrijf.bedrijfsnaam,_href="javascript:clublocatordetails
('%s')"\%URL(r=request,f='details',args=
[club.bedrijf.id]),_target="_blank")}}



... the details function is executed, and should be displayed in its
own window. In web2py_ajax.html I have:


function clublocatordetails(url) {
  clubdetailswindow=window.open(url,'name','height=384,width=600');
  if (window.focus) clubdetailswindow.focus();
  return false;
}


In Safari this works flawless, In Firefox the master view works,
however, when I click a link in the table a new browser window opens,
displaying an empty page, no URL, not resized, ...


Kind regards,

Annet.





--~--~-~--~~~---~--~~
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:23886] Re: Login_next

2009-06-11 Thread Fran

On Jun 11, 8:00 am, annet  wrote:
> No, the version in trunk that fixed my problem was r1016.

I suspect this is an SVN revno?
Bzr is currently on 909

Since Bzr is the master repo, I think it's best to quote those
revno's.

> I have something similar, just the other way around first the form
> then the table:
-CUT-
> Version r1016 did not break this functionality.

As Massimo pointed out, this only breaks with:
crud.settings.keepvalues=True

F
--~--~-~--~~~---~--~~
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:23887] Re: how to prevent deletion of referenced records

2009-06-11 Thread Fran

On Jun 11, 7:41 am, Joe  Barnhart  wrote:
> I don't think it is something you need to add to web2py.  This is
> really a workaround for sqlite because it doesn't respect the normal
> keywords of ON DELETE RESTRICT or CASCADE.  It's a simple enough work-
> around that is added to the model file for sqlite but not the other
> databases.

Why not add to the DAL just like has been done for SQLAlchemy?
http://code.google.com/p/sqlitefktg4sa/

This makes applications easier to move between DBs.

F
--~--~-~--~~~---~--~~
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:23888] Re: slides again

2009-06-11 Thread LordMax

Hi

On 9 Giu, 16:19, mdipierro  wrote:
> I will post keynote and ppt versions tonight.
>

Great.
Where?


--~--~-~--~~~---~--~~
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:23889] Re: new auth functions in trunk (basic, email/gmail, ldap)

2009-06-11 Thread mr.freeze

Almost perfect.  Line 705 in tools.py should be:
if not self in self.settings.login_methods:
instead of
if not self in login_methods:

All of the combinations work as advertised with the change above.
Thanks!!!  I will have a much easier time pushing web2py at work if we
can use our existing AD users.
Can you do the same thing to memberships now? :)


On Jun 11, 12:16 am, mdipierro  wrote:
> I did not receive your patch but if you now do:
>
>  auth.settings.login.methods=[ldap_login(..)]
>
> then it does not store password in db and always requres ldapauth.
> If you do:
>
>  auth.settings.login.methods=[ldap_login(..),auth]
>
> same as above but does store password in db.
> if you do
>
>  auth.settings.login.methods=[auth, ldap_login(..)]
>
> tries to login locally first, else tries ldap.
> Of course you can do
>
>  auth.settings.login.methods=[auth, ldap_login(...), email_login
> (...), basic_login(...)]
>
> and combinations thereof.
>
> Please give this a try.
>
> Massimo
>
> On Jun 10, 11:06 pm, "mr.freeze"  wrote:
>
>
>
> > I just sent you another (very simple) patch that forcesauthto use
> > the alternative login methods if present so, for example, LDAP will be
> > queried each time.
>
> > On Jun 9, 11:30 pm, mdipierro  wrote:
>
> > > Thanks!
>
> > > On Jun 9, 11:03 pm, "mr.freeze"  wrote:
>
> > > > Massimo, you should have a patch in email for active directory ldap
> > > >auth.  As noted in my email:
> > > > It works but we will also need to change tools.py so that it forces
> > > > ldap authentication each time, not just the first (maybe track the
> > > >authmethod in the db?).
> > > > Currently after the account is authenticated through ldap, the
> > > > credentials are stored in the db and ldap is never queried again.
>
> > > > Also, ideally the login form would be specific to the theauthtype so
> > > > ldap/active directory could include a domain name field.
> > > > Then we can tackle an LDAP membership provider!
>
> > > > On Jun 8, 11:52 pm, mdipierro  wrote:
>
> > > > > only mode='uid' is implemented. I could use help debugging/
> > > > > implementing the other modes
>
> > > > > Massimo
>
> > > > > On Jun 8, 10:38 pm, "mr.freeze"  wrote:
>
> > > > > > Sorry, I saw 'raise SyntaxError, "Not yet implemented"' under the 
> > > > > > 'ad'
> > > > > > and 'domino' if statements of ldap_auth_aux in ldap_auth.py and
> > > > > > thought you weren't done.   I tried it and it seems that if 
> > > > > > ad/ldapis
> > > > > > enabled that it will take any username with a blank password.
>
> > > > > > On Jun 8, 10:04 pm, mdipierro  wrote:
>
> > > > > > >ldapshould work already. Please test it.
>
> > > > > > > On Jun 8, 9:29 pm, "mr.freeze"  wrote:
>
> > > > > > > > Massimo, I can testldapagainst AD when it is finished.
>
> > > > > > > > On May 13, 12:01 am, mdipierro  wrote:
>
> > > > > > > > > Please try this
>
> > > > > > > > > 1) to authenticate with gmail
>
> > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > from gluon.contrib.login_methods.email_auth import email_auth
> > > > > > > > >auth.settings.login_methods.append(email_auth())
>
> > > > > > > > > 2) to authenticate using basic authentication of a third 
> > > > > > > > > party server
>
> > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > from gluon.contrib.login_methods.basic_auth import basic_auth
> > > > > > > > >auth.settings.login_methods.append(basic_auth('http://server'))
>
> > > > > > > > > 3) to authenticate usingLDAP server
>
> > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > from gluon.contrib.login_methods.ldap_auth import ldap_auth
> > > > > > > > >auth.settings.login_methods.append(ldap_auth(...))
>
> > > > > > > > > (requiresldaplibrary installed. look into gluon/contrib/
> > > > > > > > > login_methods/ldap_auth.py for ... options).
>
> > > > > > > > > Please let me know if this works for you.
>
> > > > > > > > > CAS client will be next- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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:23890] Re: how to prevent deletion of referenced records

2009-06-11 Thread Fran

On Jun 11, 7:49 am, annet  wrote:
> notnull=True, unique=True

I see that these provide DB-level protection of fields so always take
effect, but trigger tickets if violated
Validators provide nice user-friendly warnings instead of tickets, but
are only used if the application calls them (i.e. custom forms/
functions need to check explicitly)

Think this would be useful info to add to the docs:
http://web2py.com/examples/default/dal

> ondelete='RESTRICT'
> Isn't displaying a warning message just a matter of 'translating' this
> error ticket into a response.message or response.flash 'thing'?

Providing a wrapper to catch all DB violations sounds very nice :)

Alternatively, can we create a Validator to provide this?

F
--~--~-~--~~~---~--~~
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:23891] Re: Login_next

2009-06-11 Thread annet

Fran,

> I suspect this is an SVN revno?
> Bzr is currently on 909
>
> Since Bzr is the master repo, I think it's best to quote those
> revno's.

You are right, but ...

At this page: http://bazaar.launchpad.net/%7Emdipierro/web2py/devel/revision/897

How do I download the modified files and update web2py? At
http://code.google.com/p/web2py/source/detail?r=1016, I click the
affected file and on the next page I click view raw file, when it's
one file I save it as ... when it's an application it's automatically
downloaded and I unarchive it in the applications folder. I do not
know if this is the right way to proceed, but is works...


Kin regards,

Annet.
--~--~-~--~~~---~--~~
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:23893] Re: Custom Display Values

2009-06-11 Thread mdipierro

I am changing "form.begin" ot just "begin" as below:

{{=form.custom.begin}}
{{=form.custom.widget.field1}}
{{=form.custom.widget.field2}}
{{=form.custom.widget.field3}}
{{=form.custom.submit}}
{{=form.custom.end}}

On Jun 11, 12:29 am, Hans Donner  wrote:
> Nice,
>
> > 
>
> can be done with
> {{=form.custom.submit}}
>
> and if you want to add the delete? checkbox
> {{=form.custom.deletable}}
>
> On Thu, Jun 11, 2009 at 7:12 AM, mdipierro wrote:
>
> > done but it is now
>
> > {{=form.custom.form.begin}}
> > {{=form.custom.widget.field1}}
> > {{=form.custom.widget.field2}}
> > {{=form.custom.widget.field3}}
> > 
> > {{=form.custom.form.end}} includes hidden fields!
>
> > Massimo
>
> > On Jun 10, 11:27 pm, Hans Donner  wrote:
> >> > You only need widgets
>
> >> > 
> >> > {{=form.custom.widget.field1}}
> >> > {{=form.custom.widget.field2}}
> >> > {{=form.custom.widget.field3}}
> >> > 
> >> > {{=form.hidden_fields()}}
> >> > 
>
> >> better is to use {{=form.start}} in stead of , this will take
> >> over any actions/methods etc that are used in the SQLFORM,
> >> and for now {{=form.close}} and  are the same unless I can
> >> figure out how to include the {{=form.hidden_fields()}} properly in
> >> {{=form.close}}
--~--~-~--~~~---~--~~
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:23895] Re: Static files

2009-06-11 Thread mdipierro

this is fine

On Jun 11, 2:37 am, annet  wrote:
> In web2py I have 5 applications which make use of the same static
> files, at the moment each application has its own static files folder
> containing these files. I wonder whether it is possible to remove the
> static files the applications have in common from all applications but
> one and reference the static files in this application from the other
> applications?
>
> For example, have application core's static files folder contain the
> calendar.css, jquery.js and calendar.js files and reference them from
> application site's web2py_ajax file in the following way:
>
>  rel="stylesheet" type="text/css" media="screen" charset="utf-8" />
>  type="text/javascript">
>  type="text/javascript" charset="utf-8">
>
> Will this work, or am I overlooking something that will cause this to
> break. What about moving the static files the applications have in
> common to a location outside the applications? What would be the best
> location?
>
> Kind regards,
> Annet.
--~--~-~--~~~---~--~~
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:23894] Re: sqllite web2py gen question

2009-06-11 Thread mdipierro

I strongly suggest postgresql over mysql. They both work file mysql
has lots of quirks: max size of text fields, migrations need to be in
their own transaction, ... once in a while I find a new one.
Postgresql always does what one expect.

Massimo

On Jun 11, 1:30 am, Fran  wrote:
> On Jun 11, 6:42 am, durga  wrote:
>
> > I am developing a website with web2py and sqllite. I am expecting no.
> > of users of the site would increase to 50k. My question is  would the
> > sqllite in web2py  support for 50k users or I need to migrate to
> > mysql. The database would contain user information, messages and some
> > blogs.
>
> I would switch away from SQLite for that size of production use.
> MySQL should be fine :)
>
> F
--~--~-~--~~~---~--~~
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:23892] Re: Custom Display Values

2009-06-11 Thread Gary

Correction. {{=form.custom.labels[fieldname]}} did work in the trunk,
but the proper syntax is "label", not "labels".

Sorry for the misinformation.

On Jun 10, 9:58 pm, Gary  wrote:
> Massimo,
>
> Thank you.  You mentioned before that widget worked in the trunk - you
> are, of course correct, but I just wanted to make note to others that
> it fails in the current version 1.63.5.  Also, {{=form.custom.labels
> [fieldname]}} did not work in the trunk.  It failed with "TypeError:
> 'NoneType' object is unsubscriptable".  Just wanted you to know.
>
> Thanks again!
>
> On Jun 10, 5:59 pm, mdipierro  wrote:
>
> > On Jun 10, 3:49 pm, Gary  wrote:
>
> > > Massimo,
>
> > > Thank you so much for your feedback.  Most of the changes you
> > > suggested certainly made the code simpler and easier to read, but I
> > > have a couple of issues that I don't understand.
>
> > > 1) It appears that the line:
>
> > > getattr(crud,session.action)(db[tablename],record)
>
> > getattr(yyy,'xxx') is the same as yyy.xxx
>
> > > executes the crud call, but I don't understand how getattr() does
> > > that.  Could you provide a brief explanation?
>
> > > 2) If I directly return the dictionary that results from setsubmit
> > > (tablename), what would the format of the return be and what should
> > > the  variables in the form be named?  I tried a couple of combinations
> > > (widgets, inpval, dspval) , but they all failed (widget) carried extra
> > > data (impval) or failed to display an  on update.
>
> > You only need widgets
>
> > 
> > {{=form.custom.widget.field1}}
> > {{=form.custom.widget.field2}}
> > {{=form.custom.widget.field3}}
> > 
> > {{=form.hidden_fields()}}
> > 
>
> > > 3) In thefields(), the value of curform is:
>
> > >  > > id="location_poleno__row"> > > id="location_poleno__label">Poleno: EBW 1234 > > td> > > for="location_town_id" id="location_town_id__label">Town Id:  > > td>1 .
>
> > > and curform.record is:
>
> > >  > >  at 0x9ff80d4>, 'npolesize': None, 'notifydate':
> > > datetime.datetime(2009, 3, 27, 8, 9, 43), 'id': 2,
> > > 'specialprotection': None, 'city': 'East Brunswick', 'data1': None,
> > > 'zipcode': '08816', 'cableprovider': None, 'state': 'NJ', 'town_id':
> > > 1,  
>
> > > Please notice that in both places, the value of town_id is 1 and not
> > > the value in the related table.
>
> > > When I set mydict =  dict(form=curform) is was able to fix a syntax
> > > error 'mydict does not exist' but I'm not sure that's the right thing
> > > to do.  However, the real problem is an error message that says
> > > curform.custom.widget is not iterable.  Even if it fixes it, I'm still
> > > not sure what the variables in the form should be named.
>
> > I think you can do:
>
> > {{for fieldname in form.custom.widget:}}
> > {{=form.custom.labels[fieldname]}}{{=form.custom.widget
> > [fieldname]}}
> > {{pass}}
>
> > I do not think you need thefields since it only provides info that is
> > alredy in the form.
>
> > Not sure if this helps.
--~--~-~--~~~---~--~~
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:23896] Re: new auth functions in trunk (basic, email/gmail, ldap)

2009-06-11 Thread mdipierro

fixing!

On Jun 11, 6:58 am, "mr.freeze"  wrote:
> Almost perfect.  Line 705 in tools.py should be:
> if not self in self.settings.login_methods:
> instead of
> if not self in login_methods:
>
> All of the combinations work as advertised with the change above.
> Thanks!!!  I will have a much easier time pushing web2py at work if we
> can use our existing AD users.
> Can you do the same thing to memberships now? :)

what do you mean?

>
> On Jun 11, 12:16 am, mdipierro  wrote:
>
> > I did not receive your patch but if you now do:
>
> >  auth.settings.login.methods=[ldap_login(..)]
>
> > then it does not store password in db and always requres ldapauth.
> > If you do:
>
> >  auth.settings.login.methods=[ldap_login(..),auth]
>
> > same as above but does store password in db.
> > if you do
>
> >  auth.settings.login.methods=[auth, ldap_login(..)]
>
> > tries to login locally first, else tries ldap.
> > Of course you can do
>
> >  auth.settings.login.methods=[auth, ldap_login(...), email_login
> > (...), basic_login(...)]
>
> > and combinations thereof.
>
> > Please give this a try.
>
> > Massimo
>
> > On Jun 10, 11:06 pm, "mr.freeze"  wrote:
>
> > > I just sent you another (very simple) patch that forcesauthto use
> > > the alternative login methods if present so, for example, LDAP will be
> > > queried each time.
>
> > > On Jun 9, 11:30 pm, mdipierro  wrote:
>
> > > > Thanks!
>
> > > > On Jun 9, 11:03 pm, "mr.freeze"  wrote:
>
> > > > > Massimo, you should have a patch in email for active directory ldap
> > > > >auth.  As noted in my email:
> > > > > It works but we will also need to change tools.py so that it forces
> > > > > ldap authentication each time, not just the first (maybe track the
> > > > >authmethod in the db?).
> > > > > Currently after the account is authenticated through ldap, the
> > > > > credentials are stored in the db and ldap is never queried again.
>
> > > > > Also, ideally the login form would be specific to the theauthtype so
> > > > > ldap/active directory could include a domain name field.
> > > > > Then we can tackle an LDAP membership provider!
>
> > > > > On Jun 8, 11:52 pm, mdipierro  wrote:
>
> > > > > > only mode='uid' is implemented. I could use help debugging/
> > > > > > implementing the other modes
>
> > > > > > Massimo
>
> > > > > > On Jun 8, 10:38 pm, "mr.freeze"  wrote:
>
> > > > > > > Sorry, I saw 'raise SyntaxError, "Not yet implemented"' under the 
> > > > > > > 'ad'
> > > > > > > and 'domino' if statements of ldap_auth_aux in ldap_auth.py and
> > > > > > > thought you weren't done.   I tried it and it seems that if 
> > > > > > > ad/ldapis
> > > > > > > enabled that it will take any username with a blank password.
>
> > > > > > > On Jun 8, 10:04 pm, mdipierro  wrote:
>
> > > > > > > >ldapshould work already. Please test it.
>
> > > > > > > > On Jun 8, 9:29 pm, "mr.freeze"  wrote:
>
> > > > > > > > > Massimo, I can testldapagainst AD when it is finished.
>
> > > > > > > > > On May 13, 12:01 am, mdipierro  
> > > > > > > > > wrote:
>
> > > > > > > > > > Please try this
>
> > > > > > > > > > 1) to authenticate with gmail
>
> > > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > > from gluon.contrib.login_methods.email_auth import 
> > > > > > > > > > email_auth
> > > > > > > > > >auth.settings.login_methods.append(email_auth())
>
> > > > > > > > > > 2) to authenticate using basic authentication of a third 
> > > > > > > > > > party server
>
> > > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > > from gluon.contrib.login_methods.basic_auth import 
> > > > > > > > > > basic_auth
> > > > > > > > > >auth.settings.login_methods.append(basic_auth('http://server'))
>
> > > > > > > > > > 3) to authenticate usingLDAP server
>
> > > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > > from gluon.contrib.login_methods.ldap_auth import ldap_auth
> > > > > > > > > >auth.settings.login_methods.append(ldap_auth(...))
>
> > > > > > > > > > (requiresldaplibrary installed. look into gluon/contrib/
> > > > > > > > > > login_methods/ldap_auth.py for ... options).
>
> > > > > > > > > > Please let me know if this works for you.
>
> > > > > > > > > > CAS client will be next- Hide quoted text -
>
> > > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
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:23897] Re: how to prevent deletion of referenced records

2009-06-11 Thread annet

Fran,

> > notnull=True, unique=True
>
> I see that these provide DB-level protection of fields so always take
> effect, but trigger tickets if violated

That is what I thought, furthermore, I thought that by adding the
following validators:

db.provincie.provincie.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB
(db,'provincie.provincie',error_message=T('provincie already in
database'))]

... the notnull=True would be covered at web2py form level by the
IS_NOT_EMPTY() and the unique=True by the IS_NOT_IN_DB(..) validator.

Am I wrong?


Kind regards,

Annet.
--~--~-~--~~~---~--~~
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:23898] Re: new auth functions in trunk (basic, email/gmail, ldap)

2009-06-11 Thread mr.freeze

LDAP could be used to verify group membership too.  It would be cool
if we could do something similar to login_methods:
auth.settings.membership_providers = [ldap_membership(...), auth]

Not sure how tricky the implementation would be though...

On Jun 11, 7:37 am, mdipierro  wrote:
> fixing!
>
> On Jun 11, 6:58 am, "mr.freeze"  wrote:
>
> > Almost perfect.  Line 705 in tools.py should be:
> > if not self in self.settings.login_methods:
> > instead of
> > if not self in login_methods:
>
> > All of the combinations work as advertised with the change above.
> > Thanks!!!  I will have a much easier time pushing web2py at work if we
> > can use our existing AD users.
> > Can you do the same thing to memberships now? :)
>
> what do you mean?
>
>
>
> > On Jun 11, 12:16 am, mdipierro  wrote:
>
> > > I did not receive your patch but if you now do:
>
> > >  auth.settings.login.methods=[ldap_login(..)]
>
> > > then it does not store password in db and always requres ldapauth.
> > > If you do:
>
> > >  auth.settings.login.methods=[ldap_login(..),auth]
>
> > > same as above but does store password in db.
> > > if you do
>
> > >  auth.settings.login.methods=[auth, ldap_login(..)]
>
> > > tries to login locally first, else tries ldap.
> > > Of course you can do
>
> > >  auth.settings.login.methods=[auth, ldap_login(...), email_login
> > > (...), basic_login(...)]
>
> > > and combinations thereof.
>
> > > Please give this a try.
>
> > > Massimo
>
> > > On Jun 10, 11:06 pm, "mr.freeze"  wrote:
>
> > > > I just sent you another (very simple) patch that forcesauthto use
> > > > the alternative login methods if present so, for example, LDAP will be
> > > > queried each time.
>
> > > > On Jun 9, 11:30 pm, mdipierro  wrote:
>
> > > > > Thanks!
>
> > > > > On Jun 9, 11:03 pm, "mr.freeze"  wrote:
>
> > > > > > Massimo, you should have a patch in email for active directory ldap
> > > > > >auth.  As noted in my email:
> > > > > > It works but we will also need to change tools.py so that it forces
> > > > > > ldap authentication each time, not just the first (maybe track the
> > > > > >authmethod in the db?).
> > > > > > Currently after the account is authenticated through ldap, the
> > > > > > credentials are stored in the db and ldap is never queried again.
>
> > > > > > Also, ideally the login form would be specific to the theauthtype so
> > > > > > ldap/active directory could include a domain name field.
> > > > > > Then we can tackle an LDAP membership provider!
>
> > > > > > On Jun 8, 11:52 pm, mdipierro  wrote:
>
> > > > > > > only mode='uid' is implemented. I could use help debugging/
> > > > > > > implementing the other modes
>
> > > > > > > Massimo
>
> > > > > > > On Jun 8, 10:38 pm, "mr.freeze"  wrote:
>
> > > > > > > > Sorry, I saw 'raise SyntaxError, "Not yet implemented"' under 
> > > > > > > > the 'ad'
> > > > > > > > and 'domino' if statements of ldap_auth_aux in ldap_auth.py and
> > > > > > > > thought you weren't done.   I tried it and it seems that if 
> > > > > > > > ad/ldapis
> > > > > > > > enabled that it will take any username with a blank password.
>
> > > > > > > > On Jun 8, 10:04 pm, mdipierro  wrote:
>
> > > > > > > > >ldapshould work already. Please test it.
>
> > > > > > > > > On Jun 8, 9:29 pm, "mr.freeze"  wrote:
>
> > > > > > > > > > Massimo, I can testldapagainst AD when it is finished.
>
> > > > > > > > > > On May 13, 12:01 am, mdipierro  
> > > > > > > > > > wrote:
>
> > > > > > > > > > > Please try this
>
> > > > > > > > > > > 1) to authenticate with gmail
>
> > > > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > > > from gluon.contrib.login_methods.email_auth import 
> > > > > > > > > > > email_auth
> > > > > > > > > > >auth.settings.login_methods.append(email_auth())
>
> > > > > > > > > > > 2) to authenticate using basic authentication of a third 
> > > > > > > > > > > party server
>
> > > > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > > > from gluon.contrib.login_methods.basic_auth import 
> > > > > > > > > > > basic_auth
> > > > > > > > > > >auth.settings.login_methods.append(basic_auth('http://server'))
>
> > > > > > > > > > > 3) to authenticate usingLDAP server
>
> > > > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > > > from gluon.contrib.login_methods.ldap_auth import 
> > > > > > > > > > > ldap_auth
> > > > > > > > > > >auth.settings.login_methods.append(ldap_auth(...))
>
> > > > > > > > > > > (requiresldaplibrary installed. look into gluon/contrib/
> > > > > > > > > > > login_methods/ldap_auth.py for ... options).
>
> > > > > > > > > > > Please let me know if this works for you.
>
> > > > > > > > > > > CAS client will be next- Hide quoted text -
>
> > > > > > > - Show quoted text -- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to thi

[web2py:23899] YACI, or how to speed up model loading

2009-06-11 Thread AchipA

I was wondering of a possibility of speeding up models (especially if
you have several different datasources), while keeping backward
compatibility and also a convention over configuration approach. We do
everything as before, however, if there IS a model with the same base
name as a controller, upon the invocation of the controller we only
execute THAT model (it can import others with a small check to avoid
recursion). This would be not unlike what we do with views now (check
for a default naming convention, fall back to generic if that fails).
Thoughts, comments ?

--~--~-~--~~~---~--~~
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:23900] Re: how to prevent deletion of referenced records

2009-06-11 Thread Fran

On Jun 11, 1:47 pm, annet  wrote:
> I thought that by adding the
> following validators:
> db.provincie.provincie.requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB
> (db,'provincie.provincie',error_message=T('provincie already in
> database'))]
> ... the notnull=True would be covered at web2py form level by the
> IS_NOT_EMPTY() and the unique=True by the IS_NOT_IN_DB(..) validator.

These work for SQLFORM & crud.
However they won't work for some custom forms/functions.

F
--~--~-~--~~~---~--~~
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:23901] Re: Firefox

2009-06-11 Thread JohnMc

change clubdetailswindow -> var clubdetailswindow unless you really
are looking for a global clubdetailswindow.

in order --

try your caller without the _target="_blank".

have you tried using  _onclick=" " rather than _href to trigger
clublocatordetails()?

last you might put a alert(url); as the first statement in
clubdetailswindow() just to see if the url is properly formed on
receipt by the function. (probably is correct.)

On Jun 11, 4:32 am, annet  wrote:
> While testing my application in Firefox I encountered the following
> problem:
>
> I have a master-detail view: the master displays a table, when the
> user clicks the following link:
>
> 
> {{=A(club.bedrijf.bedrijfsnaam,_href="javascript:clublocatordetails
> ('%s')"\%URL(r=request,f='details',args=
> [club.bedrijf.id]),_target="_blank")}}
> 
>
> ... the details function is executed, and should be displayed in its
> own window. In web2py_ajax.html I have:
>
> function clublocatordetails(url) {
>   clubdetailswindow=window.open(url,'name','height=384,width=600');
>   if (window.focus) clubdetailswindow.focus();
>   return false;
>
> }
>
> In Safari this works flawless, In Firefox the master view works,
> however, when I click a link in the table a new browser window opens,
> displaying an empty page, no URL, not resized, ...
>
> Kind regards,
>
> Annet.
--~--~-~--~~~---~--~~
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:23902] not authorized is 401, not 400

2009-06-11 Thread Alexey Nezhdanov
Hello.

It is more proper to use 401 status code than 400 for 'not authorized' case.

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2

-- 
Sincerely yours
Alexey Nezhdanov

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

--- tools.py	2009-06-11 17:10:31.216533525 +0400
+++ tools.401.py	2009-06-11 17:10:41.856530678 +0400
@@ -1136,17 +1136,17 @@
 session = self.environment.session
 auth = session.auth
 if not self.is_logged_in():
-raise HTTP(400, "Not Authorized")
+raise HTTP(401, "Not Authorized")
 if user_id == DEFAULT and self.environment.request.args:
 user_id = self.environment.request.args[1]
 if user_id and user_id != self.user.id and user_id != '0':
 if not self.has_permission('impersonate',
self.settings.table_user_name,
user_id):
-raise HTTP(400, "Not Authorized")
+raise HTTP(401, "Not Authorized")
 user = self.settings.table_user[request.args[1]]
 if not user:
-raise HTTP(400, "Not Authorized")
+raise HTTP(401, "Not Authorized")
 auth.impersonator = cPickle.dumps(session)
 auth.user.update(self.settings.table_user._filter_fields(user, True))
 self.user = auth.user
@@ -2032,7 +2032,7 @@
 
 request = self.environment['request']
 if len(request.args) < 1:
-raise HTTP(400, "Not Authorized")
+raise HTTP(401, "Not Authorized")
 arg0 = request.args[0]
 if arg0 == 'run':
 return self.serve_run(request.args[1:])


[web2py:23903] Re: not authorized is 401, not 400

2009-06-11 Thread Alexey Nezhdanov
:( I had to read code closer. There are actually three different keys so three 
different codes required. Modified patch attached.

On Thursday 11 June 2009 17:15:23 Alexey Nezhdanov wrote:
> Hello.
>
> It is more proper to use 401 status code than 400 for 'not authorized'
> case.
>
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2



-- 
Sincerely yours
Alexey Nezhdanov

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

--- tools.py	2009-06-11 17:10:31.216533525 +0400
+++ tools.401.py	2009-06-11 17:16:54.300531107 +0400
@@ -1136,17 +1136,17 @@
 session = self.environment.session
 auth = session.auth
 if not self.is_logged_in():
-raise HTTP(400, "Not Authorized")
+raise HTTP(401, "Not Authorized")
 if user_id == DEFAULT and self.environment.request.args:
 user_id = self.environment.request.args[1]
 if user_id and user_id != self.user.id and user_id != '0':
 if not self.has_permission('impersonate',
self.settings.table_user_name,
user_id):
-raise HTTP(400, "Not Authorized")
+raise HTTP(403, "Forbidden")
 user = self.settings.table_user[request.args[1]]
 if not user:
-raise HTTP(400, "Not Authorized")
+raise HTTP(401, "Not Authorized")
 auth.impersonator = cPickle.dumps(session)
 auth.user.update(self.settings.table_user._filter_fields(user, True))
 self.user = auth.user
@@ -2032,7 +2032,7 @@
 
 request = self.environment['request']
 if len(request.args) < 1:
-raise HTTP(400, "Not Authorized")
+raise HTTP(400, "Bad request")
 arg0 = request.args[0]
 if arg0 == 'run':
 return self.serve_run(request.args[1:])


[web2py:23904] Re: slides in keynote and ppt

2009-06-11 Thread A. C. Censi

keynote is available

ppt returns 'invalid request'

ACC

On Wed, Jun 10, 2009 at 5:57 PM, Fran wrote:
>
> On Jun 10, 8:12 pm, mdipierro  wrote:
>> I posted the slides in Keynote format
>> http://www.web2py.com/examples/static/cookbook2.key.zip
>
> Works, but I don't have a Mac
>
>> and PowerPoint format
>> http://www.web2py.com/examples/static/cookbook2.ppt.zip
>
> 'Invalid request'
>
> F
> >
>



-- 
A. C. Censi
accensi [em] gmail [ponto] com
accensi [em] montreal [ponto] com [ponto] br

--~--~-~--~~~---~--~~
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:23905] Re: slides in keynote and ppt

2009-06-11 Thread mdipierro

please try again

On Jun 11, 8:20 am, "A. C. Censi"  wrote:
> keynote is available
>
> ppt returns 'invalid request'
>
> ACC
>
>
>
> On Wed, Jun 10, 2009 at 5:57 PM, Fran wrote:
>
> > On Jun 10, 8:12 pm, mdipierro  wrote:
> >> I posted the slides in Keynote format
> >>http://www.web2py.com/examples/static/cookbook2.key.zip
>
> > Works, but I don't have a Mac
>
> >> and PowerPoint format
> >>http://www.web2py.com/examples/static/cookbook2.ppt.zip
>
> > 'Invalid request'
>
> > F
>
> --
> A. C. Censi
> accensi [em] gmail [ponto] com
> accensi [em] montreal [ponto] com [ponto] br
--~--~-~--~~~---~--~~
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:23906] Re: YACI, or how to speed up model loading

2009-06-11 Thread mdipierro

You can add "if" statememts in models

On Jun 11, 8:03 am, AchipA  wrote:
> I was wondering of a possibility of speeding up models (especially if
> you have several different datasources), while keeping backward
> compatibility and also a convention over configuration approach. We do
> everything as before, however, if there IS a model with the same base
> name as a controller, upon the invocation of the controller we only
> execute THAT model (it can import others with a small check to avoid
> recursion). This would be not unlike what we do with views now (check
> for a default naming convention, fall back to generic if that fails).
> Thoughts, comments ?
--~--~-~--~~~---~--~~
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:23907] Re: new auth functions in trunk (basic, email/gmail, ldap)

2009-06-11 Thread mdipierro

Not sure the web2py groups should be the same as the ldap groups.

On Jun 11, 7:50 am, "mr.freeze"  wrote:
> LDAP could be used to verify group membership too.  It would be cool
> if we could do something similar to login_methods:
> auth.settings.membership_providers = [ldap_membership(...), auth]
>
> Not sure how tricky the implementation would be though...
>
> On Jun 11, 7:37 am, mdipierro  wrote:
>
> > fixing!
>
> > On Jun 11, 6:58 am, "mr.freeze"  wrote:
>
> > > Almost perfect.  Line 705 in tools.py should be:
> > > if not self in self.settings.login_methods:
> > > instead of
> > > if not self in login_methods:
>
> > > All of the combinations work as advertised with the change above.
> > > Thanks!!!  I will have a much easier time pushing web2py at work if we
> > > can use our existing AD users.
> > > Can you do the same thing to memberships now? :)
>
> > what do you mean?
>
> > > On Jun 11, 12:16 am, mdipierro  wrote:
>
> > > > I did not receive your patch but if you now do:
>
> > > >  auth.settings.login.methods=[ldap_login(..)]
>
> > > > then it does not store password in db and always requres ldapauth.
> > > > If you do:
>
> > > >  auth.settings.login.methods=[ldap_login(..),auth]
>
> > > > same as above but does store password in db.
> > > > if you do
>
> > > >  auth.settings.login.methods=[auth, ldap_login(..)]
>
> > > > tries to login locally first, else tries ldap.
> > > > Of course you can do
>
> > > >  auth.settings.login.methods=[auth, ldap_login(...), email_login
> > > > (...), basic_login(...)]
>
> > > > and combinations thereof.
>
> > > > Please give this a try.
>
> > > > Massimo
>
> > > > On Jun 10, 11:06 pm, "mr.freeze"  wrote:
>
> > > > > I just sent you another (very simple) patch that forcesauthto use
> > > > > the alternative login methods if present so, for example, LDAP will be
> > > > > queried each time.
>
> > > > > On Jun 9, 11:30 pm, mdipierro  wrote:
>
> > > > > > Thanks!
>
> > > > > > On Jun 9, 11:03 pm, "mr.freeze"  wrote:
>
> > > > > > > Massimo, you should have a patch in email for active directory 
> > > > > > > ldap
> > > > > > >auth.  As noted in my email:
> > > > > > > It works but we will also need to change tools.py so that it 
> > > > > > > forces
> > > > > > > ldap authentication each time, not just the first (maybe track the
> > > > > > >authmethod in the db?).
> > > > > > > Currently after the account is authenticated through ldap, the
> > > > > > > credentials are stored in the db and ldap is never queried again.
>
> > > > > > > Also, ideally the login form would be specific to the theauthtype 
> > > > > > > so
> > > > > > > ldap/active directory could include a domain name field.
> > > > > > > Then we can tackle an LDAP membership provider!
>
> > > > > > > On Jun 8, 11:52 pm, mdipierro  wrote:
>
> > > > > > > > only mode='uid' is implemented. I could use help debugging/
> > > > > > > > implementing the other modes
>
> > > > > > > > Massimo
>
> > > > > > > > On Jun 8, 10:38 pm, "mr.freeze"  wrote:
>
> > > > > > > > > Sorry, I saw 'raise SyntaxError, "Not yet implemented"' under 
> > > > > > > > > the 'ad'
> > > > > > > > > and 'domino' if statements of ldap_auth_aux in ldap_auth.py 
> > > > > > > > > and
> > > > > > > > > thought you weren't done.   I tried it and it seems that if 
> > > > > > > > > ad/ldapis
> > > > > > > > > enabled that it will take any username with a blank password.
>
> > > > > > > > > On Jun 8, 10:04 pm, mdipierro  wrote:
>
> > > > > > > > > >ldapshould work already. Please test it.
>
> > > > > > > > > > On Jun 8, 9:29 pm, "mr.freeze"  wrote:
>
> > > > > > > > > > > Massimo, I can testldapagainst AD when it is finished.
>
> > > > > > > > > > > On May 13, 12:01 am, mdipierro  
> > > > > > > > > > > wrote:
>
> > > > > > > > > > > > Please try this
>
> > > > > > > > > > > > 1) to authenticate with gmail
>
> > > > > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > > > > from gluon.contrib.login_methods.email_auth import 
> > > > > > > > > > > > email_auth
> > > > > > > > > > > >auth.settings.login_methods.append(email_auth())
>
> > > > > > > > > > > > 2) to authenticate using basic authentication of a 
> > > > > > > > > > > > third party server
>
> > > > > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > > > > from gluon.contrib.login_methods.basic_auth import 
> > > > > > > > > > > > basic_auth
> > > > > > > > > > > >auth.settings.login_methods.append(basic_auth('http://server'))
>
> > > > > > > > > > > > 3) to authenticate usingLDAP server
>
> > > > > > > > > > > >auth=Auth(globals(),db)
> > > > > > > > > > > > from gluon.contrib.login_methods.ldap_auth import 
> > > > > > > > > > > > ldap_auth
> > > > > > > > > > > >auth.settings.login_methods.append(ldap_auth(...))
>
> > > > > > > > > > > > (requiresldaplibrary installed. look into gluon/contrib/
> > > > > > > > > > > > login_methods/ldap_auth.py for ... options).
>
> > > > > > > > > > > > Please let me know if this works for you.
>
> > > > > > > > > > > > CAS client will

[web2py:23908] Re: Firefox

2009-06-11 Thread annet

Thanks for your reply.

I changed the view to read like:


 {{=A
(club.bedrijf.bedrijfsnaam,_href="javascript:clublocatordetails('%s')"
 %URL(r=request,f='details',args=[club.bedrijf.id]))}}


... so, the caller without _target='blank'.


I changed the function in _ajax.html to read like:

function clublocatordetails(url) {
  var clubdetailswindow=window.open
(url,'_blank','toolbar=no,menubar=no,scrollbars=no,resizable=no,width=600,height=384');
  if (window.focus) clubdetailswindow.focus();
}

.. so, I added '_blank' and removed the 'return false';


I do not know why I had to remove 'return false', I got the
information from: 
http://www.w3schools.com/js/tryit.asp?filename=tryjs_openallwindow


Kind regards,

Annet.


--~--~-~--~~~---~--~~
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:23909] Re: how to prevent deletion of referenced records

2009-06-11 Thread annet

Fran,

You are right, I had a look at my code, in a custom form I have:


form=form_factory(SQLField('plaats',requires=IS_NOT_EMPTY(),\
widget=lambda self, value:INPUT
(_type='text',_id='clubbyplace',_class='ac_input',_name='plaats',requires=self.requires)))


This prevents the field from being empty but it does not prevent the
user from adding a duplicate value.



Annet.
--~--~-~--~~~---~--~~
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:23910] Re: slides in keynote and ppt

2009-06-11 Thread A. C. Censi

Downloading now!

Thanks

ACC

On Thu, Jun 11, 2009 at 10:25 AM, mdipierro wrote:
>
> please try again
>
> On Jun 11, 8:20 am, "A. C. Censi"  wrote:
>> keynote is available
>>
>> ppt returns 'invalid request'
>>
>> ACC
>>
>>
>>
>> On Wed, Jun 10, 2009 at 5:57 PM, Fran wrote:
>>
>> > On Jun 10, 8:12 pm, mdipierro  wrote:
>> >> I posted the slides in Keynote format
>> >>http://www.web2py.com/examples/static/cookbook2.key.zip
>>
>> > Works, but I don't have a Mac
>>
>> >> and PowerPoint format
>> >>http://www.web2py.com/examples/static/cookbook2.ppt.zip
>>
>> > 'Invalid request'
>>
>> > F
>>
>> --
>> A. C. Censi
>> accensi [em] gmail [ponto] com
>> accensi [em] montreal [ponto] com [ponto] br
> >
>



-- 
A. C. Censi
accensi [em] gmail [ponto] com
accensi [em] montreal [ponto] com [ponto] br

--~--~-~--~~~---~--~~
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:23911] Re: Login_next

2009-06-11 Thread annet

Fran,

> I suspect this is an SVN revno?
> Bzr is currently on 909
> Since Bzr is the master repo, I think it's best to quote those
> revno's.


You are right, but ...

At this page: http://bazaar.launchpad.net/%7Emdipierro/web2py/devel/revision/897

How do I download the modified files and update web2py?

At http://code.google.com/p/web2py/source/detail?r=1016, I click the
affected file and on the next page I click view raw file, when it's
one file I save it as ... when it's an application it's automatically
downloaded and I unarchive it in the applications folder. I do not
know if this is the right way to proceed, but is works...


Kind regards,

Annet.
--~--~-~--~~~---~--~~
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:23912] Re: Firefox

2009-06-11 Thread JohnMc

Annet,

Don't discount the need for the 'return false;' If you ever get a
complaint from an IE6 customer, that !...@##$!@ browser does not handle
javascript closures as it should. That statement was the work around.

question is, does it work now?

On Jun 11, 8:29 am, annet  wrote:
> Thanks for your reply.
>
> I changed the view to read like:
>
> 
>      {{=A
> (club.bedrijf.bedrijfsnaam,_href="javascript:clublocatordetails('%s')"
>      %URL(r=request,f='details',args=[club.bedrijf.id]))}}
> 
> 
--~--~-~--~~~---~--~~
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:23913] Re: slides in keynote and ppt

2009-06-11 Thread LordMax

Hi

> >> > On Jun 10, 8:12 pm, mdipierro  wrote:
> >> >> I posted the slides in Keynote format
> >> >>http://www.web2py.com/examples/static/cookbook2.key.zip
>

Great.

Really thanks

--~--~-~--~~~---~--~~
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:23914] Re: Firefox

2009-06-11 Thread annet

John,

It does work in Safari 4 and Firefox, I have not yet been able to test
it in IE or Opera.


> Don't discount the need for the 'return false;' If you ever get a
> complaint from an IE6 customer, that !...@##$!@ browser does not handle
> javascript closures as it should. That statement was the work around.


I put the return false back to were it was, and it still works in
Safari and Firefox. So, as a reference this:

http://www.w3schools.com/js/tryit.asp?filename=tryjs_openallwindow

is not a indicative.


Thanks for pointing this out to me.


Annet.
--~--~-~--~~~---~--~~
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:23915] Re: YACI, or how to speed up model loading

2009-06-11 Thread AchipA

I could say the same for views (why are we bothering to define views
by filename/convention then ?). Littering the models with if-s won't
make them pretty, newbie friendly nor as quick as they could be.

On Jun 11, 3:28 pm, mdipierro  wrote:
> You can add "if" statememts in models
>
> On Jun 11, 8:03 am, AchipA  wrote:
>
> > I was wondering of a possibility of speeding up models (especially if
> > you have several different datasources), while keeping backward
> > compatibility and also a convention over configuration approach. We do
> > everything as before, however, if there IS a model with the same base
> > name as a controller, upon the invocation of the controller we only
> > execute THAT model (it can import others with a small check to avoid
> > recursion). This would be not unlike what we do with views now (check
> > for a default naming convention, fall back to generic if that fails).
> > Thoughts, comments ?
--~--~-~--~~~---~--~~
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:23916] Re: sqllite web2py gen question

2009-06-11 Thread JohnMc

Might want to keep our eyes on this DB -- 
http://askmonty.org/wiki/index.php/MariaDB.
They have not provided a stable release yet. But with the merger of
Oracle and Sun you never know what might happen to the MySQL DB.

On Jun 11, 7:33 am, mdipierro  wrote:
> I strongly suggest postgresql over mysql. They both work file mysql
> has lots of quirks: max size of text fields, migrations need to be in
> their own transaction, ... once in a while I find a new one.
> Postgresql always does what one expect.
>
> Massimo
>
> On Jun 11, 1:30 am, Fran  wrote:
>
> > On Jun 11, 6:42 am, durga  wrote:
>
> > > I am developing a website with web2py and sqllite. I am expecting no.
> > > of users of the site would increase to 50k. My question is  would the
> > > sqllite in web2py  support for 50k users or I need to migrate to
> > > mysql. The database would contain user information, messages and some
> > > blogs.
>
> > I would switch away from SQLite for that size of production use.
> > MySQL should be fine :)
>
> > F
--~--~-~--~~~---~--~~
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:23917] Re: sqllite web2py gen question

2009-06-11 Thread AchipA

It would be surprising if mysql would manage to keep it's position -
from what most blogs/news said, it seems most of the core mysql
developers have jumped ship.

On Jun 11, 4:23 pm, JohnMc  wrote:
> Might want to keep our eyes on this DB 
> --http://askmonty.org/wiki/index.php/MariaDB.
> They have not provided a stable release yet. But with the merger of
> Oracle and Sun you never know what might happen to the MySQL DB.
>
> On Jun 11, 7:33 am, mdipierro  wrote:
>
> > I strongly suggest postgresql over mysql. They both work file mysql
> > has lots of quirks: max size of text fields, migrations need to be in
> > their own transaction, ... once in a while I find a new one.
> > Postgresql always does what one expect.
>
> > Massimo
>
> > On Jun 11, 1:30 am, Fran  wrote:
>
> > > On Jun 11, 6:42 am, durga  wrote:
>
> > > > I am developing a website with web2py and sqllite. I am expecting no.
> > > > of users of the site would increase to 50k. My question is  would the
> > > > sqllite in web2py  support for 50k users or I need to migrate to
> > > > mysql. The database would contain user information, messages and some
> > > > blogs.
>
> > > I would switch away from SQLite for that size of production use.
> > > MySQL should be fine :)
>
> > > F
--~--~-~--~~~---~--~~
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:23918] editing static files from user pages?

2009-06-11 Thread Tim Michelsen

Hello,
is there any app or controller out there that lets me edit text files 
saved in the static direcory?

I am looking for a functionality just like we have in admin.

I want to achieve:
1) user logs in
2) sees a list of files in a pre-defined directory from static
3) user selects the file and edits it
4) changes get written to the file
5) user logs out

I know I could simply replicate parts of the appadmin to the frontend.
But maybe someone has already done such a thing...

Kind regards,
Timmie


--~--~-~--~~~---~--~~
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:23919] Global persisten service in web2py core

2009-06-11 Thread YangHong

Hi, Mdipierro and all

I have a application run as a daemon, which provides remote controll
function via socket, I use web2py as web app frame work, and I want to
define a Session/Request/Respose like global object in web2py, call it
MyManager, then I can access it's method to controll my real
application in controller in the web2py. for example:

controller/default.py:

def index():
   if (reponse.vars['ticket']):
  MyManager.addTickes ()

Is this possible? and where I can get start to add such a global var
for it?

First I guess cron(contrib/cron.py) func is a global service, but it's
not access able from conrtoller.

Then I've read some part of golun/globals.py, main.py, but I'm not
sure if it's a right start point.

Any comments will be appreciated.
Pengu1n
--~--~-~--~~~---~--~~
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:23920] Re: not authorized is 401, not 400

2009-06-11 Thread mdipierro

Thanks Alexey, in trunk!

On Jun 11, 8:18 am, Alexey Nezhdanov  wrote:
> :( I had to read code closer. There are actually three different keys so three
> different codes required. Modified patch attached.
>
> On Thursday 11 June 2009 17:15:23 Alexey Nezhdanov wrote:
>
> > Hello.
>
> > It is more proper to use 401 status code than 400 for 'not authorized'
> > case.
>
> >http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2
>
> --
> Sincerely yours
> Alexey Nezhdanov
>
>  auth_status_code_fix.diff
> 1KViewDownload
--~--~-~--~~~---~--~~
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:23921] Re: Global persisten service in web2py core

2009-06-11 Thread YangHong



On 6月11日, 下午10时58分, YangHong  wrote:
> Hi, Mdipierro and all
>
> I have a application run as a daemon, which provides remote controll
> function via socket, I use web2py as web app frame work, and I want to
> define a Session/Request/Respose like global object in web2py, call it
> MyManager, then I can access it's method to controll my real
> application in controller in the web2py. for example:
>
> controller/default.py:
>
> def index():
>if (reponse.vars['ticket']):
>   MyManager.addTickes ()
>

Why I think this is usefull and worth to do is because I don't want
initiate a new MyManager every time I wan access it in controllers,
that cause connect/disconnect to frequntly and delay for web user
experience.

> Is this possible? and where I can get start to add such a global var
> for it?
>
> First I guess cron(contrib/cron.py) func is a global service, but it's
> not access able from conrtoller.
>
> Then I've read some part of golun/globals.py, main.py, but I'm not
> sure if it's a right start point.

I run web2py in mod_wsgi, so I guess it's possible to create a gobal
app (or something like)  instance to communicate with my independ app
daemon. am I right?

>
> Any comments will be appreciated.
> Pengu1n
--~--~-~--~~~---~--~~
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:23922] Re: YACI, or how to speed up model loading

2009-06-11 Thread mdipierro

If you need code that is only executed for a specific controller, why
not put it directly in the controller?

Massimo

On Jun 11, 9:19 am, AchipA  wrote:
> I could say the same for views (why are we bothering to define views
> by filename/convention then ?). Littering the models with if-s won't
> make them pretty, newbie friendly nor as quick as they could be.
>
> On Jun 11, 3:28 pm, mdipierro  wrote:
>
> > You can add "if" statememts in models
>
> > On Jun 11, 8:03 am, AchipA  wrote:
>
> > > I was wondering of a possibility of speeding up models (especially if
> > > you have several different datasources), while keeping backward
> > > compatibility and also a convention over configuration approach. We do
> > > everything as before, however, if there IS a model with the same base
> > > name as a controller, upon the invocation of the controller we only
> > > execute THAT model (it can import others with a small check to avoid
> > > recursion). This would be not unlike what we do with views now (check
> > > for a default naming convention, fall back to generic if that fails).
> > > Thoughts, comments ?
--~--~-~--~~~---~--~~
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:23923] Re: editing static files from user pages?

2009-06-11 Thread mdipierro

You can copy the controller from admin/controllers/edit

On Jun 11, 9:44 am, Tim Michelsen  wrote:
> Hello,
> is there any app or controller out there that lets me edit text files
> saved in the static direcory?
>
> I am looking for a functionality just like we have in admin.
>
> I want to achieve:
> 1) user logs in
> 2) sees a list of files in a pre-defined directory from static
> 3) user selects the file and edits it
> 4) changes get written to the file
> 5) user logs out
>
> I know I could simply replicate parts of the appadmin to the frontend.
> But maybe someone has already done such a thing...
>
> Kind regards,
> Timmie
--~--~-~--~~~---~--~~
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:23924] Re: Global persisten service in web2py core

2009-06-11 Thread mdipierro

Yes but how very much depends on what you want to do. You deamon can
have an xmlrpc server (general way) or you can implement a database
based queue of tasks.

You should also look into cron.

Massimo

On Jun 11, 10:06 am, YangHong  wrote:
> On 6月11日, 下午10时58分, YangHong  wrote:
>
> > Hi, Mdipierro and all
>
> > I have a application run as a daemon, which provides remote controll
> > function via socket, I use web2py as web app frame work, and I want to
> > define a Session/Request/Respose like global object in web2py, call it
> > MyManager, then I can access it's method to controll my real
> > application in controller in the web2py. for example:
>
> > controller/default.py:
>
> > def index():
> >if (reponse.vars['ticket']):
> >   MyManager.addTickes ()
>
> Why I think this is usefull and worth to do is because I don't want
> initiate a new MyManager every time I wan access it in controllers,
> that cause connect/disconnect to frequntly and delay for web user
> experience.
>
> > Is this possible? and where I can get start to add such a global var
> > for it?
>
> > First I guess cron(contrib/cron.py) func is a global service, but it's
> > not access able from conrtoller.
>
> > Then I've read some part of golun/globals.py, main.py, but I'm not
> > sure if it's a right start point.
>
> I run web2py in mod_wsgi, so I guess it's possible to create a gobal
> app (or something like)  instance to communicate with my independ app
> daemon. am I right?
>
>
>
> > Any comments will be appreciated.
> > Pengu1n
--~--~-~--~~~---~--~~
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:23925] web2py 1.64.0 posted

2009-06-11 Thread mdipierro

Please check it out!

- Models are much faster ~ 2.5x times (thanks Alexey)
- fully works on Jython without tweaks (sqlite and postgresql with
zxjdbc)
- custom forms and better error codes (thanks Hans)
- better LDAP support (thanks Fran and Mr. Freeze)

Massimo
--~--~-~--~~~---~--~~
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:23926] Re: web2py 1.64.0 posted

2009-06-11 Thread Jason Brower

+1 on the Jython support!  That will open a lot of doors at my work.
Thanks!
Regards,
Jason Brower


On Thu, 2009-06-11 at 08:27 -0700, mdipierro wrote:
> Please check it out!
> 
> - Models are much faster ~ 2.5x times (thanks Alexey)
> - fully works on Jython without tweaks (sqlite and postgresql with
> zxjdbc)
> - custom forms and better error codes (thanks Hans)
> - better LDAP support (thanks Fran and Mr. Freeze)
> 
> Massimo
> > 


--~--~-~--~~~---~--~~
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:23927] Re: web2py 1.64.0 posted

2009-06-11 Thread mdipierro

jason, I made a war file. Can you run some tests?

Massimo

On Jun 11, 10:32 am, Jason Brower  wrote:
> +1 on the Jython support!  That will open a lot of doors at my work.
> Thanks!
> Regards,
> Jason Brower
>
> On Thu, 2009-06-11 at 08:27 -0700, mdipierro wrote:
> > Please check it out!
>
> > - Models are much faster ~ 2.5x times (thanks Alexey)
> > - fully works on Jython without tweaks (sqlite and postgresql with
> > zxjdbc)
> > - custom forms and better error codes (thanks Hans)
> > - better LDAP support (thanks Fran and Mr. Freeze)
>
> > Massimo
--~--~-~--~~~---~--~~
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:23928] Re: web2py 1.64.0 posted

2009-06-11 Thread Hans Donner

Error codes are from our performance man!

On Thu, Jun 11, 2009 at 5:27 PM, mdipierro wrote:
>
> Please check it out!
>
> - Models are much faster ~ 2.5x times (thanks Alexey)
> - fully works on Jython without tweaks (sqlite and postgresql with
> zxjdbc)
> - custom forms and better error codes (thanks Hans)
> - better LDAP support (thanks Fran and Mr. Freeze)
>
> Massimo
> >
>

--~--~-~--~~~---~--~~
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:23929] auth email verification in trunk

2009-06-11 Thread mr.freeze

Even after a user's email is verified and they get the 'Email
Verified' in response.flash, I get 'Registration needs verification'
when trying to log in as that user.  What am I doing wrong?  Here's my
auth settings in db.py:

from gluon.tools import *
auth=Auth(globals(),db)# authentication/authorization
auth.define_tables()   # creates all needed tables
crud=Crud(globals(),db)# for CRUD helpers using auth
service=Service(globals()) # for json, xml, jsonrpc, xmlrpc,
amfrpc

## uncomment as necessary or consult docs for more options
crud.settings.auth=auth   # (optional) enforces authorization
on crud
mail=Mail()  # mailer
mail.settings.server='localhost:25'# your SMTP server
mail.settings.sender='xx...@x.com' # your email
mail.settings.login='x:x'  # your credentials
auth.settings.mailer=mail # for user email verification
auth.settings.registration_requires_verification = True
#auth.settings.registration_requires_approval = False
auth.messages.verify_email = \
  'Click on the link 
http://localhost:8000/authtest/default/user/verify_email/%(key)s
to verify your email'
--~--~-~--~~~---~--~~
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:23930] error on GAE deployment

2009-06-11 Thread Tim Michelsen

Hello,
wanted to try GAE deployment as shown in
http://www.screencast.com/users/mdipierro/folders/Jing/media/b3de44de-814b-48fa-ba91-edd283597d8b

I found a number of glitches:
1) not really documented how to do this quickly!
2) I found out that I need to have appcfg.py. Unfortunately, it's 
absolute path is hardcoded into
applications/admin/models/0.py
Why do you not use web2py root directory as default?

Actually, you start to hit the walls of the zero-config paradigm...
I'd like to support the idea of a comon static direcory which could also 
be the default place for tthe appcfg.py
Any other place could easily changed by symlinks...

3) I put it into
/var/devel/web2py/web2py_gae/appcfg.py

4) when hitting deploy in admin I got this:

Traceback (most recent call last):
   File "/var/devel/web2py/web2py_gae/gluon/restricted.py", line 107, in 
restricted
 exec ccode in environment
   File 
"/var/devel/web2py/web2py_gae/applications/admin/controllers/gae.py", 
line 78, in 
   File "/var/devel/web2py/web2py_gae/gluon/globals.py", line 100, in 

 self._caller = lambda f: f()
   File 
"/var/devel/web2py/web2py_gae/applications/admin/controllers/gae.py", 
line 25, in deploy
 apps = sorted([(file.upper(), file) for file in os.listdir(apath())
   File "/var/devel/web2py/web2py_gae/gluon/admin.py", line 11, in apath
 opath = up(r.folder)
AttributeError: 'NoneType' object has no attribute 'folder'

Please assist me.

Thanks and kind regards,
Timmie


--~--~-~--~~~---~--~~
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:23931] Re: web2py 1.64.0 posted

2009-06-11 Thread mdipierro

Ouch! I apologize to Alexey.

On Jun 11, 10:48 am, Hans Donner  wrote:
> Error codes are from our performance man!
>
> On Thu, Jun 11, 2009 at 5:27 PM, mdipierro wrote:
>
> > Please check it out!
>
> > - Models are much faster ~ 2.5x times (thanks Alexey)
> > - fully works on Jython without tweaks (sqlite and postgresql with
> > zxjdbc)
> > - custom forms and better error codes (thanks Hans)
> > - better LDAP support (thanks Fran and Mr. Freeze)
>
> > Massimo
--~--~-~--~~~---~--~~
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:23932] Re: auth email verification in trunk

2009-06-11 Thread mdipierro

Could you try uncommenting.

auth.settings.registration_requires_approval = False

On Jun 11, 11:07 am, "mr.freeze"  wrote:
> Even after a user's email is verified and they get the 'Email
> Verified' in response.flash, I get 'Registration needs verification'
> when trying to log in as that user.  What am I doing wrong?  Here's my
> auth settings in db.py:
>
> from gluon.tools import *
> auth=Auth(globals(),db)# authentication/authorization
> auth.define_tables()   # creates all needed tables
> crud=Crud(globals(),db)# for CRUD helpers using auth
> service=Service(globals()) # for json, xml, jsonrpc, xmlrpc,
> amfrpc
>
> ## uncomment as necessary or consult docs for more options
> crud.settings.auth=auth   # (optional) enforces authorization
> on crud
> mail=Mail()  # mailer
> mail.settings.server='localhost:25'# your SMTP server
> mail.settings.sender='xx...@x.com' # your email
> mail.settings.login='x:x'  # your credentials
> auth.settings.mailer=mail # for user email verification
> auth.settings.registration_requires_verification = True
> #auth.settings.registration_requires_approval = False
> auth.messages.verify_email = \
>   'Click on the 
> linkhttp://localhost:8000/authtest/default/user/verify_email/%(key)s
> to verify your email'
--~--~-~--~~~---~--~~
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:23933] Re: error on GAE deployment

2009-06-11 Thread mdipierro

admin is an app. apps can have configuration. It is possible there is
a bug, that is an experimentail feature. I will check it.

On Jun 11, 11:10 am, Tim Michelsen 
wrote:
> Hello,
> wanted to try GAE deployment as shown 
> inhttp://www.screencast.com/users/mdipierro/folders/Jing/media/b3de44de...
>
> I found a number of glitches:
> 1) not really documented how to do this quickly!
> 2) I found out that I need to have appcfg.py. Unfortunately, it's
> absolute path is hardcoded into
> applications/admin/models/0.py
> Why do you not use web2py root directory as default?
>
> Actually, you start to hit the walls of the zero-config paradigm...
> I'd like to support the idea of a comon static direcory which could also
> be the default place for tthe appcfg.py
> Any other place could easily changed by symlinks...
>
> 3) I put it into
> /var/devel/web2py/web2py_gae/appcfg.py
>
> 4) when hitting deploy in admin I got this:
>
> Traceback (most recent call last):
>File "/var/devel/web2py/web2py_gae/gluon/restricted.py", line 107, in
> restricted
>  exec ccode in environment
>File
> "/var/devel/web2py/web2py_gae/applications/admin/controllers/gae.py",
> line 78, in 
>File "/var/devel/web2py/web2py_gae/gluon/globals.py", line 100, in
> 
>  self._caller = lambda f: f()
>File
> "/var/devel/web2py/web2py_gae/applications/admin/controllers/gae.py",
> line 25, in deploy
>  apps = sorted([(file.upper(), file) for file in os.listdir(apath())
>File "/var/devel/web2py/web2py_gae/gluon/admin.py", line 11, in apath
>  opath = up(r.folder)
> AttributeError: 'NoneType' object has no attribute 'folder'
>
> Please assist me.
>
> Thanks and kind regards,
> Timmie
--~--~-~--~~~---~--~~
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:23934] Re: error on GAE deployment

2009-06-11 Thread Tim Michelsen

> admin is an app. apps can have configuration.
OK.

> It is possible there is
> a bug, that is an experimentail feature. I will check it.
Thanks for the fast response.
Please drop a mail when finished

I am thinking of creating a online editor for the docstrings...


--~--~-~--~~~---~--~~
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:23935] Re: auth email verification in trunk

2009-06-11 Thread mr.freeze

Same result.  What is supposed to happen in the auth_user table when
email is verified?

On Jun 11, 11:18 am, mdipierro  wrote:
> Could you try uncommenting.
>
> auth.settings.registration_requires_approval = False
>
> On Jun 11, 11:07 am, "mr.freeze"  wrote:
>
> > Even after a user's email is verified and they get the 'Email
> > Verified' in response.flash, I get 'Registration needs verification'
> > when trying to log in as that user.  What am I doing wrong?  Here's my
> > auth settings in db.py:
>
> > from gluon.tools import *
> > auth=Auth(globals(),db)            # authentication/authorization
> > auth.define_tables()               # creates all needed tables
> > crud=Crud(globals(),db)            # for CRUD helpers using auth
> > service=Service(globals())         # for json, xml, jsonrpc, xmlrpc,
> > amfrpc
>
> > ## uncomment as necessary or consult docs for more options
> > crud.settings.auth=auth           # (optional) enforces authorization
> > on crud
> > mail=Mail()                                  # mailer
> > mail.settings.server='localhost:25'    # your SMTP server
> > mail.settings.sender='xx...@x.com'         # your email
> > mail.settings.login='x:x'      # your credentials
> > auth.settings.mailer=mail         # for user email verification
> > auth.settings.registration_requires_verification = True
> > #auth.settings.registration_requires_approval = False
> > auth.messages.verify_email = \
> >   'Click on the 
> > linkhttp://localhost:8000/authtest/default/user/verify_email/%(key)s
> > to verify your email'
--~--~-~--~~~---~--~~
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:23936] DB cursor mgt?

2009-06-11 Thread JohnMc

I have been approached to develop a program to manage .BIN files for
network routers. The table would be simple. But the one requirement
they want is the data set has to be portable.

I am considering using SQLite for the storage. From a high level a
master DB/table would be used for the system and to keep records on
the various DBs. Each DB would store the .bin files for that
particular router.  But from a design perspective is it possible in
web2py to manage the DB cursor so as to select the appropriate SQLite
DB to interact with? If so, anybody have an example?

Thanks.

JohnMc
--~--~-~--~~~---~--~~
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:23937] Re: web2py 1.64.0 posted

2009-06-11 Thread Alexey Nezhdanov

On Thursday 11 June 2009 20:16:54 mdipierro wrote:
> Ouch! I apologize to Alexey.
NP. I saw that mistake but decided to be modest :)

> On Jun 11, 10:48 am, Hans Donner  wrote:
> > Error codes are from our performance man!
> >
> > On Thu, Jun 11, 2009 at 5:27 PM, mdipierro wrote:
> > > Please check it out!
> > >
> > > - Models are much faster ~ 2.5x times (thanks Alexey)
> > > - fully works on Jython without tweaks (sqlite and postgresql with
> > > zxjdbc)
> > > - custom forms and better error codes (thanks Hans)
> > > - better LDAP support (thanks Fran and Mr. Freeze)
> > >
> > > Massimo
>
> 


-- 
Sincerely yours
Alexey Nezhdanov

--~--~-~--~~~---~--~~
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:23938] Re: Using count in a where clause

2009-06-11 Thread Marcos (Ottawa)

Finally I solved it with HAVING which I didn't know was supported

Thank you all anyways

Marcos

On Jun 10, 6:05 pm, mdipierro  wrote:
> I do not think that is possible but I may be wrong. If you teach how
> to do it in SQL I will tell you how to translate in web2pyese.
>
> Massimo
>
> On Jun 10, 3:18 pm, Marcos Prieto  wrote:
>
> > Hi,
>
> > I'm trying to do a query in which I use select() with count and
> > groupby
>
> > db().select(field1, field1.count(), groupby=field2)
>
> >  but I'd like to be able to use the count column to limit the results,
> > adding a where clause to the SQL, something like "where count > x"
>
> > Is that possible? how?
>
> > Thanks,
>
> > Marcos.
--~--~-~--~~~---~--~~
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:23939] Re: auth email verification in trunk

2009-06-11 Thread mdipierro

It is supposed to delete everything in registration_key

On Jun 11, 11:38 am, "mr.freeze"  wrote:
> Same result.  What is supposed to happen in the auth_user table when
> email is verified?
>
> On Jun 11, 11:18 am, mdipierro  wrote:
>
> > Could you try uncommenting.
>
> > auth.settings.registration_requires_approval = False
>
> > On Jun 11, 11:07 am, "mr.freeze"  wrote:
>
> > > Even after a user's email is verified and they get the 'Email
> > > Verified' in response.flash, I get 'Registration needs verification'
> > > when trying to log in as that user.  What am I doing wrong?  Here's my
> > > auth settings in db.py:
>
> > > from gluon.tools import *
> > > auth=Auth(globals(),db)# authentication/authorization
> > > auth.define_tables()   # creates all needed tables
> > > crud=Crud(globals(),db)# for CRUD helpers using auth
> > > service=Service(globals()) # for json, xml, jsonrpc, xmlrpc,
> > > amfrpc
>
> > > ## uncomment as necessary or consult docs for more options
> > > crud.settings.auth=auth   # (optional) enforces authorization
> > > on crud
> > > mail=Mail()  # mailer
> > > mail.settings.server='localhost:25'# your SMTP server
> > > mail.settings.sender='xx...@x.com' # your email
> > > mail.settings.login='x:x'  # your credentials
> > > auth.settings.mailer=mail # for user email verification
> > > auth.settings.registration_requires_verification = True
> > > #auth.settings.registration_requires_approval = False
> > > auth.messages.verify_email = \
> > >   'Click on the 
> > > linkhttp://localhost:8000/authtest/default/user/verify_email/%(key)s
> > > to verify your email'
--~--~-~--~~~---~--~~
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:23940] Re: DB cursor mgt?

2009-06-11 Thread mdipierro

If I understand you want something like this

import os
files=os.listdir(os.path.join(request.folder,'databases'))
# choose a file, for example
file=files[1]
db=SQLDB('sqlite://%s'+file)
db.define_table()

It should go in the model, but nothing prevents you from putting this
code somewhere else like in a controller action.

Massimo

On Jun 11, 12:48 pm, JohnMc  wrote:
> I have been approached to develop a program to manage .BIN files for
> network routers. The table would be simple. But the one requirement
> they want is the data set has to be portable.
>
> I am considering using SQLite for the storage. From a high level a
> master DB/table would be used for the system and to keep records on
> the various DBs. Each DB would store the .bin files for that
> particular router.  But from a design perspective is it possible in
> web2py to manage the DB cursor so as to select the appropriate SQLite
> DB to interact with? If so, anybody have an example?
>
> Thanks.
>
> JohnMc
--~--~-~--~~~---~--~~
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:23941] Re: web2py 1.64.0 posted

2009-06-11 Thread mdipierro

There does not seem a way to edit the commit string. I will be more
careful next time.
Anyway, the who.html page is what counts.

Massimo

On Jun 11, 1:03 pm, Alexey Nezhdanov  wrote:
> On Thursday 11 June 2009 20:16:54 mdipierro wrote:> Ouch! I apologize to 
> Alexey.
>
> NP. I saw that mistake but decided to be modest :)
>
> > On Jun 11, 10:48 am, Hans Donner  wrote:
> > > Error codes are from our performance man!
>
> > > On Thu, Jun 11, 2009 at 5:27 PM, mdipierro wrote:
> > > > Please check it out!
>
> > > > - Models are much faster ~ 2.5x times (thanks Alexey)
> > > > - fully works on Jython without tweaks (sqlite and postgresql with
> > > > zxjdbc)
> > > > - custom forms and better error codes (thanks Hans)
> > > > - better LDAP support (thanks Fran and Mr. Freeze)
>
> > > > Massimo
>
> --
> Sincerely yours
> Alexey Nezhdanov
--~--~-~--~~~---~--~~
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:23942] Web2Py Informix Support

2009-06-11 Thread cesmiga

Massimo,

Did the information I sent via email about "More Web2Py InformixDb
testing" help with the code corrections needed to better support
Informix with Web2Py?

Please let me know how I can help in this area to make Informix a
success with Web2Py.

Thank you,
Christopher
--~--~-~--~~~---~--~~
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:23943] Re: auth email verification in trunk

2009-06-11 Thread mr.freeze

Then I think it is a bug in tools.py/verify_email line 864. The
registration_key is not updated when registration_requires_approval is
false:

def verify_email(
self,
next=DEFAULT,
onaccept=DEFAULT,
log=DEFAULT,
):
"""
action user to verify the registration email, 
"""

key = self.environment.request.args[-1]
user = self.settings.table_user
users = self.db(user.registration_key == key).select()
if not users:
raise HTTP(404)
user = users[0]
if self.settings.registration_requires_approval:
user.update_record(registration_key='pending')
self.environment.session.flash =
self.messages.registration_pending
else:
self.environment.session.flash =
self.messages.email_verified #864
if log == DEFAULT:
log = self.messages.verify_email_log
if next == DEFAULT:
next = self.settings.verify_email_next
if onaccept == DEFAULT:
onaccept = self.settings.verify_email_onaccept
if log:
self.log_event(log % user)
if onaccept:
onaccept(user)
redirect(next)


On Jun 11, 2:30 pm, mdipierro  wrote:
> It is supposed to delete everything in registration_key
>
> On Jun 11, 11:38 am, "mr.freeze"  wrote:
>
>
>
> > Same result.  What is supposed to happen in the auth_user table when
> > email is verified?
>
> > On Jun 11, 11:18 am, mdipierro  wrote:
>
> > > Could you try uncommenting.
>
> > > auth.settings.registration_requires_approval = False
>
> > > On Jun 11, 11:07 am, "mr.freeze"  wrote:
>
> > > > Even after a user's email is verified and they get the 'Email
> > > > Verified' in response.flash, I get 'Registration needs verification'
> > > > when trying to log in as that user.  What am I doing wrong?  Here's my
> > > > auth settings in db.py:
>
> > > > from gluon.tools import *
> > > > auth=Auth(globals(),db)            # authentication/authorization
> > > > auth.define_tables()               # creates all needed tables
> > > > crud=Crud(globals(),db)            # for CRUD helpers using auth
> > > > service=Service(globals())         # for json, xml, jsonrpc, xmlrpc,
> > > > amfrpc
>
> > > > ## uncomment as necessary or consult docs for more options
> > > > crud.settings.auth=auth           # (optional) enforces authorization
> > > > on crud
> > > > mail=Mail()                                  # mailer
> > > > mail.settings.server='localhost:25'    # your SMTP server
> > > > mail.settings.sender='xx...@x.com'         # your email
> > > > mail.settings.login='x:x'      # your credentials
> > > > auth.settings.mailer=mail         # for user email verification
> > > > auth.settings.registration_requires_verification = True
> > > > #auth.settings.registration_requires_approval = False
> > > > auth.messages.verify_email = \
> > > >   'Click on the 
> > > > linkhttp://localhost:8000/authtest/default/user/verify_email/%(key)s
> > > > to verify your email'
--~--~-~--~~~---~--~~
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:23944] Re: YACI, or how to speed up model loading

2009-06-11 Thread DenesL

Using the common code in the controller as a model substitute?
There goes the MVC separation.
And the other models still get executed.

I think AchipA means execute one model only.
The problem is that models are executed before controllers (aren't
they?), but then this points back to using ifs in models as suggested
by Massimo.

Let's suppose we change that.
Where do you keep common model code?
common = used by all ctls, except those with a name
In a reserved model whose name can not be used as a controller?
runs if no model named as request.controller
newbie (and everybody else) has to think harder how to split models.

Not pro/against anything yet, just thinking aloud.

--~--~-~--~~~---~--~~
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:23945] Re: Web2Py Informix Support

2009-06-11 Thread mdipierro

Thanks for the info. I still cannot figure out what the problem is.
there seem to be a problem with starting a transaction.
Working on it.

Massimo

On Jun 11, 2:44 pm, cesmiga  wrote:
> Massimo,
>
> Did the information I sent via email about "More Web2Py InformixDb
> testing" help with the code corrections needed to better support
> Informix with Web2Py?
>
> Please let me know how I can help in this area to make Informix a
> success with Web2Py.
>
> Thank you,
> Christopher
--~--~-~--~~~---~--~~
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:23946] Re: auth email verification in trunk

2009-06-11 Thread mdipierro

oops. You are right. Somehow I deleted that line.

Massimo

On Jun 11, 2:59 pm, "mr.freeze"  wrote:
> Then I think it is a bug in tools.py/verify_email line 864. The
> registration_key is not updated when registration_requires_approval is
> false:
>
> def verify_email(
> self,
> next=DEFAULT,
> onaccept=DEFAULT,
> log=DEFAULT,
> ):
> """
> action user to verify the registration email, 
> """
>
> key = self.environment.request.args[-1]
> user = self.settings.table_user
> users = self.db(user.registration_key == key).select()
> if not users:
> raise HTTP(404)
> user = users[0]
> if self.settings.registration_requires_approval:
> user.update_record(registration_key='pending')
> self.environment.session.flash =
> self.messages.registration_pending
> else:
> self.environment.session.flash =
> self.messages.email_verified #864
> if log == DEFAULT:
> log = self.messages.verify_email_log
> if next == DEFAULT:
> next = self.settings.verify_email_next
> if onaccept == DEFAULT:
> onaccept = self.settings.verify_email_onaccept
> if log:
> self.log_event(log % user)
> if onaccept:
> onaccept(user)
> redirect(next)
>
> On Jun 11, 2:30 pm, mdipierro  wrote:
>
> > It is supposed to delete everything in registration_key
>
> > On Jun 11, 11:38 am, "mr.freeze"  wrote:
>
> > > Same result.  What is supposed to happen in the auth_user table when
> > > email is verified?
>
> > > On Jun 11, 11:18 am, mdipierro  wrote:
>
> > > > Could you try uncommenting.
>
> > > > auth.settings.registration_requires_approval = False
>
> > > > On Jun 11, 11:07 am, "mr.freeze"  wrote:
>
> > > > > Even after a user's email is verified and they get the 'Email
> > > > > Verified' in response.flash, I get 'Registration needs verification'
> > > > > when trying to log in as that user.  What am I doing wrong?  Here's my
> > > > > auth settings in db.py:
>
> > > > > from gluon.tools import *
> > > > > auth=Auth(globals(),db)# authentication/authorization
> > > > > auth.define_tables()   # creates all needed tables
> > > > > crud=Crud(globals(),db)# for CRUD helpers using auth
> > > > > service=Service(globals()) # for json, xml, jsonrpc, xmlrpc,
> > > > > amfrpc
>
> > > > > ## uncomment as necessary or consult docs for more options
> > > > > crud.settings.auth=auth   # (optional) enforces authorization
> > > > > on crud
> > > > > mail=Mail()  # mailer
> > > > > mail.settings.server='localhost:25'# your SMTP server
> > > > > mail.settings.sender='xx...@x.com' # your email
> > > > > mail.settings.login='x:x'  # your credentials
> > > > > auth.settings.mailer=mail # for user email verification
> > > > > auth.settings.registration_requires_verification = True
> > > > > #auth.settings.registration_requires_approval = False
> > > > > auth.messages.verify_email = \
> > > > >   'Click on the 
> > > > > linkhttp://localhost:8000/authtest/default/user/verify_email/%(key)s
> > > > > to verify your email'
--~--~-~--~~~---~--~~
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:23947] Re: auth email verification in trunk

2009-06-11 Thread mdipierro

Uploading fix to trunk 1031. please let me know if this works for you.

On Jun 11, 3:22 pm, mdipierro  wrote:
> oops. You are right. Somehow I deleted that line.
>
> Massimo
>
> On Jun 11, 2:59 pm, "mr.freeze"  wrote:
>
> > Then I think it is a bug in tools.py/verify_email line 864. The
> > registration_key is not updated when registration_requires_approval is
> > false:
>
> > def verify_email(
> > self,
> > next=DEFAULT,
> > onaccept=DEFAULT,
> > log=DEFAULT,
> > ):
> > """
> > action user to verify the registration email, 
> > """
>
> > key = self.environment.request.args[-1]
> > user = self.settings.table_user
> > users = self.db(user.registration_key == key).select()
> > if not users:
> > raise HTTP(404)
> > user = users[0]
> > if self.settings.registration_requires_approval:
> > user.update_record(registration_key='pending')
> > self.environment.session.flash =
> > self.messages.registration_pending
> > else:
> > self.environment.session.flash =
> > self.messages.email_verified #864
> > if log == DEFAULT:
> > log = self.messages.verify_email_log
> > if next == DEFAULT:
> > next = self.settings.verify_email_next
> > if onaccept == DEFAULT:
> > onaccept = self.settings.verify_email_onaccept
> > if log:
> > self.log_event(log % user)
> > if onaccept:
> > onaccept(user)
> > redirect(next)
>
> > On Jun 11, 2:30 pm, mdipierro  wrote:
>
> > > It is supposed to delete everything in registration_key
>
> > > On Jun 11, 11:38 am, "mr.freeze"  wrote:
>
> > > > Same result.  What is supposed to happen in the auth_user table when
> > > > email is verified?
>
> > > > On Jun 11, 11:18 am, mdipierro  wrote:
>
> > > > > Could you try uncommenting.
>
> > > > > auth.settings.registration_requires_approval = False
>
> > > > > On Jun 11, 11:07 am, "mr.freeze"  wrote:
>
> > > > > > Even after a user's email is verified and they get the 'Email
> > > > > > Verified' in response.flash, I get 'Registration needs verification'
> > > > > > when trying to log in as that user.  What am I doing wrong?  Here's 
> > > > > > my
> > > > > > auth settings in db.py:
>
> > > > > > from gluon.tools import *
> > > > > > auth=Auth(globals(),db)# authentication/authorization
> > > > > > auth.define_tables()   # creates all needed tables
> > > > > > crud=Crud(globals(),db)# for CRUD helpers using auth
> > > > > > service=Service(globals()) # for json, xml, jsonrpc, xmlrpc,
> > > > > > amfrpc
>
> > > > > > ## uncomment as necessary or consult docs for more options
> > > > > > crud.settings.auth=auth   # (optional) enforces 
> > > > > > authorization
> > > > > > on crud
> > > > > > mail=Mail()  # mailer
> > > > > > mail.settings.server='localhost:25'# your SMTP server
> > > > > > mail.settings.sender='xx...@x.com' # your email
> > > > > > mail.settings.login='x:x'  # your credentials
> > > > > > auth.settings.mailer=mail # for user email verification
> > > > > > auth.settings.registration_requires_verification = True
> > > > > > #auth.settings.registration_requires_approval = False
> > > > > > auth.messages.verify_email = \
> > > > > >   'Click on the 
> > > > > > linkhttp://localhost:8000/authtest/default/user/verify_email/%(key)s
> > > > > > to verify your email'
--~--~-~--~~~---~--~~
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:23948] Re: sqllite web2py gen question

2009-06-11 Thread DenesL

Looks like MySQL users need not to worry:

"The MariaDB project is the brainchild of Michael "Monty" Widenius,
the founder of MySQL..."
"MariaDB 5.1 is based on MySQL 5.1."
"MariaDB will be kept up to date with the latest MySQL release from
the same branch."

And if:

"In most respects MariaDB will work exactly as MySQL; all commands,
interfaces, libraries and APIs that exist in MySQL also exist in
MariaDB."

proves true, it should just work with web2py right now.
Current users might find it in their own interest to try... and report
back.


--~--~-~--~~~---~--~~
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:23949] Re: YACI, or how to speed up model loading

2009-06-11 Thread mdipierro

there is one convention in web2py that I am not happy with. The fact
that models are executed alphabetically. Originally I thought each
model would correspond to one database connection and so they would
independent and thus the order of execution would not matter. I was
wrong, most people write dependent model files. Thus the order of
execution is important and it is good that we have one. Nevertheless
alphabetical execution is probably not the best choice.

I have been thinking about creating a mapping file to determine the
order of execution but it would increase too much the complexity of
web2py

Each model could declare its own dependencies and a mapping file could
be generated automatically and hidden under the hood.

conditional execution fits in this discussion. Perhaps model files
could have names like if_controller_db.py so that it would be executed
only if the it_[controller] matches the current controller.

ideas? comments?

Massimo

On Jun 11, 3:08 pm, DenesL  wrote:
> Using the common code in the controller as a model substitute?
> There goes the MVC separation.
> And the other models still get executed.
>
> I think AchipA means execute one model only.
> The problem is that models are executed before controllers (aren't
> they?), but then this points back to using ifs in models as suggested
> by Massimo.
>
> Let's suppose we change that.
> Where do you keep common model code?
> common = used by all ctls, except those with a name
> In a reserved model whose name can not be used as a controller?
> runs if no model named as request.controller
> newbie (and everybody else) has to think harder how to split models.
>
> Not pro/against anything yet, just thinking aloud.
--~--~-~--~~~---~--~~
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:23950] Re: DB cursor mgt?

2009-06-11 Thread JohnMc

Massimo,

Very good. Concise too. But it is what I am looking for. I would keep
the code in models and develop some error checking for file existence,
etc.

Thanks this saved me a great deal of time.

I'll post it back once I have added error checking.



On Jun 11, 2:34 pm, mdipierro  wrote:
> If I understand you want something like this
>
> import os
> files=os.listdir(os.path.join(request.folder,'databases'))
> # choose a file, for example
> file=files[1]
> db=SQLDB('sqlite://%s'+file)
> db.define_table()
>
> It should go in the model, but nothing prevents you from putting this
> code somewhere else like in a controller action.
>
> Massimo
>
> On Jun 11, 12:48 pm, JohnMc  wrote:
>
> > I have been approached to develop a program to manage .BIN files for
> > network routers. The table would be simple. But the one requirement
> > they want is the data set has to be portable.
>
> > I am considering using SQLite for the storage. From a high level a
> > master DB/table would be used for the system and to keep records on
> > the various DBs. Each DB would store the .bin files for that
> > particular router.  But from a design perspective is it possible in
> > web2py to manage the DB cursor so as to select the appropriate SQLite
> > DB to interact with? If so, anybody have an example?
>
> > Thanks.
>
> > JohnMc
--~--~-~--~~~---~--~~
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:23951] Re: how to prevent deletion of referenced records

2009-06-11 Thread DenesL

Annet, that does not prove Frank's statement.
IS_NOT_EMPTY does not prevent duplicates.

Frank, what do you mean by:
> However they won't work for some custom forms/functions.

--~--~-~--~~~---~--~~
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:23952] Re: YACI, or how to speed up model loading

2009-06-11 Thread JorgeR



On Jun 11, 3:42 pm, mdipierro  wrote:


> conditional execution fits in this discussion. Perhaps model files
> could have names like if_controller_db.py so that it would be executed
> only if the it_[controller] matches the current controller.
>
> ideas? comments?
>
I like this idea.. and it would be optional.

on a much larger scale, I would have this other (maybe crazy) idea..
to have a sort of counter for each time a model is used, so over the
period of a week or a month, it would adjust the order..
it could be a table sayin  model , number.of.hits , order of execution

and periodically the order would change automatically according to
what model is used the most...

or well... something like that..
--~--~-~--~~~---~--~~
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:23953] Re: YACI, or how to speed up model loading

2009-06-11 Thread mdipierro

I do not understand. The order cannot change if there are dependencies
and the it would not affect performance.
On http://www.web2py.com/appliances there is a log analyser applicance
that checks how other actions are executed.

On Jun 11, 3:54 pm, JorgeR  wrote:
> On Jun 11, 3:42 pm, mdipierro  wrote:
>
> > conditional execution fits in this discussion. Perhaps model files
> > could have names like if_controller_db.py so that it would be executed
> > only if the it_[controller] matches the current controller.
>
> > ideas? comments?
>
> I like this idea.. and it would be optional.
>
> on a much larger scale, I would have this other (maybe crazy) idea..
> to have a sort of counter for each time a model is used, so over the
> period of a week or a month, it would adjust the order..
> it could be a table sayin  model , number.of.hits , order of execution
>
> and periodically the order would change automatically according to
> what model is used the most...
>
> or well... something like that..
--~--~-~--~~~---~--~~
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:23954] Re: YACI, or how to speed up model loading

2009-06-11 Thread JorgeR

hmm.. ok..
forget it.

On Jun 11, 3:58 pm, mdipierro  wrote:
> I do not understand. The order cannot change if there are dependencies
> and the it would not affect performance.
> Onhttp://www.web2py.com/appliancesthere is a log analyser applicance
> that checks how other actions are executed.
>
> On Jun 11, 3:54 pm, JorgeR  wrote:
>
> > On Jun 11, 3:42 pm, mdipierro  wrote:
>
> > > conditional execution fits in this discussion. Perhaps model files
> > > could have names like if_controller_db.py so that it would be executed
> > > only if the it_[controller] matches the current controller.
>
> > > ideas? comments?
>
> > I like this idea.. and it would be optional.
>
> > on a much larger scale, I would have this other (maybe crazy) idea..
> > to have a sort of counter for each time a model is used, so over the
> > period of a week or a month, it would adjust the order..
> > it could be a table sayin  model , number.of.hits , order of execution
>
> > and periodically the order would change automatically according to
> > what model is used the most...
>
> > or well... something like that..
--~--~-~--~~~---~--~~
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:23955] Re: YACI, or how to speed up model loading

2009-06-11 Thread DenesL

On Jun 11, 4:42 pm, mdipierro  wrote:
> there is one convention in web2py that I am not happy with. The fact
> that models are executed alphabetically. Originally I thought each
> model would correspond to one database connection and so they would
> independent and thus the order of execution would not matter.

model per db connection would work
mapping file? but how to enforce it?
Currently model name is not related to anything.
Does this call for a DBs list or dictionary?
This reminds me of:
[d for d in globals().values() if isinstance(d,SQLDB)]

> I was
> wrong, most people write dependent model files. Thus the order of
> execution is important and it is good that we have one. Nevertheless
> alphabetical execution is probably not the best choice.

Didn't you encourage this by using 0.py models? :D

> I have been thinking about creating a mapping file to determine the
> order of execution but it would increase too much the complexity of
> web2py

KIS, no more complexity.

> Each model could declare its own dependencies and a mapping file could
> be generated automatically and hidden under the hood.
>
> conditional execution fits in this discussion. Perhaps model files
> could have names like if_controller_db.py so that it would be executed
> only if the it_[controller] matches the current controller.
>
> ideas? comments?

--~--~-~--~~~---~--~~
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:23956] Re: YACI, or how to speed up model loading

2009-06-11 Thread AchipA

On Jun 11, 10:08 pm, DenesL  wrote:
> Using the common code in the controller as a model substitute?
> There goes the MVC separation.
> And the other models still get executed.
>
> I think AchipA means execute one model only.
> The problem is that models are executed before controllers (aren't
> they?), but then this points back to using ifs in models as suggested
> by Massimo.

Not quite. I recommend we do the same as we do with views. E.g. if I'm
in a stuff.py controller, then
a) if there is no stuff.py in models, we include all models,
convenient for development, friendly to newbies
b) if there IS a stuff.py in models, we include ONLY that, and that
model file is responsible for it's dependencies - see below.

> Let's suppose we change that.
> Where do you keep common model code?
> common = used by all ctls, except those with a name

Now, for the kicker - in the model we could do an equivalent of
{{extend 'layout.html'}} (=sort of import ?) to include any
dependencies. This would also pull in any 'common' models (just like
we do with layout.html).  Note the subtle difference - I don't want a
single EXTRA model to be included - I want to avoid loading
unnecessary models.

--~--~-~--~~~---~--~~
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:23957] Re: error on GAE deployment

2009-06-11 Thread mdipierro

fixed in trunk. please give it a try.

On Jun 11, 11:10 am, Tim Michelsen 
wrote:
> Hello,
> wanted to try GAE deployment as shown 
> inhttp://www.screencast.com/users/mdipierro/folders/Jing/media/b3de44de...
>
> I found a number of glitches:
> 1) not really documented how to do this quickly!
> 2) I found out that I need to have appcfg.py. Unfortunately, it's
> absolute path is hardcoded into
> applications/admin/models/0.py
> Why do you not use web2py root directory as default?
>
> Actually, you start to hit the walls of the zero-config paradigm...
> I'd like to support the idea of a comon static direcory which could also
> be the default place for tthe appcfg.py
> Any other place could easily changed by symlinks...
>
> 3) I put it into
> /var/devel/web2py/web2py_gae/appcfg.py
>
> 4) when hitting deploy in admin I got this:
>
> Traceback (most recent call last):
>File "/var/devel/web2py/web2py_gae/gluon/restricted.py", line 107, in
> restricted
>  exec ccode in environment
>File
> "/var/devel/web2py/web2py_gae/applications/admin/controllers/gae.py",
> line 78, in 
>File "/var/devel/web2py/web2py_gae/gluon/globals.py", line 100, in
> 
>  self._caller = lambda f: f()
>File
> "/var/devel/web2py/web2py_gae/applications/admin/controllers/gae.py",
> line 25, in deploy
>  apps = sorted([(file.upper(), file) for file in os.listdir(apath())
>File "/var/devel/web2py/web2py_gae/gluon/admin.py", line 11, in apath
>  opath = up(r.folder)
> AttributeError: 'NoneType' object has no attribute 'folder'
>
> Please assist me.
>
> Thanks and kind regards,
> Timmie
--~--~-~--~~~---~--~~
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:23958] Re: how to prevent deletion of referenced records

2009-06-11 Thread Fran

On Jun 11, 9:50 pm, DenesL  wrote:
> Fran, what do you mean by:
> > However they won't work for some custom forms/functions.

If I define in my model:
db.define_table('test',
db.Field('test', requires=IS_NOT_EMPTY()))

Then do:
db.test.insert(test='')

It works fine - record is inserted.

F
--~--~-~--~~~---~--~~
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:23959] Re: auth email verification in trunk

2009-06-11 Thread mr.freeze

Works for me.  Thanks!

On Jun 11, 3:25 pm, mdipierro  wrote:
> Uploading fix to trunk 1031. please let me know if this works for you.
>
> On Jun 11, 3:22 pm, mdipierro  wrote:
>
> > oops. You are right. Somehow I deleted that line.
>
> > Massimo
>
> > On Jun 11, 2:59 pm, "mr.freeze"  wrote:
>
> > > Then I think it is a bug in tools.py/verify_email line 864. The
> > > registration_key is not updated when registration_requires_approval is
> > > false:
>
> > > def verify_email(
> > >         self,
> > >         next=DEFAULT,
> > >         onaccept=DEFAULT,
> > >         log=DEFAULT,
> > >         ):
> > >         """
> > >         action user to verify the registration email, 
> > >         """
>
> > >         key = self.environment.request.args[-1]
> > >         user = self.settings.table_user
> > >         users = self.db(user.registration_key == key).select()
> > >         if not users:
> > >             raise HTTP(404)
> > >         user = users[0]
> > >         if self.settings.registration_requires_approval:
> > >             user.update_record(registration_key='pending')
> > >             self.environment.session.flash =
> > > self.messages.registration_pending
> > >         else:
> > >             self.environment.session.flash =
> > > self.messages.email_verified #864
> > >         if log == DEFAULT:
> > >             log = self.messages.verify_email_log
> > >         if next == DEFAULT:
> > >             next = self.settings.verify_email_next
> > >         if onaccept == DEFAULT:
> > >             onaccept = self.settings.verify_email_onaccept
> > >         if log:
> > >             self.log_event(log % user)
> > >         if onaccept:
> > >             onaccept(user)
> > >         redirect(next)
>
> > > On Jun 11, 2:30 pm, mdipierro  wrote:
>
> > > > It is supposed to delete everything in registration_key
>
> > > > On Jun 11, 11:38 am, "mr.freeze"  wrote:
>
> > > > > Same result.  What is supposed to happen in the auth_user table when
> > > > > email is verified?
>
> > > > > On Jun 11, 11:18 am, mdipierro  wrote:
>
> > > > > > Could you try uncommenting.
>
> > > > > > auth.settings.registration_requires_approval = False
>
> > > > > > On Jun 11, 11:07 am, "mr.freeze"  wrote:
>
> > > > > > > Even after a user's email is verified and they get the 'Email
> > > > > > > Verified' in response.flash, I get 'Registration needs 
> > > > > > > verification'
> > > > > > > when trying to log in as that user.  What am I doing wrong?  
> > > > > > > Here's my
> > > > > > > auth settings in db.py:
>
> > > > > > > from gluon.tools import *
> > > > > > > auth=Auth(globals(),db)            # authentication/authorization
> > > > > > > auth.define_tables()               # creates all needed tables
> > > > > > > crud=Crud(globals(),db)            # for CRUD helpers using auth
> > > > > > > service=Service(globals())         # for json, xml, jsonrpc, 
> > > > > > > xmlrpc,
> > > > > > > amfrpc
>
> > > > > > > ## uncomment as necessary or consult docs for more options
> > > > > > > crud.settings.auth=auth           # (optional) enforces 
> > > > > > > authorization
> > > > > > > on crud
> > > > > > > mail=Mail()                                  # mailer
> > > > > > > mail.settings.server='localhost:25'    # your SMTP server
> > > > > > > mail.settings.sender='xx...@x.com'         # your email
> > > > > > > mail.settings.login='x:x'      # your credentials
> > > > > > > auth.settings.mailer=mail         # for user email verification
> > > > > > > auth.settings.registration_requires_verification = True
> > > > > > > #auth.settings.registration_requires_approval = False
> > > > > > > auth.messages.verify_email = \
> > > > > > >   'Click on the 
> > > > > > > linkhttp://localhost:8000/authtest/default/user/verify_email/%(key)s
> > > > > > > to verify your email'
--~--~-~--~~~---~--~~
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:23960] Re: how to prevent deletion of referenced records

2009-06-11 Thread Fran

On Jun 11, 9:50 pm, DenesL  wrote:
> Annet, that does not prove Frank's statement.
> IS_NOT_EMPTY does not prevent duplicates.
> Frank, what do you mean by:
> > However they won't work for some custom forms/functions.

NB This is discussed in the manual - pg 139.

F
--~--~-~--~~~---~--~~
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:23961] Re: YACI, or how to speed up model loading

2009-06-11 Thread mdipierro

What is we have folders like

models/__init__.py
models/default/__init__.py
models/default/index.py

and __init__ is executed for every action and controller
and default/__init__ is executed for every action in controller
default.py
and default/index only for the index action, etc etc.

if there is no folder, then controllers are executed alphabetically
(but __init__ skips ahead if present).

other depencies in models would result in a mess.

What d you think?


On Jun 11, 4:39 pm, AchipA  wrote:
> On Jun 11, 10:08 pm, DenesL  wrote:
>
> > Using the common code in the controller as a model substitute?
> > There goes the MVC separation.
> > And the other models still get executed.
>
> > I think AchipA means execute one model only.
> > The problem is that models are executed before controllers (aren't
> > they?), but then this points back to using ifs in models as suggested
> > by Massimo.
>
> Not quite. I recommend we do the same as we do with views. E.g. if I'm
> in a stuff.py controller, then
> a) if there is no stuff.py in models, we include all models,
> convenient for development, friendly to newbies
> b) if there IS a stuff.py in models, we include ONLY that, and that
> model file is responsible for it's dependencies - see below.
>
> > Let's suppose we change that.
> > Where do you keep common model code?
> > common = used by all ctls, except those with a name
>
> Now, for the kicker - in the model we could do an equivalent of
> {{extend 'layout.html'}} (=sort of import ?) to include any
> dependencies. This would also pull in any 'common' models (just like
> we do with layout.html).  Note the subtle difference - I don't want a
> single EXTRA model to be included - I want to avoid loading
> unnecessary models.
--~--~-~--~~~---~--~~
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:23962] Re: Form validation causes checkbox to get selected

2009-06-11 Thread DJ

Thanks Massimo. Quick question, how do I get this patch? (url address)

Also, can I update this patch into my current version of web2py
(1.56.4) or do I need to do a full upgrade?

-Sebastian

On Jun 10, 10:31 pm, mdipierro  wrote:
> You are correct. I fixed it and I am uploading to trunk now (launchpad
> 904).
>
> Massimo
>
> On Jun 10, 5:52 pm, DJ  wrote:
>
> > Hello,
>
> > I see a strange behavior when I try to validate a FORM. If there is a
> > required field that is left empty Web2PY throws a "Cannot be empty"
> > error message (good behavior). But along with this, the checkbox
> > fields in the form also get selected even though they were left
> > unchecked (unwanted action).
>
> > I suspect this may be a bug during form validation. Any ideas on how
> > to get around this? Thanks for your help.
>
> > -Sebastian
>
> > Web2py: 1.56.4
>
> > -Code fragment --
> > # db().select(db.resist.ALL) = 'test1', 'test2', 'test3', 'test4'  ##
> > from DB
> > resist_mult = ['test2', 'test3']
>
> > form=FORM(TABLE(
> >             TR(TD("Name:",_class="right"),INPUT(_type="text",
> > _size="", _name="name", value=str(a.name)+".1", requires=[IS_NOT_EMPTY
> > (), IS_NOT_IN_DB(db, 'project.name')]),
> >             TD("Notebook:",_class="right"),INPUT
> > (_type="text",_name="notebook",_size="8", requires=IS_NOT_EMPTY()),
> >             TD("Page:",_class="right"),INPUT
> > (_type="text",_size="5",_name="page", requires=IS_NOT_EMPTY()),
>
> >             #BR(),
>
> >             TABLE(
> >             TR("Resistances:", *[TD(x.name, INPUT(_type="checkbox",
> > name="resist_mult",_value=x.name, value=x.name in a.resist_mult)) for
> > x in db().select(db.resist.ALL)]),
>
> >          )
--~--~-~--~~~---~--~~
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:23964] Re: YACI, or how to speed up model loading

2009-06-11 Thread Fran

On Jun 11, 10:39 pm, AchipA  wrote:
> Now, for the kicker - in the model we could do an equivalent of
> {{extend 'layout.html'}} (=sort of import ?) to include any
> dependencies. This would also pull in any 'common' models (just like
> we do with layout.html).  Note the subtle difference - I don't want a
> single EXTRA model to be included - I want to avoid loading
> unnecessary models.

This would indeed be the key requirement for separating out models
into those appropriate for each controller.
Otherwise I'd prefer to leave it as it is...

F
--~--~-~--~~~---~--~~
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:23963] Re: Form validation causes checkbox to get selected

2009-06-11 Thread Fran

On Jun 11, 11:33 pm, DJ  wrote:
> Thanks Massimo. Quick question, how do I get this patch? (url address)

http://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/904

But also see:
http://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/905
http://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/906

> Also, can I update this patch into my current version of web2py
> (1.56.4) or do I need to do a full upgrade?

You can try an incremental upgrade I think in this case, but I would
consider a full upgrade soon anyway...

F
--~--~-~--~~~---~--~~
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:23966] IS_PASSWORD validator?

2009-06-11 Thread mr.freeze

Does anyone already have a validator built that has options for
enforcing various password complexity requirements? Just wondering
before I make one.

--~--~-~--~~~---~--~~
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:23965] Re: error on GAE deployment

2009-06-11 Thread Tim Michelsen

> fixed in trunk. please give it a try.
Massimo,
I am very sad to say, but I will never ever fix a coding bug in web2py 
core by myself.
The same applies as your refusal to use bugtrackers:
By the time I have figured who the thing works you have already fixed 
the issue... ;-)

Well, couldn't test it fully as there was a problem that GAE 
registration could not send me the text message.

Thanks & Regards,
Timmie


--~--~-~--~~~---~--~~
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:23967] Re: Form validation causes checkbox to get selected

2009-06-11 Thread DJ

Thanks Francis.

On Jun 11, 6:58 pm, Fran  wrote:
> On Jun 11, 11:33 pm, DJ  wrote:
>
> > Thanks Massimo. Quick question, how do I get this patch? (url address)
>
> http://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/904
>
> But also 
> see:http://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/905http://bazaar.launchpad.net/~mdipierro/web2py/devel/revision/906
>
> > Also, can I update this patch into my current version of web2py
> > (1.56.4) or do I need to do a full upgrade?
>
> You can try an incremental upgrade I think in this case, but I would
> consider a full upgrade soon anyway...
>
> F
--~--~-~--~~~---~--~~
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:23968] Re: IS_PASSWORD validator?

2009-06-11 Thread mdipierro

do not make one. add the feature to crypt. client side there are
jquery libraries that do what you need.


On Jun 11, 6:29 pm, "mr.freeze"  wrote:
> Does anyone already have a validator built that has options for
> enforcing various password complexity requirements? Just wondering
> before I make one.
--~--~-~--~~~---~--~~
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:23969] Re: error on GAE deployment

2009-06-11 Thread mdipierro

You still have the option of sending me the patch "before" reporting
the bug. ;-)

On Jun 11, 6:12 pm, Tim Michelsen  wrote:
> > fixed in trunk. please give it a try.
>
> Massimo,
> I am very sad to say, but I will never ever fix a coding bug in web2py
> core by myself.
> The same applies as your refusal to use bugtrackers:
> By the time I have figured who the thing works you have already fixed
> the issue... ;-)
>
> Well, couldn't test it fully as there was a problem that GAE
> registration could not send me the text message.
>
> Thanks & Regards,
> Timmie
--~--~-~--~~~---~--~~
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:23970] Re: web2py 1.62.1 is OUT (New Features List)

2009-06-11 Thread Ted G

Massimo,

With respect to the new file upload remembering the file name. Are
there accompanying methods to get and set the filename after upload of
the file?

In my example, my app is running on GAE, therefore uploaded files are
being stored in the DB. I require the ability for the user to see a
list of their uploaded files, using filenames. Currently I use a
separate field to store the filename of the file when it was
originally uploaded and use that for display purposes (upload field
value still used as the url to the resource). I also allow the user to
change the value of the display filename.

With the new upload field I was hoping my extra filename field would
be redundant and that I could get and set the filename that was being
stored as part of the upload field. Is this possible in the new
implementation, or am I stuck using the extra filename field?

Ted



On May 18, 8:10 am, mdipierro  wrote:
> I fixed a couple of issues posted during the night and reposted
> 1.62.1. Please let me know if you have any problem.
>
> New features:
>
> - There is a new "welcome" scaffoling app that has Authentication,
> Authorization, Crud, Services, and Menu by default.
>
> - There is a new file format for web2py apps (.w2p) it is zips files
> so it is more compact.
>
> - if SQLField(, writable=False, readable=True) thefieldis shown
> readonly in SQLFORMs
>
> - The "design" page has been renamed "edit".
>
> - If youuploada file in an "upload"fieldit now "remembers" the
> original name. The name does not appear in the URL for various
> security reason but it will be used when you try to save the file.
> This is ON by default. Can be disabled but I cannot think any reason
> to.
>
> - There is a new {{=MENU(response.menu)}} helper
>
> - You can disable lazy evaluation of languages T.lazy=False (True by
> default as before)
>
> - Better WingIDE support
>
> - Better Internationalization
>
> BETA FEATURES (they seem to work but need more testing and
> improvements)
>
> - look into admin/models/0.py, there is a variable GAE_APPCFG. If that
> variable points to the correct Google App Engine utility appcfg.py,
> web2py will provide a web based interface to deploy on the Google App
> Engine, linked from admin/default/site
>
> - If you run source and you "easy_install mercurial", each app has its
> own minimalist interface to mercurial and you can commit your changes
> to it.
>
> - There is a new [shell] button in the edit (design) page. When you
> click on it you get an AJAX shell within the app (it sees the
> database). It has some problems with sqlite since it closes the
> database unexpectedly.
>
> Thanks particularly to Alvaro, Douglas, Yair, Tim, Iceberg for all
> their help (I am sure I forgot somebody).
>
> Massimo
--~--~-~--~~~---~--~~
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:23971] Re: YACI, or how to speed up model loading

2009-06-11 Thread DenesL

On Jun 11, 4:52 pm, mdipierro  wrote:
> What if we have folders like
>
> models/__init__.py
> models/default/__init__.py
> models/default/index.py
>
> and __init__ is executed for every action and controller
> and default/__init__ is executed for every action in controller
> default.py
> and default/index only for the index action, etc etc.

Not sure I like the atomization into possibly many files.
On the other hand something more compact as one file with functions
ala controllers might become quite large.


On Jun 11, 10:39 pm, AchipA  wrote:

> a) if there is no stuff.py in models, we include all models,
> convenient for development, friendly to newbies

If no stuff.py include everything else?.
I am against this one.

> Now, for the kicker - in the model we could do an equivalent of
> {{extend 'layout.html'}} (=sort of import ?) to include any
> dependencies. This would also pull in any 'common' models (just like
> we do with layout.html).  Note the subtle difference - I don't want a
> single EXTRA model to be included - I want to avoid loading
> unnecessary models.

I must be tired, I fail to see the subtle difference.
The model related to a controller (stuff) moves to a separate file
(stuff.py).
Nothing extra. If stuff is called and stuff.py model is there run it.
If not then run common.py (or similar).

Can it be self contained (no dependencies)?.




--~--~-~--~~~---~--~~
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:23972] Re: how to prevent deletion of referenced records

2009-06-11 Thread DenesL

On Jun 11, 4:42 pm, Fran  wrote:
> On Jun 11, 9:50 pm, DenesL  wrote:
>
> > Fran, what do you mean by:
> > > However they won't work for some custom forms/functions.
>
> If I define in my model:
> db.define_table('test',
>                 db.Field('test', requires=IS_NOT_EMPTY()))
>
> Then do:
> db.test.insert(test='')
>
> It works fine - record is inserted.

That is not a form (or custom form).
It is clear that validators as IS_NOT_EMPTY are not checked by insert.

Defining the field as notnull=True would/should prevent the insert (at
the DB level).


--~--~-~--~~~---~--~~
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:23973] Re: YACI, or how to speed up model loading

2009-06-11 Thread Alexey Nezhdanov

Let me first comment on initial AchipA's proposal.

Splitting models into different files targets same goals as my lazy_tables 
approach: it tries to speed up model load time by excluding the things that 
are _probably_ not needed in this browser request (read controller/function).

The differences are:
* split models define static sets of tables. You think in advance what tables 
you will need, and you put just them into the model that will be executed for 
this controller
   Pros: same syntax everywhere
   Cons: many model files, in case of heavy optimisation - too many

* lazy tables allow for more dynamic execution. If you know that you'll need 
some table always - you define it as usual. If you not sure - you define it 
as lazy. During runtime web2py automatically decides which one you need and 
finalizes their definitions. You get little time penalty for lazyness, but 
you save more a lot of init time for the tables you do not need.
   Pros: automatic decisions on which tables to init.
   Cons: syntax is different for 'lazy' and 'classic' tables, though 
converting b/w them is very simple (most of the work is one more intentation 
step).

There is one more problem with split models approach though: they are 
too 'hard' and they try to predict the future.
1) You may know what tables you do need for this controller/function call but 
that does not neccesary stay fixed in the future. You will need to add more 
and more tables to 'this controller model' as application grows.
2) Opposite of (1) - if you stop using some tables in your controller due to 
refactoring you have to remember to delete them from model. With some 
programming approaches ('lazy' in traditional style) that includes 'deletion 
fears' - you have to do something despite it already works.
3) In rare cases even the same function of the same controller may need 
different tables depending on post data. For instance - I have a function 
that is named 'combo search' - it does the search either in one table or in 
another depending on what search button was clicked. Both tables are rather 
large, having more than 20 fields each. I'd very much like to avoid 
initialising unused table.

I'd still vote for using lazy tables. Apart from somewhat awkward definition 
syntax they are quite flexible and do not have the drawbacks that I 
described.

Awkwardness of syntax could be changed by coding lazyness into 
SQLTable.__init__ and SQLField.__init__ (and to validator init for 
completeness) but that will be quite intrusive patch.
After all - if someone wants to take trouble of splitting models into separate 
files - then probably he can afford wrapping each table definition into 
function call instead. 

P.S. 'split models' and 'lazy tables' are compartible and could be used at 
once. But I do not really see a benefit in this - combining them will give 
very little speedup which will be further reduced by penalties of 'execution 
check'. Having lazy tables functionality w/o actually using lazy tables 
decreases perfomance a bit - btw - I didn't test for it. Can't right now - 
will have access to that hardware only on monday. Here is idea - we can have 
a 'class LazySQLDB(SQLDB)' (or I can have it directly in my model).

All in all I see these approaches as interchangeable with a slight preference 
to lazy tables.

On Friday 12 June 2009 01:52:29 mdipierro wrote:
> What is we have folders like
>
> models/__init__.py
> models/default/__init__.py
> models/default/index.py
>
> and __init__ is executed for every action and controller
> and default/__init__ is executed for every action in controller
> default.py
> and default/index only for the index action, etc etc.
>
> if there is no folder, then controllers are executed alphabetically
> (but __init__ skips ahead if present).
>
> other depencies in models would result in a mess.
>
> What d you think?
>
> On Jun 11, 4:39 pm, AchipA  wrote:
> > On Jun 11, 10:08 pm, DenesL  wrote:
> > > Using the common code in the controller as a model substitute?
> > > There goes the MVC separation.
> > > And the other models still get executed.
> > >
> > > I think AchipA means execute one model only.
> > > The problem is that models are executed before controllers (aren't
> > > they?), but then this points back to using ifs in models as suggested
> > > by Massimo.
> >
> > Not quite. I recommend we do the same as we do with views. E.g. if I'm
> > in a stuff.py controller, then
> > a) if there is no stuff.py in models, we include all models,
> > convenient for development, friendly to newbies
> > b) if there IS a stuff.py in models, we include ONLY that, and that
> > model file is responsible for it's dependencies - see below.
> >
> > > Let's suppose we change that.
> > > Where do you keep common model code?
> > > common = used by all ctls, except those with a name
> >
> > Now, for the kicker - in the model we could do an equivalent of
> > {{extend 'layout.html'}} (=sort of import ?) to include any
> > dependencies. Thi

[web2py:23974] Re: YACI, or how to speed up model loading

2009-06-11 Thread mdipierro

The more I think about this the more I agree with you and the lazy
table approach seems better.

Imagine a situation with three tables A,B,C and two controllers X, Y
where X needs A,B and Y needs Y,Z. Where should Y be defined? Should
it be imported? modules cannot be imported only executed. what if one
changes mind and now A needs Z too bot no longer Y. Do we move code
form one function to another? It is already a mess.

Massimo

On Jun 11, 11:28 pm, Alexey Nezhdanov  wrote:
> Let me first comment on initial AchipA's proposal.
>
> Splitting models into different files targets same goals as my lazy_tables
> approach: it tries to speed up model load time by excluding the things that
> are _probably_ not needed in this browser request (read controller/function).
>
> The differences are:
> * split models define static sets of tables. You think in advance what tables
> you will need, and you put just them into the model that will be executed for
> this controller
>    Pros: same syntax everywhere
>    Cons: many model files, in case of heavy optimisation - too many
>
> * lazy tables allow for more dynamic execution. If you know that you'll need
> some table always - you define it as usual. If you not sure - you define it
> as lazy. During runtime web2py automatically decides which one you need and
> finalizes their definitions. You get little time penalty for lazyness, but
> you save more a lot of init time for the tables you do not need.
>    Pros: automatic decisions on which tables to init.
>    Cons: syntax is different for 'lazy' and 'classic' tables, though
> converting b/w them is very simple (most of the work is one more intentation
> step).
>
> There is one more problem with split models approach though: they are
> too 'hard' and they try to predict the future.
> 1) You may know what tables you do need for this controller/function call but
> that does not neccesary stay fixed in the future. You will need to add more
> and more tables to 'this controller model' as application grows.
> 2) Opposite of (1) - if you stop using some tables in your controller due to
> refactoring you have to remember to delete them from model. With some
> programming approaches ('lazy' in traditional style) that includes 'deletion
> fears' - you have to do something despite it already works.
> 3) In rare cases even the same function of the same controller may need
> different tables depending on post data. For instance - I have a function
> that is named 'combo search' - it does the search either in one table or in
> another depending on what search button was clicked. Both tables are rather
> large, having more than 20 fields each. I'd very much like to avoid
> initialising unused table.
>
> I'd still vote for using lazy tables. Apart from somewhat awkward definition
> syntax they are quite flexible and do not have the drawbacks that I
> described.
>
> Awkwardness of syntax could be changed by coding lazyness into
> SQLTable.__init__ and SQLField.__init__ (and to validator init for
> completeness) but that will be quite intrusive patch.
> After all - if someone wants to take trouble of splitting models into separate
> files - then probably he can afford wrapping each table definition into
> function call instead.
>
> P.S. 'split models' and 'lazy tables' are compartible and could be used at
> once. But I do not really see a benefit in this - combining them will give
> very little speedup which will be further reduced by penalties of 'execution
> check'. Having lazy tables functionality w/o actually using lazy tables
> decreases perfomance a bit - btw - I didn't test for it. Can't right now -
> will have access to that hardware only on monday. Here is idea - we can have
> a 'class LazySQLDB(SQLDB)' (or I can have it directly in my model).
>
> All in all I see these approaches as interchangeable with a slight preference
> to lazy tables.
>
> On Friday 12 June 2009 01:52:29 mdipierro wrote:
>
>
>
> > What is we have folders like
>
> > models/__init__.py
> > models/default/__init__.py
> > models/default/index.py
>
> > and __init__ is executed for every action and controller
> > and default/__init__ is executed for every action in controller
> > default.py
> > and default/index only for the index action, etc etc.
>
> > if there is no folder, then controllers are executed alphabetically
> > (but __init__ skips ahead if present).
>
> > other depencies in models would result in a mess.
>
> > What d you think?
>
> > On Jun 11, 4:39 pm, AchipA  wrote:
> > > On Jun 11, 10:08 pm, DenesL  wrote:
> > > > Using the common code in the controller as a model substitute?
> > > > There goes the MVC separation.
> > > > And the other models still get executed.
>
> > > > I think AchipA means execute one model only.
> > > > The problem is that models are executed before controllers (aren't
> > > > they?), but then this points back to using ifs in models as suggested
> > > > by Massimo.
>
> > > Not quite. I recommend we do the same as we do with v

[web2py:23975] Re: web2py 1.62.1 is OUT (New Features List)

2009-06-11 Thread mdipierro

Currently when you upload a file, the actual file goes in the
filesystem of "uploadfield" in the database. The filename is
b16encoded and stored inside the new "internal" filename. It is
extracted and used by the "download" action to set content
disposition.

There is no easy way to change this mechanism.

It is possible to set an onvalidation function that replaces
form.vars.filefieldname.filename before the file is actually loaded.
You can also define a custom download action.

There is no exposed API to do this since the current mechanism is
quite complex and I do would not encourage bypassing it.

Massimo

On Jun 11, 8:42 pm, Ted G  wrote:
> Massimo,
>
> With respect to the new file upload remembering the file name. Are
> there accompanying methods to get and set the filename after upload of
> the file?
>
> In my example, my app is running on GAE, therefore uploaded files are
> being stored in the DB. I require the ability for the user to see a
> list of their uploaded files, using filenames. Currently I use a
> separate field to store the filename of the file when it was
> originally uploaded and use that for display purposes (upload field
> value still used as the url to the resource). I also allow the user to
> change the value of the display filename.
>
> With the new upload field I was hoping my extra filename field would
> be redundant and that I could get and set the filename that was being
> stored as part of the upload field. Is this possible in the new
> implementation, or am I stuck using the extra filename field?
>
> Ted
>
> On May 18, 8:10 am, mdipierro  wrote:
>
> > I fixed a couple of issues posted during the night and reposted
> > 1.62.1. Please let me know if you have any problem.
>
> > New features:
>
> > - There is a new "welcome" scaffoling app that has Authentication,
> > Authorization, Crud, Services, and Menu by default.
>
> > - There is a new file format for web2py apps (.w2p) it is zips files
> > so it is more compact.
>
> > - if SQLField(, writable=False, readable=True) thefieldis shown
> > readonly in SQLFORMs
>
> > - The "design" page has been renamed "edit".
>
> > - If youuploada file in an "upload"fieldit now "remembers" the
> > original name. The name does not appear in the URL for various
> > security reason but it will be used when you try to save the file.
> > This is ON by default. Can be disabled but I cannot think any reason
> > to.
>
> > - There is a new {{=MENU(response.menu)}} helper
>
> > - You can disable lazy evaluation of languages T.lazy=False (True by
> > default as before)
>
> > - Better WingIDE support
>
> > - Better Internationalization
>
> > BETA FEATURES (they seem to work but need more testing and
> > improvements)
>
> > - look into admin/models/0.py, there is a variable GAE_APPCFG. If that
> > variable points to the correct Google App Engine utility appcfg.py,
> > web2py will provide a web based interface to deploy on the Google App
> > Engine, linked from admin/default/site
>
> > - If you run source and you "easy_install mercurial", each app has its
> > own minimalist interface to mercurial and you can commit your changes
> > to it.
>
> > - There is a new [shell] button in the edit (design) page. When you
> > click on it you get an AJAX shell within the app (it sees the
> > database). It has some problems with sqlite since it closes the
> > database unexpectedly.
>
> > Thanks particularly to Alvaro, Douglas, Yair, Tim, Iceberg for all
> > their help (I am sure I forgot somebody).
>
> > Massimo
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



  1   2   >