# Path: pytask/taskapp/models.py
# class Task(models.Model):
# 
#     parent = models.ForeignKey('self', blank=True, null=True,
#                                related_name="children_tasks")
# 
#     title = models.CharField(
#       max_length=1024, verbose_name=u"Title",
#       help_text=u"Keep it simple and below 100 chars.")
# 
#     desc = models.TextField(verbose_name=u"Description")
# 
#     status = models.CharField(max_length=255,
#                               choices=TASK_STATUS_CHOICES,
#                               default="Unpublished")
# 
#     tags_field = TagField(
#       verbose_name=u"Tags", help_text=u"Give tags separated by commas. "
#       "The allowed characters are all alphabet, numbers, underscore(_), "
#       "period(.), forward slash(/), dash(-), ampersand(&), single quote(') "
#       " and space.")
# 
#     pynts = models.PositiveSmallIntegerField(
#       help_text=u"Number of Pynts a user gets on completing the task")
# 
#     created_by = models.ForeignKey(User,
#                                    related_name="created_tasks")
# 
#     approved_by = models.ForeignKey(User, blank=True, null=True,
#                                     related_name="approved_tasks")
# 
#     reviewers = models.ManyToManyField(User, blank=True, null=True,
#                                        related_name="reviewing_tasks")
# 
#     claimed_users = models.ManyToManyField(User, blank=True, null=True, 
#                                            related_name="claimed_tasks")
# 
#     selected_users = models.ManyToManyField(User, blank=True, null=True, 
#                                             related_name="selected_tasks")
# 
#     creation_datetime = models.DateTimeField(auto_now_add=True)
# 
#     approval_datetime = models.DateTimeField(blank=True, null=True)
# 
#     last_modified = models.DateTimeField(auto_now=True,
#                                          default=datetime.now())
# 
#     def __unicode__(self):
#         return unicode(self.title)


from tagging.managers import TaggedItem
from pytask.taskapp.models import Task
# PyTask is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PyTask is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.

# You should have received a copy of the GNU General Public License
# along with PyTask.  If not, see <http://www.gnu.org/licenses/>.


"""Helper script that contains many utilities.
"""


__authors__ = [
  '"Madhusudan.C.S" <madhusudancs@gmail.com>',
  ]





def remove_textbook_from_chapter():
    """Removes the tag Textbook from Chapter.
    """


# Path: pytask/taskapp/models.py
# class Task(models.Model):
# 
#     parent = models.ForeignKey('self', blank=True, null=True,
#                                related_name="children_tasks")
# 
#     title = models.CharField(
#       max_length=1024, verbose_name=u"Title",
#       help_text=u"Keep it simple and below 100 chars.")
# 
#     desc = models.TextField(verbose_name=u"Description")
# 
#     status = models.CharField(max_length=255,
#                               choices=TASK_STATUS_CHOICES,
#                               default="Unpublished")
# 
#     tags_field = TagField(
#       verbose_name=u"Tags", help_text=u"Give tags separated by commas. "
#       "The allowed characters are all alphabet, numbers, underscore(_), "
#       "period(.), forward slash(/), dash(-), ampersand(&), single quote(') "
#       " and space.")
# 
#     pynts = models.PositiveSmallIntegerField(
#       help_text=u"Number of Pynts a user gets on completing the task")
# 
#     created_by = models.ForeignKey(User,
#                                    related_name="created_tasks")
# 
#     approved_by = models.ForeignKey(User, blank=True, null=True,
#                                     related_name="approved_tasks")
# 
#     reviewers = models.ManyToManyField(User, blank=True, null=True,
#                                        related_name="reviewing_tasks")
# 
#     claimed_users = models.ManyToManyField(User, blank=True, null=True, 
#                                            related_name="claimed_tasks")
# 
#     selected_users = models.ManyToManyField(User, blank=True, null=True, 
#                                             related_name="selected_tasks")
# 
#     creation_datetime = models.DateTimeField(auto_now_add=True)
# 
#     approval_datetime = models.DateTimeField(blank=True, null=True)
# 
#     last_modified = models.DateTimeField(auto_now=True,
#                                          default=datetime.now())
# 
#     def __unicode__(self):
#         return unicode(self.title)


# Path: scripts/utils.py
from tagging.managers import TaggedItem
from pytask.taskapp.models import Task

# PyTask is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# PyTask is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.

# You should have received a copy of the GNU General Public License
# along with PyTask.  If not, see <http://www.gnu.org/licenses/>.


"""Helper script that contains many utilities.
"""


__authors__ = [
  '"Madhusudan.C.S" <madhusudancs@gmail.com>',
  ]





def remove_textbook_from_chapter():
    """Removes the tag Textbook from Chapter.
    """


    tasks = TaggedItem.objects.get_by_model(Task, 'Chapter')