mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 09:51:09 -05:00
major changes, including tailwind v4
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
# DEPRECATED: These forms are deprecated and no longer used.
|
||||
#
|
||||
# Domain-specific location models now have their own forms:
|
||||
# - ParkLocationForm in parks.forms (for ParkLocation)
|
||||
# - RideLocationForm in rides.forms (for RideLocation)
|
||||
# - CompanyHeadquartersForm in parks.forms (for CompanyHeadquarters)
|
||||
#
|
||||
# This file is kept for reference during migration cleanup only.
|
||||
|
||||
from django import forms
|
||||
from .models import Location
|
||||
|
||||
# NOTE: All classes below are DEPRECATED
|
||||
# Use domain-specific location forms instead
|
||||
|
||||
class LocationForm(forms.ModelForm):
|
||||
"""Form for creating and updating Location objects"""
|
||||
"""DEPRECATED: Use domain-specific location forms instead"""
|
||||
|
||||
class Meta:
|
||||
model = Location
|
||||
fields = [
|
||||
'name',
|
||||
'location_type',
|
||||
'location_type',
|
||||
'latitude',
|
||||
'longitude',
|
||||
'street_address',
|
||||
@@ -17,63 +29,12 @@ class LocationForm(forms.ModelForm):
|
||||
'country',
|
||||
'postal_code',
|
||||
]
|
||||
widgets = {
|
||||
'latitude': forms.NumberInput(attrs={
|
||||
'step': 'any',
|
||||
'class': 'location-lat',
|
||||
'data-map-target': 'lat'
|
||||
}),
|
||||
'longitude': forms.NumberInput(attrs={
|
||||
'step': 'any',
|
||||
'class': 'location-lng',
|
||||
'data-map-target': 'lng'
|
||||
})
|
||||
}
|
||||
|
||||
class LocationSearchForm(forms.Form):
|
||||
"""Form for searching locations using OpenStreetMap Nominatim"""
|
||||
"""DEPRECATED: Location search functionality has been moved to parks app"""
|
||||
|
||||
query = forms.CharField(
|
||||
max_length=255,
|
||||
required=True,
|
||||
widget=forms.TextInput(attrs={
|
||||
'placeholder': 'Search for a location...',
|
||||
'class': 'location-search',
|
||||
'data-action': 'search#query',
|
||||
'autocomplete': 'off'
|
||||
})
|
||||
)
|
||||
|
||||
# Hidden fields for storing selected location data
|
||||
selected_lat = forms.DecimalField(
|
||||
required=False,
|
||||
widget=forms.HiddenInput(attrs={'data-search-target': 'selectedLat'})
|
||||
)
|
||||
selected_lng = forms.DecimalField(
|
||||
required=False,
|
||||
widget=forms.HiddenInput(attrs={'data-search-target': 'selectedLng'})
|
||||
)
|
||||
selected_name = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.HiddenInput(attrs={'data-search-target': 'selectedName'})
|
||||
)
|
||||
selected_address = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.HiddenInput(attrs={'data-search-target': 'selectedAddress'})
|
||||
)
|
||||
selected_city = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.HiddenInput(attrs={'data-search-target': 'selectedCity'})
|
||||
)
|
||||
selected_state = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.HiddenInput(attrs={'data-search-target': 'selectedState'})
|
||||
)
|
||||
selected_country = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.HiddenInput(attrs={'data-search-target': 'selectedCountry'})
|
||||
)
|
||||
selected_postal_code = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.HiddenInput(attrs={'data-search-target': 'selectedPostalCode'})
|
||||
help_text="This form is deprecated. Use location search in the parks app."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user