:category: Development
:date: 2011-10-26 06:53
+:tags: git
Ten months ago, I started to look at other version control systems because I was fed up with the Subversion centralized model. It tested Git, Mercurial, Bazaar, etc.. Bazaar was the good choice because it allowed the dev teams to make branches easily in a decentralized environment, to push commits to the old subversion repository, to keep an easy syntax, etc...
corpus_id = slugify(unicode(corpus_name))
collection_id = corpus_id + '_' + slugify(unicode(collection_name))
item_id = collection_id + '_' + slugify(unicode(item_name))
-
+
cc = MediaCorpus.objects.filter(code=corpus_id)
if cc:
corpus = cc[0]
def get_filename(object):
if isinstance(object, unicode):
return object.split('/')[-1]
- elif object.path:
+ elif hasattr(object, 'path'):
return object.path.split(os.sep)[-1]
else:
return ''
# get item with one of its given marker_id
if not public_id and marker_id:
- marker = MediaItemMarker.objects.get(public_id=marker_id)
+ marker = get_object_or_404(MediaItemMarker, public_id=marker_id)
item_id = marker.item_id
item = MediaItem.objects.get(id=item_id)
else:
- item = MediaItem.objects.get(public_id=public_id)
+ item = get_object_or_404(MediaItem, public_id=public_id)
access = get_item_access(item, request.user)