Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.163.473 Times

collective.elephantvocabulary 0.2.1

Company: Rok Garbas
Date Added: July 25, 2013  |  Visits: 360

collective.elephantvocabulary

Report Broken Link
Printer Friendly Version


Product Homepage
Download (32 downloads)



Like elephants don't forget anything, so does't collective.elephantvocabulary. It provides a wrapper around for existing zope.schema vocabularies and make them not forget anything.<br /><br />Example usecase would be a vocabulary (source) of users which from certain point in time wants to hide / deactivate some users for form or listing. But at the same time you want keep old references to user term working. This is when collective.elephantvocabulary comes into the picture. With it you wrap existing vocabulary of users and provide set of hidden list of users (term values).<br /><br />Usage<br /><br />Some example content and vocabularies<br /><br /> >>> context = layer.context<br /> >>> example_vocab = layer.example_vocab<br /> >>> example_source = layer.example_source<br /><br /> >>> [i.value for i in example_vocab]<br /> [1, 2, 3, 4]<br /><br />Bellow is out wraper method we use to make our existing vocab more elephant-like.<br /><br /> >>> from collective.elephantvocabulary import wrap_vocabulary<br /><br />In first exampe we pass to our wrap_vocabulary a vocabulary of [1, 2, 3, 4] and we set terms 2 and 3 to hidden. wrap_vocabulary returns VocabularyFactory which needs to be called with context (you could also register it with as utility).<br /><br /> >>> wrapped_vocab_factory = wrap_vocabulary(example_vocab, [2, 3])<br /> >>> print wrapped_vocab_factory<br /> <collective.elephantvocabulary.vocabulary.VocabularyFactory object at ...><br /><br /> >>> wrapped_vocab = wrapped_vocab_factory(context)<br /> >>> [i.value for i in wrapped_vocab]<br /> [1, 4]<br /><br /> >>> len(wrapped_vocab) == len(example_vocab)<br /> True<br /><br /> >>> 2 in wrapped_vocab<br /> True<br /><br /> >>> 5 in wrapped_vocab<br /> False<br /><br /> >>> wrapped_vocab.getTerm(3).value<br /> 3<br /><br />Above we see what collective.elephantvocabulary is all about. When listing vocabulary hidden terms are not listed. But when item is requested with its term value then term is also returned. Also length of vocabulary is unchanged. It still shows original lenght of vocabulary.<br /><br />We can also call vocabulary by name it was register with ZCA machinery..<br /><br /> >>> wrapped_vocab2 = wrap_vocabulary('example-vocab', [2, 3])(context)<br /> >>> [i.value for i in wrapped_vocab2]<br /> [1, 4]<br /><br />hidden_terms parameter (second argument we pass to wrap_vocabulary) can also be callable which expects 2 parameters, context and original vocabulary.<br /><br /> >>> def hidden_terms(context, vocab):<br /> ... return [1, 4]<br /><br /> >>> wrapped_vocab3 = wrap_vocabulary(example_vocab, hidden_terms)(context)<br /> >>> [i.value for i in wrapped_vocab3]<br /> [2, 3]<br /><br />collective.elephantvocabulary also works with sources.<br /><br /> >>> [i.value for i in example_source]<br /> [1, 2, 3, 4]<br /><br /> >>> [i.value for i in example_source.search()]<br /> [1, 2]<br /><br /> >>> wrapped_source = wrap_vocabulary(example_source, [1, 4])(context)<br /> >>> [i.value for i in wrapped_source.search()]<br /> [2]<br /><br />If vocabulary already provides set of hidden terms they are passed to wrapped vocabulary.<br /><br /> >>> example_vocab.hidden_terms = [1, 2]<br /> >>> wrapped_vocab4 = wrap_vocabulary(example_vocab)(context)<br /> >>> [i.value for i in wrapped_vocab4]<br /> [3, 4]<br /><br />#md5=b4b29dcce788a5d3eb421d2a4330bcc8

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Collectiveelephantvocabulary Context Existing Gtgtgt Hidden Hidden Termscontext Ivalue Listing Original Register Terms Users Vocab Vocabulary Wrap Vocabulary Wrapped Vocab Wrapped Vocab Factor
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


COLLECTIVE.ELEPHANTVOCABULARY RELATED
Networking  -  Terms of Use for WordPress 1.11.3
Require users to accept your Terms and Conditions in several different ways: * On signup page * When submitting a comment * Before accessing a specified page in the back- or front-endIn the back-end, this plugin presents all users except admins...
10 KB  
Modules  -  Indymedia IMC Alba 6.x-1.5
A set of modules intended to make drupal more suited to an open publishing website such as Indymedia. Modules include:Imceditor: allows editors to hide posts and state why, and to vote for articles for promotion to the front page.Newswire: shows...
40.96 KB  
Audio Tools  -  mp3stegz 1.0
mp3stegz is an application that apply steganographic (steganography) algorithm in mp3 files. mp3stegz will maintain original mp3 file's size and sound quality. The hidden message is compressed(zlib) and encrypted(Rijndael).
634.88 KB  
Server Tools  -  JAP / JonDo 00.16.010
JAP Anon Proxy provides the functionality to surf the web without being observed. This means that neither the requested server nor any observer on the Internet can know which user has viewed which web page. JAP has to be installed on the user's...
 
Networking Tools  -  WinPcap 4. 1. 2002
WinPcap is the industry-standard tool for link-layer network access in Windows environments: it allows applications to capture and transmit network packets bypassing the protocol stack, and has additional useful features, including kernel-level...
922 KB  
Content Management  -  Edit-Points 4.0b
This script lets a webdesigner place designed editable areas throughout a new or existing "php" website. These are called "Edit-Points". This allows users to "simply" edit content throughout the site without touching the design or having to know...
1.42 MB  
Content Management  -  Edit-Points for Scripts 4.0b
This script lets a webdesigner place designed editable areas throughout a new or existing "php" website. These are called "Edit-Points". This allows users to "simply" edit content throughout the site without touching the design or having to know...
1.42 MB  
Modules  -  UBB.threads integration 6.x-1.0-beta7
Allows Drupal to manage user accounts for UBB.threads and provide single sign-on. Also includes an importer for bringing existing UBB accounts into Drupal.This module is intended to serve as a bridge for UBB sites to integrate with, or begin...
10 KB  
Modules  -  delicious_taxonomy 6.x-1.0-beta1
This module allow tags from the delicious service to be automatically added ad terms in a vocabulary. It is configurable on a per user basis and works in two independent ways.1. It can add a list of each (enabled) user's delicious tags to an...
10 KB  
Modules  -  Taxonomy Vocabulary Relate 6.x-1.0
This module allows you to select related terms in taxonomy from another vocabulary. The default taxonomy module only allows you to select related terms from the same vocabulary.You setup the vocabulary relationship in the "Settings" fieldset of...
10 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB