SHARE
TWEET

Untitled

a guest Jun 29th, 2017 55 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.  
  17.  
  18. ----FORM
  19. class FullSeekerProfileForm(forms.ModelForm):
  20.     DAY_CHOICES = [('Mon', 'Mon'), ('Tue', 'Tue'), ('Wed', 'Wed'), ('Thur', 'Thur'), ('Fri', 'Fri'), ('Sat', 'Sat'), ('Sun', 'Sun')]
  21.     HOUR_CHOICES = [('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ('7', '7'), ('8', '8')]
  22.     skills = forms.CharField(widget=forms.Textarea(attrs={'rows': 3, 'cols': 22, 'placeholder': 'Skills', 'class': 'form-control'}))
  23.     experience = forms.CharField(widget=forms.Textarea(attrs={'rows': 3, 'cols': 22, 'placeholder': 'Experience', 'class': 'form-control'}))
  24.     free_days = forms.MultipleChoiceField(choices=DAY_CHOICES, widget=forms.CheckboxSelectMultiple())
  25.     free_hours = forms.ChoiceField(choices=HOUR_CHOICES, widget=forms.Select())
  26. class Meta:
  27.         model = Profile
  28.         fields = ('free_hours', 'free_days', 'experience', 'skills')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top