Re: Bug: Schema.moveField( ... after ) does incorrect reordering.
George Lee <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
> Suggested fix: > def _moveFieldToPosition(self, name, pos): > """Moves a field with the name 'name' to the position 'pos' > > This method doesn't obey the assignement of fields to a schemata > """ > keys = self._names > oldpos = keys.index(name) > keys.remove(name) > if oldpos >= pos: > keys.insert(pos, name) > else: > keys.insert(pos - 1, name) > self._names = keys Alternatively: keys = self._names keys[ keys.index(name) ] = None keys.insert(pos, name) keys.remove(None) self._names = keys ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click