#17754: Django GIS Measure refactor
------------------------------------+--------------------
     Reporter:  riccardodivirgilio  |      Owner:  nobody
         Type:  Uncategorized       |     Status:  new
    Component:  GIS                 |    Version:  SVN
     Severity:  Normal              |   Keywords:
 Triage Stage:  Unreviewed          |  Has patch:  0
Easy pickings:  0                   |      UI/UX:  0
------------------------------------+--------------------
 hi, the class MeasureBase in django.contrib.gis.measure is not
 subclassable.

 i've write a new code, that allows the very same API, but it can be
 subclassed with no pain

 the new code is one hundred line shorter, and is DRY.

 in the old code the class Area and the class Distance write the same
 methods every time.

 i've pushed a lot of base methods (like __repr__, __init__, __sub__,
 __add__, ...) in the base class, and i've defined just __molt__ for the
 new Distance class and __div__ for the new Area class.

 Please consider to include this code in the django 1.4 version.

 I've tested it and it works like the old version, but now you can create a
 new class for Weight with no method definition, just unit definition.

 if you want i can write standard measure for every measure and we can put
 it inside localflavor...

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17754>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to