Can someone enlighten me about this distinction -- and in general the
utility of view()?
Supposedly view() is "The normal way to retrieve an existing view." But
apparently even if the view doesn't exist, something gets retrieved --
though it isn't of much use. However, it does appear that you can append
to this non-existent view since
v = db.view('NonExistentView')
v.append(foo=1)
*appears* to work. But then, of course any attempt at referencing v[0].foo
fails (though referencing v[0] does not). Shouldn't appending to a
non-existent view raise an exception? If you look at db.properties() there
again *appears* to be a view called 'NonExistentView' there.
How can I tell that I've "retrieved" a non-existent view as opposed to,
say, a merely empty one? If I try to use description() on a non-existent
view I get a really ugly Python internal error.
Given this, what is the point of view()? (No pun intended.)
I guess that part of the utility would be that if I use view(), I need only
the view name and not the description. And that if I do manage to
"pseudo-retrieve" a non-existent view, then at some point something will go
wrong in a fairly obvious (not to say dramatic) way. Whereas, if I make a
mistake with getas(), a new view will get created and there may be other
consequences to that. But why not raise an exception if a bogus view name
is given to view()?
--------------------------------------
Gary H. Merrill
Director and Principal Scientist, New Applications
Data Exploration Sciences
GlaxoSmithKline Inc.
(919) 483-8456
_____________________________________________
Metakit mailing list - [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit