rohitjain-rj / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

Doc: Revision 158 does not match PyPi version 0.1.3 or google code 0.1.3 download #273

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The project home page claims that 0.1.3 is from SVN revision 158 (or did I 
misread that?)

A SVN checkout of rev 158 results in nontrivial differences:

svn checkout http://django-tagging.googlecode.com/svn/trunk/@158 
django-tagging-read-only 

Left base folder: src\django-tagging-r158
Right base folder: src\django-tagging-0.3.1-pypi
--- tagging\models.py   2012-05-30 12:30:26.000000000 -0700
+++ tagging\models.py   2010-01-22 01:39:03.000000000 -0700
@@ -159,14 +159,24 @@

         If ``min_count`` is given, only tags which have a ``count``
         greater than or equal to ``min_count`` will be returned.
         Passing a value for ``min_count`` implies ``counts=True``.
         """

-        extra_joins = ' '.join(queryset.query.get_from_clause()[0][1:])
-        where, params = queryset.query.where.as_sql()
+        if getattr(queryset.query, 'get_compiler', None):
+            # Django 1.2+
+            compiler = queryset.query.get_compiler(using='default')
+            extra_joins = ' '.join(compiler.get_from_clause()[0][1:])
+            where, params = queryset.query.where.as_sql(
+                compiler.quote_name_unless_alias, compiler.connection
+            )
+        else:
+            # Django pre-1.2
+            extra_joins = ' '.join(queryset.query.get_from_clause()[0][1:])
+            where, params = queryset.query.where.as_sql()
+
         if where:
             extra_criteria = 'AND %s' % where
         else:
             extra_criteria = ''
         return self._get_usage(queryset.model, counts, min_count, extra_joins, extra_criteria, params)

Left base folder: src\django-tagging-r158
Right base folder: src\django-tagging-0.3.1-pypi
--- tagging\__init__.py 2012-05-30 12:30:26.000000000 -0700
+++ tagging\__init__.py 2010-01-22 03:31:10.000000000 -0700
@@ -1,30 +1,62 @@
-from django.utils.translation import ugettext as _
+VERSION = (0, 3, 1, "final", 0)

-from tagging.managers import ModelTaggedItemManager, TagDescriptor
+

-VERSION = (0, 3, 'pre')
+def get_version():
+    if VERSION[3] == "final":
+        return "%s.%s.%s" % (VERSION[0], VERSION[1], VERSION[2])
+    elif VERSION[3] == "dev":
+        if VERSION[2] == 0:
+            return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[3], 
VERSION[4])
+        return "%s.%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], 
VERSION[3], VERSION[4])
+    else:
+        return "%s.%s.%s%s" % (VERSION[0], VERSION[1], VERSION[2], VERSION[3])

+
+__version__ = get_version()
+
+
 class AlreadyRegistered(Exception):
     """
     An attempt was made to register a model more than once.
     """
     pass

+
 registry = []

+
 def register(model, tag_descriptor_attr='tags',
              tagged_item_manager_attr='tagged'):
     """
     Sets the given model class up for working with tags.
     """
+
+    from tagging.managers import ModelTaggedItemManager, TagDescriptor
+
     if model in registry:
-        raise AlreadyRegistered(
-            _('The model %s has already been registered.') % model.__name__)
-    registry.append(model)
+        raise AlreadyRegistered("The model '%s' has already been "
+            "registered." % model._meta.object_name)
+    if hasattr(model, tag_descriptor_attr):
+        raise AttributeError("'%s' already has an attribute '%s'. You must "
+            "provide a custom tag_descriptor_attr to register." % (
+                model._meta.object_name,
+                tag_descriptor_attr,
+            )
+        )
+    if hasattr(model, tagged_item_manager_attr):
+        raise AttributeError("'%s' already has an attribute '%s'. You must "
+            "provide a custom tagged_item_manager_attr to register." % (
+                model._meta.object_name,
+                tagged_item_manager_attr,
+            )
+        )

     # Add tag descriptor
     setattr(model, tag_descriptor_attr, TagDescriptor())

     # Add custom manager
-    ModelTaggedItemManager().contribute_to_class(model,
-                                                 tagged_item_manager_attr)
+    ModelTaggedItemManager().contribute_to_class(model, 
tagged_item_manager_attr)
+
+    # Finally register in registry
+    registry.append(model)

Which SVN revision best matches the  0.1.3 download available on PyPi?

Original issue reported on code.google.com by inactiv...@gmail.com on 30 May 2012 at 11:23

GoogleCodeExporter commented 9 years ago
There are other differences (docs/overview.txt, tests/settings.py, 
tests/tests.py, etc.) 

Original comment by inactiv...@gmail.com on 30 May 2012 at 11:29