# Path: brasilcomvc/projects/models.py
# class ProjectApply(models.Model):
# 
#     volunteer = models.ForeignKey(
#         settings.AUTH_USER_MODEL, related_name='applications', editable=False)
#     project = models.ForeignKey(
#         'Project', related_name='applications', editable=False)
#     message = models.TextField()
#     created = models.DateTimeField(auto_now_add=True)
# 
#     volunteer.verbose_name = 'voluntário'
#     project.verbose_name = 'projeto'
#     message.verbose_name = 'mensagem ao organizador'
#     message.help_text = 'Conte-nos brevemente como você pode ajudar.'
#     created.verbose_name = 'hora do registro'
# 
#     class Meta:
#         unique_together = ('project', 'volunteer',)
#         verbose_name = 'inscrição em projeto'
#         verbose_name_plural = 'inscrições em projetos'
# 
#     def __str__(self):
#         return '{}: {}'.format(self.project.name, self.volunteer.full_name)
# 
#     def _get_email_context(self):
#         return {
#             attr: getattr(self, attr)
#             for attr in ('message', 'project', 'volunteer',)}
# 
#     def send_owner_email(self):
#         send_template_email(
#             subject='Alguém se inscreveu no seu projeto!',
#             to=self.project.owner.email,
#             template_name='emails/project_apply_owner.html',
#             context=self._get_email_context())
# 
#     def send_volunteer_email(self):
#         send_template_email(
#             subject='Você se inscreveu num projeto!',
#             to=self.volunteer.email,
#             template_name='emails/project_apply_volunteer.html',
#             context=self._get_email_context())


from django import forms
from .models import ProjectApply
# coding: utf8
from __future__ import unicode_literals




class ProjectApplyForm(forms.ModelForm):

    class Meta:

# Path: brasilcomvc/projects/models.py
# class ProjectApply(models.Model):
# 
#     volunteer = models.ForeignKey(
#         settings.AUTH_USER_MODEL, related_name='applications', editable=False)
#     project = models.ForeignKey(
#         'Project', related_name='applications', editable=False)
#     message = models.TextField()
#     created = models.DateTimeField(auto_now_add=True)
# 
#     volunteer.verbose_name = 'voluntário'
#     project.verbose_name = 'projeto'
#     message.verbose_name = 'mensagem ao organizador'
#     message.help_text = 'Conte-nos brevemente como você pode ajudar.'
#     created.verbose_name = 'hora do registro'
# 
#     class Meta:
#         unique_together = ('project', 'volunteer',)
#         verbose_name = 'inscrição em projeto'
#         verbose_name_plural = 'inscrições em projetos'
# 
#     def __str__(self):
#         return '{}: {}'.format(self.project.name, self.volunteer.full_name)
# 
#     def _get_email_context(self):
#         return {
#             attr: getattr(self, attr)
#             for attr in ('message', 'project', 'volunteer',)}
# 
#     def send_owner_email(self):
#         send_template_email(
#             subject='Alguém se inscreveu no seu projeto!',
#             to=self.project.owner.email,
#             template_name='emails/project_apply_owner.html',
#             context=self._get_email_context())
# 
#     def send_volunteer_email(self):
#         send_template_email(
#             subject='Você se inscreveu num projeto!',
#             to=self.volunteer.email,
#             template_name='emails/project_apply_volunteer.html',
#             context=self._get_email_context())


# Path: brasilcomvc/projects/forms.py
from django import forms
from .models import ProjectApply

# coding: utf8
from __future__ import unicode_literals




class ProjectApplyForm(forms.ModelForm):

    class Meta:

        model = ProjectApply