forms.py 728 Bytes
Newer Older
Daniel W Bond's avatar
Daniel W Bond committed
1
2
3
4
5
6
from django import forms
from django.db import models
from django.core.exceptions import ValidationError
from django.forms import ModelForm, Select
from trajectories.models import Trajectory

Daniel W Bond's avatar
Daniel W Bond committed
7
8
9
10
11
12
13
14
15
16
17
18
19
from haystack.forms import SearchForm

class StyledSeachForm( SearchForm ):
    q = forms.CharField(
        required = False,
	label = 'Search',
	widget = forms.TextInput(attrs={
	    'class' : 'form-control',
	    'placeholder' : 'Search',
	    'autofocus' : 'autofocus',
        }),
    )

Daniel W Bond's avatar
Daniel W Bond committed
20
21
22
23
24
25
26
27
28
29
30
31
32
class NewTrajectoryForm( ModelForm ):
    # def __init__(self, *args, **kwargs):

    class Meta:
        model = Trajectory
        fields = (
        )
        exclude = (
        )
        labels = {
        }
        widgets = {
        }