1. Ashutosh Singla
  2. moin-2.0

Commits

Ashutosh Singla  committed 880f995 Draft

Allow possibility of creating item with name u'' (dont allways convert name u'' into namespace_root).

  • Participants
  • Parent commits d274858
  • Branches default

Comments (0)

Files changed (1)

File MoinMoin/items/__init__.py

View file
  • Ignore whitespace
         return cls(*args, **kw)
 
     @classmethod
-    def create(cls, name=u'', itemtype=None, contenttype=None, rev_id=CURRENT, item=None):
+    def create(cls, name=u'', itemtype=None, contenttype=None, rev_id=CURRENT, item=None, set_root=False):
         """
         Create a highlevel Item by looking up :name or directly wrapping
         :item and extract the Revision designated by :rev_id revision.
         fqname = split_fqname(name)
         if fqname.field not in UFIELDS:  # Need a unique key to extract stored item.
             raise FieldNotUniqueError("field {0} is not in UFIELDS".format(fqname.field))
-        if not fqname.value and fqname.field == NAME_EXACT:
+        if set_root and not fqname.value and fqname.field == NAME_EXACT:
             fqname = fqname.get_root_fqname()
 
         rev = get_storage_revision(fqname, itemtype, contenttype, rev_id, item)