Bill Anderson wrote:
>
> Michael Bernstein wrote:
> >
> > I *think* I've created a getUserNames python method that returns the
> > appropriate results:
> >
> > Parameter list:
> > self
> >
> > Body:
> >
> > user_ids=self.UserSource.getPersistentItemIDs()
> >
> > names=[]
> > for i in user_ids:
> > names.append(self.getItem(i))
> > return names
>
> Returns a list of objects.
>
> > I don't understand the differences between the code I pasted above and
> > the code on the original getUserNames method (from :
> >
> > def getUserNames(self):
> > """Return a list of usernames"""
> > names=self.data.keys()
> > names.sort()
> > return names
>
> Returns a list of usernames.
>
> > Can anyone tell me what I need to fix?
>
> Unfortunately, I cannot yet.
Does anyone on the list know how to change the getUserNames
Python method to return a list of names instead of a list of
objects?
The code in question is this:
user_ids=self.UserSource.getPersistentItemIDs()
names=[]
for i in user_ids:
names.append(self.getItem(i))
return names
Thanks,
Michael Bernstein
_______________________________________________
Zope-Dev maillist - [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope )