Ejemplo n.º 1
0
    class Meta:
        model = DonorProfile

        fields = (
            "first_name",
            "last_name",
            "mobile_number",
            "birth_date",
            "location",
            "date_last_tested_negative",
            "last_covid_report",
            "igg_report",
        )
        widgets = {
            "birth_date":
            MyDateInput(attrs={
                "class": "textbox",
                "placeholder": "Date of Birth"
            }),
            "date_last_tested_negative":
            MyDateInput(
                attrs={
                    "class": "textbox",
                    "placeholder": "Date Last COVID19 Negative Test Report",
                }),
            "location":
            GooglePointFieldWidget(),
        }
Ejemplo n.º 2
0
 class Meta:
     model=Patient
     fields = ['first_name', 'last_name', 'dob','sex', 'telno', 'address']
     widgets = {
         'patient_dob': DatePickerInput(),
         'address': GooglePointFieldWidget()
     }
Ejemplo n.º 3
0
 class Meta:
     model = BookLocation
     fields = "__all__"
     widgets = {
         'geom':
         GooglePointFieldWidget(
             settings={"GooglePointFieldWidget": (("zoom", 8), )}),
     }
Ejemplo n.º 4
0
class CompanyAdmin(admin.ModelAdmin):
    list_display = ['name', 'position', 'active', 'rating']
    readonly_fields = ['rating']
    formfield_overrides = {
        gis_models.PointField: {
            "widget": GooglePointFieldWidget(settings=settings.MAP_WIDGETS)
        }
    }
Ejemplo n.º 5
0
 class Meta:
     model = OwnerPlaceDateLived
     fields = "__all__"
     widgets = {
         'geom':
         GooglePointFieldWidget(
             settings={"GooglePointFieldWidget": (("zoom", 8), )}),
     }
Ejemplo n.º 6
0
 class Meta:
     model = HospitalProfile
     fields = (
         "contact_person_name",
         "contact_person_mobile_number",
         "location",
     )
     widgets = {
         "location": GooglePointFieldWidget(),
     }
Ejemplo n.º 7
0
 class Meta:
     model = House
     fields = "__all__"
     widgets = {
         'location':
         GooglePointFieldWidget(
             settings={"GooglePointFieldWidget": (("zoom", 1), )}),
         'location_has_default':
         GooglePointFieldWidget,
     }
Ejemplo n.º 8
0
 class Meta:
     model = City
     fields = "__all__"
     widgets = {
         'coordinates':
         GooglePointFieldWidget(
             settings={"GooglePointFieldWidget": (("zoom", 1), )}),
         'city_hall':
         GooglePointFieldWidget,
     }
Ejemplo n.º 9
0
class GenericAdmin(admin.ModelAdmin):
    exclude = ('slug', )

    formfield_overrides = {
        django_models.DateTimeField: {
            'widget': MyDate
        },
        gis_models.PointField: {
            "widget": GooglePointFieldWidget(attrs={'autocomplete': 'off'})
        },
    }
Ejemplo n.º 10
0
 class Meta:
     model = Lugar
     fields = '__all__'
     widgets = {
         'punto': GooglePointFieldWidget(
             settings={
                 "GooglePointFieldWidget": (
                     ("zoom", 8),
                     ("mapCenterLocation", [14.642213, -90.516653]),
                 )
             }
         )
     }
Ejemplo n.º 11
0
    class Meta:
        model = Port
        fields = ['name', 'position', 'country', 'shipyard']

        widgets = {
            'position':
            GooglePointFieldWidget(
                attrs={
                    'display_wkt': True,
                    'map_srid': 4326,
                    'map_width': 700,
                    'map_height': 500,
                })
        }
Ejemplo n.º 12
0
    class Meta:
        model = Waypoint
        fields = '__all__'

        widgets = {
            'position':
            GooglePointFieldWidget(
                attrs={
                    'display_wkt': True,
                    'map_srid': 4326,
                    'map_width': 700,
                    'map_height': 500,
                }),
            'time':
            DateTimeWidget(attrs={'id': "waypoint_time"}),
        }
Ejemplo n.º 13
0
class PatientProfileForm(forms.ModelForm):

    first_name = forms.CharField()
    last_name= forms.CharField()
    sex = forms.ChoiceField(choices = SEX)
    dob = forms.DateField(widget=DatePickerInput)
    tel_no = PhoneNumberField(required = False)
    nhs_no = forms.CharField(required = False)
    flat_no = forms.CharField(required = False)
    address = forms.CharField(widget=GooglePointFieldWidget())    
    
    class Meta:
        model = Patient
        exclude = ('baseuser','weight', 'height')
        #using the address widget
        widgets = {
            'address': GooglePointFieldWidget,
        }
Ejemplo n.º 14
0
class LocationAdmin(admin.ModelAdmin):
    list_display = ('name', )
    #MultiDwellingUnit.import_all()

    #def package(self, obj):
    #    return obj.service_profile_name

    #Order.import_all_orders()
    formfield_overrides = {
        models.PointField: {
            "widget": GooglePointFieldWidget(settings=CUSTOM_MAP_SETTINGS)
        },
        models.MultiPolygonField: {
            "widget":
            MultiPolygonWidget(attrs={
                "default_zoom": 19,
                "default_lon": 20,
                "default_lat": 20
            })
        }
    }
Ejemplo n.º 15
0
class PatientSignupForm(forms.Form):

    patient_first_name = forms.CharField(label='First Name', max_length=30, required=True, strip=True)
    patient_second_name =  forms.CharField(label='Last Name', max_length=30, required=True, strip=True)
    patient_sex = forms.ChoiceField(label='Sex', choices = SEX)
    patient_dob = forms.DateField(label='Date of Birth', widget=DatePickerInput())
    patient_telno = PhoneNumberField(label='Telephone Number', required=True, strip=True)
    address = forms.CharField(label='Address', max_length=256, widget=GooglePointFieldWidget() )

    class Meta:
        model=Patient
        fields = ['first_name', 'last_name', 'dob','sex', 'telno', 'address']
        widgets = {
            'patient_dob': DatePickerInput(),
            'address': GooglePointFieldWidget()
        }

    #create a customuser (parent user) to the patient, as well as the patient object
    def signup(self, request, user):
        user.user_type =1

        patient_user = Patient(
            baseuser = user,
            first_name=self.cleaned_data.get('patient_first_name'),
            last_name=self.cleaned_data.get('patient_second_name'),
            sex = self.cleaned_data.get('patient_sex'),
            dob = self.cleaned_data.get('patient_dob'),
            tel_no = self.cleaned_data.get('patient_telno'),
            address = self.cleaned_data.get('address'),
        )

        patient_user.baseuser.user_type=1
        patient_user.baseuser.save()
        patient_user.save()

        return patient_user.baseuser
Ejemplo n.º 16
0
 class Meta:
     model = PartnerSite
     fields = "__all__"
     widgets = {
         'geom':GooglePointFieldWidget(settings={"GooglePointFieldWidget":(("zoom",8),)}),
     }
Ejemplo n.º 17
0
 class Meta:
     model = Restaurant
     fields = ("name", "location", "data", "city")
     widgets = {
         'location': GooglePointFieldWidget(settings=CUSTOM_MAP_SETTINGS),
     }
Ejemplo n.º 18
0
 def get_form(self, request, obj=None, **kwargs):
     form = super(HouseAdmin, self).get_form(request, obj, **kwargs)
     form.base_fields['location'].widget = GooglePointFieldWidget()
     return form
Ejemplo n.º 19
0
 def get_form(self, request, obj=None, **kwargs):
     form = super(HouseAdmin, self).get_form(request, obj, **kwargs)
     if obj is None:  # manipulate page form
         form.base_fields['location'].widget = MapboxPointFieldWidget()
         form.base_fields['location_has_default'].widget = GooglePointFieldWidget()
     return form
Ejemplo n.º 20
0
 class Meta:
     model = User
     fields = ['name','location']
     widgets = {
         'location': GooglePointFieldWidget()
     }
Ejemplo n.º 21
0
 class Meta:
     widgets = {
         'address':  GooglePointFieldWidget()
     }
Ejemplo n.º 22
0
 class Meta:
     model = Resto
     fields = ("name", "address")
     widgets = {
         'address': GooglePointFieldWidget(settings=CUSTOM_MAP_SETTINGS),
     }