Here are the examples of the python api django.utils.six.moves.builtins.range taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
Example 1
Project: django-scheduler Source File: scheduletags.py
def _cook_slots(period, increment):
"""
Prepare slots to be displayed on the left hand side
calculate dimensions (in px) for each slot.
Arguments:
period - time period for the whole series
increment - slot size in minutes
"""
tdiff = datetime.timedelta(minutes=increment)
num = int((period.end - period.start).total_seconds()) // int(tdiff.total_seconds())
s = period.start
slots = []
for i in range(num):
sl = period.get_time_slot(s, s + tdiff)
slots.append(sl)
s = s + tdiff
return slots
0
Example 2
Project: django-scheduler Source File: test_periods.py
def test_get_months(self):
months = self.year.get_months()
self.assertEqual([month.start for month in months],
[datetime.datetime(2008, i, 1, tzinfo=pytz.utc) for i in range(1,13)])