Skip to content

Instantly share code, notes, and snippets.

@justquick
Created April 13, 2010 14:41
Show Gist options
  • Save justquick/364695 to your computer and use it in GitHub Desktop.
Save justquick/364695 to your computer and use it in GitHub Desktop.
In [1]: from ellington.categories.models import Category
In [2]: Category
Out[2]: <class 'ellington.categories.models.Category'>
In [3]: dir(Category)
Out[3]:
['DoesNotExist',
'MultipleObjectsReturned',
'__class__',
'__delattr__',
'__dict__',
'__doc__',
'__eq__',
'__format__',
'__getattribute__',
'__hash__',
'__init__',
'__metaclass__',
'__module__',
'__ne__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'__unicode__',
'__weakref__',
'_base_manager',
'_collect_sub_objects',
'_default_manager',
'_deferred',
'_get_FIELD_display',
'_get_next_or_previous_by_FIELD',
'_get_next_or_previous_in_order',
'_get_pk_val',
'_meta',
'_set_pk_val',
'_tree_manager',
'aliases',
'audioclips',
'childaliases',
'children',
'communitycontent_set',
'delete',
'document_set',
'embedded_set',
'entry_set',
'episode_set',
'excluded_sections',
'framings',
'gallery_set',
'get_all_children',
'get_ancestors',
'get_children',
'get_children_and_aliases',
'get_descendant_count',
'get_descendants',
'get_next_sibling',
'get_parents',
'get_previous_sibling',
'get_rebuilt_slug_path',
'get_root',
'get_siblings',
'hierarchy',
'insert_at',
'is_child_node',
'is_leaf_node',
'is_root_node',
'move_to',
'multimediastory_set',
'newsgroup_set',
'objects',
'parent',
'photos',
'pk',
'prepare_database_save',
'primary_stories',
'refresh_paths',
'save',
'save_base',
'sections',
'serializable_value',
'slugify',
'stories',
'taxonomy_set',
'tree',
'videos',
'videosets']
In [4]: from categories.models import Category
---------------------------------------------------------------------------
AlreadyRegistered Traceback (most recent call last)
/Users/jquick/Projects/Python/twtgit/<ipython console> in <module>()
/Users/jquick/Projects/Python/twtgit/categories/models.py in <module>()
31 def __unicode__(self):
32 ancestors = self.get_ancestors()
33 return ' > '.join([force_unicode(i.name) for i in ancestors]+[self.name,])
34
---> 35 mptt.register(Category, order_insertion_by=['name'])
/Users/jquick/.virtualenvs/twt/src/mptt/mptt/__init__.pyc in register(model, parent_attr, left_attr, right_attr, tree_id_attr, level_attr, tree_manager_attr, order_insertion_by)
AlreadyRegistered: The model Category has already been registered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment