Francesco Banconi avatar Francesco Banconi committed c5b14a7 Merge

Merged branch 0.8.

Comments (0)

Files changed (6)

doc/changelog.rst

 versioni di FreeSIS.
 
 
+Versione 0.8
+~~~~~~~~~~~~
+
+- Risolto un bug nella gestione della cache Python che provocava un errore
+  *404* inatteso nella pagina dettaglio membership.
+
+- Corretto un errore di battitura nel pdf della pagella.
+
+- Aggiunto, nella pagella, lo spazio dedicato al genitore.
+
+
 Versione 0.7
 ~~~~~~~~~~~~
 
 # built documents.
 #
 # The short X.Y version.
-version = '0.7'
+version = '0.8'
 # The full version, including alpha/beta/rc tags.
-release = '0.7'
+release = '0.8'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

myproject/__init__.py

-VERSION = (0, 7)
+VERSION = (0, 8)
 
 def get_version():
     version = '%s.%s' % (VERSION[0], VERSION[1])

myproject/courses/models.py

     """
     A school year, divided in periods.
     """
-    year = models.PositiveIntegerField(u'anno scolastico', 
+    year = models.PositiveIntegerField(u'anno scolastico',
         choices=YEAR_CHOICES, default=utils.default_year, unique=True)
 
     # custom manager
 
     def is_assessment_done(self):
         """
-        Return True if at least one assessment was done in the past 
+        Return True if at least one assessment was done in the past
         for this year.
         """
         return any(i.is_assessment_done() for i in self.get_periods())
         """
         Return a list (memoized) of all periods of this year.
         """
-        return utils.get_periods_for(self)
+        return list(self.periods.select_related('year'))
 
     def get_num_periods(self):
         """
 
 class Period(models.Model):
     """
-    A school period. 
-    Usually each year has 2 or 3 associated periods 
+    A school period.
+    Usually each year has 2 or 3 associated periods
     depending if they are 4 months or 3 months periods.
     """
     name = models.CharField(u'nome', max_length=4, choices=NAME_CHOICES)
-    year = models.ForeignKey(Year, 
+    year = models.ForeignKey(Year,
         verbose_name=Year._meta.verbose_name, related_name='periods')
 
     start_date = models.DateField(u'data di inizio')
     """
     A course is a klass during a scholastic year, e.g: 4A 2011/12...
     """
-    klass = models.ForeignKey(Klass, 
+    klass = models.ForeignKey(Klass,
         verbose_name=Klass._meta.verbose_name, related_name='courses')
-    year = models.ForeignKey(Year, 
+    year = models.ForeignKey(Year,
         verbose_name=Year._meta.verbose_name, related_name='courses')
 
-    fields = models.ManyToManyField(Field, blank=True, null=True, 
+    fields = models.ManyToManyField(Field, blank=True, null=True,
         verbose_name=Field._meta.verbose_name_plural, related_name="courses")
 
     # custom manager
 
     def is_assessment_done(self):
         """
-        Return True if at least one assessment was done in the past 
+        Return True if at least one assessment was done in the past
         for this course.
         """
         return self.year.is_assessment_done()
     @property
     def studies(self):
         """
-        Return a study manager in order to handle studies 
+        Return a study manager in order to handle studies
         (field-course couples) associated with this course.
         """
         from myproject.studies.managers import StudyManager

myproject/courses/utils.py

 import datetime
 
-from django.utils.functional import memoize
-
 class YearChoices(object):
     """
     Used to provide dynamic year's choices to the *Course* model.
-    """ 
+    """
     def __init__(self, starting_year=2010):
         self.starting_year = starting_year
         self.years_from_now = 2
     Return the year (as integer) to use as default value in the *Course* model.
     """
     return datetime.date.today().year + 1
-
-get_periods_for_cache = {}
-def get_periods_for(year):
-    """
-    Return all the periods for the given year as a list.
-    This is a helper function that memoizes the periods.
-    """
-    return list(year.periods.select_related('year'))
-get_periods_for = memoize(get_periods_for, get_periods_for_cache, 1)

templates/assessments/membership_detail_pdf.html

     {# FIXME: use css #}
     <span>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+        Il Dirigente Scolastico
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-        Il Dirigente Scolatico
+        Il genitore o chi ne fa le veci
     </span>
 {% endblock %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.