예제 #1
0
파일: views.py 프로젝트: KentZiqi/OFiction
 def form_valid(self, form):
     user = self.request.user
     profile = Profile.objects.get(user=user)
     self.object = form.save(commit=False)
     self.object.starter = profile
     self.object.save()
     root = Episode(fiction=self.object, title="Edit Me", summary="Add your summary here", author=profile)
     root.save()
     fiction = Fiction.objects.get(pk=self.object.pk)
     fiction.root = root
     fiction.save()
     return HttpResponseRedirect(self.get_success_url())
예제 #2
0
    def one_show(self, show):
        sched = """09:30 Morning Tea available on arrival
10:00 ACQA - 'Yesterday, Today and Tomorrow '
10:45 Michael Peachy & Nick Heywood Wellness & Lifestyle
11:30 Nigel Langes - The 'Planting Seeds' Project; a mindset, a philosophy and a shared vision .
12:15 Lunch
13.00 ACQA AGM
13:15 Guest Speaker - Guild Insurance - 'Risk Management'
14:00 Caroline Lee - LeeCarePlus - 'Preparation for an interface with ACQA'
14:30 Kim Densham Rytec 'Computerised Rostering'
15:00 Chris McCann - TAFE '2010 - Aged Care Education Options'
15.30 Terry Wilby - Forum Close - ACQA Chairperson"""
        eps = []
        for row in sched.split('\n'):
            eps.append({'name':row[5:], 'start': \
                datetime.datetime(2009, 10, 2, int(row[0:2]), int(row[3:5]))})

# set the end times to the start of the next event.  close enough.
        for i in range(len(eps) - 1):
            eps[i]['end'] = eps[i + 1]['start']


# "finishing at 15:45pm"
        eps[-1]['end'] = datetime.datetime(2009, 10, 2, 15, 45)

        seq = 0
        for row in eps:
            seq += 1

            room = "Arkaba"
            location, created = Location.objects.get_or_create(
                show=show, name=room, slug=process.fnify(room))

            ep = Episode(sequence=seq,
                         location=location,
                         name=row['name'],
                         slug=process.fnify(row['name']),
                         start=row['start'],
                         end=row['end'],
                         state=self.state_done)
            if self.options.verbose:
                print ep.__dict__
            ep.save()
예제 #3
0
    def one_show(self, show):
        sched = """09:30 Morning Tea available on arrival
10:00 ACQA - 'Yesterday, Today and Tomorrow '
10:45 Michael Peachy & Nick Heywood Wellness & Lifestyle
11:30 Nigel Langes - The 'Planting Seeds' Project; a mindset, a philosophy and a shared vision .
12:15 Lunch
13.00 ACQA AGM
13:15 Guest Speaker - Guild Insurance - 'Risk Management'
14:00 Caroline Lee - LeeCarePlus - 'Preparation for an interface with ACQA'
14:30 Kim Densham Rytec 'Computerised Rostering'
15:00 Chris McCann - TAFE '2010 - Aged Care Education Options'
15.30 Terry Wilby - Forum Close - ACQA Chairperson"""
        eps = []
        for row in sched.split("\n"):
            eps.append({"name": row[5:], "start": datetime.datetime(2009, 10, 2, int(row[0:2]), int(row[3:5]))})

        # set the end times to the start of the next event.  close enough.
        for i in range(len(eps) - 1):
            eps[i]["end"] = eps[i + 1]["start"]
        # "finishing at 15:45pm"
        eps[-1]["end"] = datetime.datetime(2009, 10, 2, 15, 45)

        seq = 0
        for row in eps:
            seq += 1

            room = "Arkaba"
            location, created = Location.objects.get_or_create(show=show, name=room, slug=process.fnify(room))

            ep = Episode(
                sequence=seq,
                location=location,
                name=row["name"],
                slug=process.fnify(row["name"]),
                start=row["start"],
                end=row["end"],
                state=self.state_done,
            )
            if self.options.verbose:
                print ep.__dict__
            ep.save()