# Path: apps/projects/models.py
# class Project(models.Model):
#     name = models.CharField(max_length=100)
#     description = models.TextField()
#     logo = ImageWithThumbsField(upload_to='images/projects', null=True, blank=True, sizes=((200, 200), (90, 90), ))
#     sponsor = models.CharField(max_length=100)
#     github = models.CharField(max_length=80, null=True, blank=True)
#     status = models.CharField(max_length=100, choices=PROJECT_STATES)
#     start_date = models.DateField()
#     end_date = models.DateField(null=True, blank=True)
#     slug = models.SlugField(max_length=100, blank=True)
# 
#     def github_link(self):
#         return "http://github.com/" + self.github
# 
#     def github_feed(self):
#         return self.github_link() + "/commits/master.atom"
# 
# 
#     def finished(self):
#         return self.end_date is not None
# 
#     def __unicode__(self):
#         return self.name
# 
#     def save(self, *args, **kwargs):
#         self.slug = slugify(self.name)
#         if self.finished():
#             self.status = 'finalizado'
#             super(Project, self).save(*args, **kwargs)
#         else:
#             super(Project, self).save(*args, **kwargs)
# 
# Path: apps/tools/models.py
# class Tool(models.Model):
#     name = models.CharField(max_length=100)
#     short_description = models.TextField(max_length=200)
#     description = models.TextField()
#     repository = models.CharField(max_length=100)
#     site = models.CharField(max_length=100)
#     logo = models.ImageField(upload_to='images/tools', null=True, blank=True)
#     status = models.CharField(max_length=100, choices=TOOLS_STATES)
#     highlight = models.BooleanField()
#     relateds_projects = models.ManyToManyField(Project, null=True, blank=True)
#     slug = models.SlugField(max_length=100, blank=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     def save(self, *args, **kwargs):
#         self.slug = slugify(self.name)
#         super(Tool, self).save(*args, **kwargs)


import os
import shutil
from lettuce import step
from model_mommy import mommy
from apps.projects.models import Project
from apps.tools.models import Tool

@step(u'exist a tool:')
def there_exist_a_tool(step):
    for tool_hashes in step.hashes:

# Path: apps/projects/models.py
# class Project(models.Model):
#     name = models.CharField(max_length=100)
#     description = models.TextField()
#     logo = ImageWithThumbsField(upload_to='images/projects', null=True, blank=True, sizes=((200, 200), (90, 90), ))
#     sponsor = models.CharField(max_length=100)
#     github = models.CharField(max_length=80, null=True, blank=True)
#     status = models.CharField(max_length=100, choices=PROJECT_STATES)
#     start_date = models.DateField()
#     end_date = models.DateField(null=True, blank=True)
#     slug = models.SlugField(max_length=100, blank=True)
# 
#     def github_link(self):
#         return "http://github.com/" + self.github
# 
#     def github_feed(self):
#         return self.github_link() + "/commits/master.atom"
# 
# 
#     def finished(self):
#         return self.end_date is not None
# 
#     def __unicode__(self):
#         return self.name
# 
#     def save(self, *args, **kwargs):
#         self.slug = slugify(self.name)
#         if self.finished():
#             self.status = 'finalizado'
#             super(Project, self).save(*args, **kwargs)
#         else:
#             super(Project, self).save(*args, **kwargs)
# 
# Path: apps/tools/models.py
# class Tool(models.Model):
#     name = models.CharField(max_length=100)
#     short_description = models.TextField(max_length=200)
#     description = models.TextField()
#     repository = models.CharField(max_length=100)
#     site = models.CharField(max_length=100)
#     logo = models.ImageField(upload_to='images/tools', null=True, blank=True)
#     status = models.CharField(max_length=100, choices=TOOLS_STATES)
#     highlight = models.BooleanField()
#     relateds_projects = models.ManyToManyField(Project, null=True, blank=True)
#     slug = models.SlugField(max_length=100, blank=True)
# 
#     def __unicode__(self):
#         return self.name
# 
#     def save(self, *args, **kwargs):
#         self.slug = slugify(self.name)
#         super(Tool, self).save(*args, **kwargs)


# Path: apps/tools/features/steps.py
import os
import shutil
from lettuce import step
from model_mommy import mommy
from apps.projects.models import Project
from apps.tools.models import Tool


@step(u'exist a tool:')
def there_exist_a_tool(step):
    for tool_hashes in step.hashes:

        Tool.objects.create(**tool_hashes)