class stafleave(models.Model):
first_name=models.CharField(max_length=45)
last_name=models.CharField(max_length=45)
leave_type=models.CharField(max_length=45,choices=leave)
start_date=models.DateField()
end_date=models.DateField()
Total_working_Hours=models.IntegerField()
username =models.ForeignKey(User
class leaveform(forms.ModelForm):
start_date = forms.DateField(widget=widgets.AdminDateWidget)
end_date = forms.DateField(widget=widgets.AdminDateWidget)
class Meta:
model=stafleave
template.html
<html>
<head>
<!-- Datepicker-->
<script type="text/javascript" src="/admin/jsi18n/"></script>
<script type="text/javascript" src="/static/admin/js/core.js"></script>
<script type="text/javascript" src="/admin_media/js/admin/RelatedObjectLookups.js"></script>
{{ form.media }}
<!--End Datepicker--
<body>
<form action="" method="post">{%csrf_token%}
<table>
{{form.as_table}}
</table>
<br>
<input type="submit" name="submit" value="Apply for Leave" >
</form>
</div>
</body>
</html>
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPCf-y7PRbbmbM%2BuSSWS7hjBqziDBWRusv7GsmikjqU%2B5hzMuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment