Example #1
0
                                                tutorial=tutorial,
                                                order=frontmatter['part'])
                    order.save()

                tutorial.series = series
                tutorial.save()

            if 'track' in frontmatter:
                try:
                    track = Track.objects.get(title=frontmatter['track'])
                except Track.DoesNotExist, e:
                    self.stdout.write('Track "%s" does not exist' %
                                      frontmatter['track'])

                    track = Track(title=frontmatter['track'])
                    track.save()

                tuts = track.tutorial_list()
                if tutorial not in tuts:
                    order = TrackTutorials(track=track,
                                           tutorial=tutorial,
                                           order=frontmatter['track_part'])
                    order.save()

            # Clear the cache for this particular tutorial (if it already existed there)
            # TODO

        self.stdout.write('Next steps:')
        self.stdout.write(' * python mange.py parse_series')
        self.stdout.write(' * python mange.py update_related_tutorials')
Example #2
0
                tuts = series.tutorial_list()
                if tutorial not in tuts:
                    order = TutorialSeriesOrder(series=series, tutorial=tutorial, order=frontmatter['part'])
                    order.save()

                tutorial.series = series
                tutorial.save()

            if 'track' in frontmatter:
                try:
                    track = Track.objects.get(title=frontmatter['track'])
                except Track.DoesNotExist, e:
                    self.stdout.write('Track "%s" does not exist' % frontmatter['track'])

                    track = Track(title=frontmatter['track'])
                    track.save()

                tuts = track.tutorial_list()
                if tutorial not in tuts:
                    order = TrackTutorials(track=track, tutorial=tutorial, order=frontmatter['track_part'])
                    order.save()


            # Clear the cache for this particular tutorial (if it already existed there)
            # TODO


        self.stdout.write('Next steps:')
        self.stdout.write(' * python mange.py parse_series')
        self.stdout.write(' * python mange.py update_related_tutorials')