# Path: wireframes/models.py
# class Wireframe(models.Model):
#     """(Project description)"""
# 
#     author = models.ForeignKey(User, null=True)
#     project = models.ForeignKey(Project, null=True)
#     name = models.CharField(blank=False, max_length=255)
#     creation_date = models.DateTimeField(auto_now=True)
#     #model = models.ForeignKey(Wireframe, null=True)
#     grid_width = models.PositiveIntegerField(default="50")
#     grid_spacing = models.PositiveIntegerField(default="10")
#     grid_columns = models.PositiveIntegerField(default="16")
# 
#     def total_width(self):
#         return (self.grid_columns * self.grid_width) + (self.grid_spacing *
#                                         (self.grid_columns-1))
# 
# 
#     def __str__(self):
#         return "wireframe %s %d" % (self.name, self.id)
# 
#     def save(self):
#         super(Wireframe, self).save()
# 
# class Project(models.Model):
#     """(Project description)"""
# 
#     admin = models.ForeignKey(User, related_name='selfs_as_admin', null=True)
#     members = models.ManyToManyField(User, related_name='selfs_as_member')
# 
#     name = models.CharField(blank=False, max_length=255)
#     grid_width = models.PositiveIntegerField(default="50")
#     grid_spacing = models.PositiveIntegerField(default="10")
#     grid_columns = models.PositiveIntegerField(default="16")
# 
#     def total_width(self):
#         return self.grid_columns * self.grid_width + (self.grid_spacing * self.grid_columns-1)
# 
#     def __str__(self):
#         return "%s" % (self.name)
# 
#     def get_absolute_url(self):
#         return 'not done'
# 
#     def save(self):
#         super(Project, self).save()


from wireframes.models import Wireframe, Project
from django.forms import ModelForm
from django import forms

"""class CreateWireframeForm(DecoratingModelForm):
    class Meta:
        model=Wireframe
        fields=('name', 'project')"""

class CreateWireframeForm(ModelForm):
    name = forms.CharField(initial="New wireframe")
    grid_width = forms.IntegerField(min_value=12, initial=70)
    grid_spacing = forms.IntegerField(min_value=0, initial=10)
    grid_columns = forms.IntegerField(min_value=1, max_value=100, initial=12)
    class Meta:
        model=Wireframe
        fields=('name', 'grid_width', 'grid_spacing', 'grid_columns')

class CreateProjectForm(ModelForm):
    name = forms.CharField(initial="boum")
    grid_width = forms.IntegerField(min_value=12)
    grid_spacing = forms.IntegerField(min_value=0)
    grid_columns = forms.IntegerField(min_value=1, max_value=100)

# Path: wireframes/models.py
# class Wireframe(models.Model):
#     """(Project description)"""
# 
#     author = models.ForeignKey(User, null=True)
#     project = models.ForeignKey(Project, null=True)
#     name = models.CharField(blank=False, max_length=255)
#     creation_date = models.DateTimeField(auto_now=True)
#     #model = models.ForeignKey(Wireframe, null=True)
#     grid_width = models.PositiveIntegerField(default="50")
#     grid_spacing = models.PositiveIntegerField(default="10")
#     grid_columns = models.PositiveIntegerField(default="16")
# 
#     def total_width(self):
#         return (self.grid_columns * self.grid_width) + (self.grid_spacing *
#                                         (self.grid_columns-1))
# 
# 
#     def __str__(self):
#         return "wireframe %s %d" % (self.name, self.id)
# 
#     def save(self):
#         super(Wireframe, self).save()
# 
# class Project(models.Model):
#     """(Project description)"""
# 
#     admin = models.ForeignKey(User, related_name='selfs_as_admin', null=True)
#     members = models.ManyToManyField(User, related_name='selfs_as_member')
# 
#     name = models.CharField(blank=False, max_length=255)
#     grid_width = models.PositiveIntegerField(default="50")
#     grid_spacing = models.PositiveIntegerField(default="10")
#     grid_columns = models.PositiveIntegerField(default="16")
# 
#     def total_width(self):
#         return self.grid_columns * self.grid_width + (self.grid_spacing * self.grid_columns-1)
# 
#     def __str__(self):
#         return "%s" % (self.name)
# 
#     def get_absolute_url(self):
#         return 'not done'
# 
#     def save(self):
#         super(Project, self).save()


# Path: wireframes/forms.py
from wireframes.models import Wireframe, Project
from django.forms import ModelForm
from django import forms


"""class CreateWireframeForm(DecoratingModelForm):
    class Meta:
        model=Wireframe
        fields=('name', 'project')"""

class CreateWireframeForm(ModelForm):
    name = forms.CharField(initial="New wireframe")
    grid_width = forms.IntegerField(min_value=12, initial=70)
    grid_spacing = forms.IntegerField(min_value=0, initial=10)
    grid_columns = forms.IntegerField(min_value=1, max_value=100, initial=12)
    class Meta:
        model=Wireframe
        fields=('name', 'grid_width', 'grid_spacing', 'grid_columns')

class CreateProjectForm(ModelForm):
    name = forms.CharField(initial="boum")
    grid_width = forms.IntegerField(min_value=12)
    grid_spacing = forms.IntegerField(min_value=0)
    grid_columns = forms.IntegerField(min_value=1, max_value=100)

    class Meta: