Guest User

SkillsDjango

a guest
Jun 29th, 2017
62
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ------MODEL
  2. class Profile(models.Model):
  3. user = models.OneToOneField(User, on_delete=models.CASCADE)
  4. Seeker = 'Seeker'
  5. Poster = 'Poster'
  6. USER_TYPE_CHOICES = ((Poster, 'Poster'), (Seeker, 'Seeker'))
  7. user_type = models.CharField(max_length=6, choices=USER_TYPE_CHOICES, default=Seeker)
  8. user_active = models.BooleanField(default=False)
  9. created_date = models.DateTimeField(default=timezone.now)
  10. experience = models.TextField(blank=True, max_length=1000)
  11. skills = models.TextField(blank=True, max_length=300)
  12. free_hours = models.CharField(blank=True, max_length=50)
  13. free_days = models.CharField(blank=True, max_length=100)
  14. stand_by = models.BooleanField(default=False)
  15.  
  16. ----FORM
  17. class FullSeekerProfileForm(forms.ModelForm):
  18. DAY_CHOICES = [('Mon', 'Mon'), ('Tue', 'Tue'), ('Wed', 'Wed'), ('Thur', 'Thur'), ('Fri', 'Fri'), ('Sat', 'Sat'), ('Sun', 'Sun')]
  19. HOUR_CHOICES = [('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8')]
  20. skills = forms.CharField(widget=forms.Textarea(attrs={'rows': 3, 'cols': 22, 'placeholder': 'Skills', 'class': 'form-control'}))
  21. experience = forms.CharField(widget=forms.Textarea(attrs={'rows': 3, 'cols': 22, 'placeholder': 'Experience', 'class': 'form-control'}))
  22. free_days = forms.MultipleChoiceField(choices=DAY_CHOICES, widget=forms.CheckboxSelectMultiple())
  23. free_hours = forms.ChoiceField(choices=HOUR_CHOICES, widget=forms.Select())
RAW Paste Data