property types
This commit is contained in:
@@ -20,6 +20,14 @@ class Listing(db.Model):
|
||||
latitude = db.Column(db.Float, nullable=True)
|
||||
longitude = db.Column(db.Float, nullable=True)
|
||||
|
||||
PROPERTY_TYPES = {
|
||||
'house': 'Дом',
|
||||
'villa': 'Вилла',
|
||||
'flat': 'Квартира',
|
||||
'room': 'Комната',
|
||||
'hotel': 'Гостиница'
|
||||
}
|
||||
|
||||
class Image(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
url = db.Column(db.String(300), nullable=False)
|
||||
|
||||
@@ -82,7 +82,7 @@ def create_listing():
|
||||
|
||||
db.session.commit()
|
||||
return redirect(url_for('dashboard'))
|
||||
return render_template('create_listing.html')
|
||||
return render_template('create_listing.html', property_types=Listing.PROPERTY_TYPES)
|
||||
|
||||
@app.route('/booking/<int:listing_id>', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
|
||||
@@ -23,7 +23,11 @@
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="property_type" class="form-label">Property Type</label>
|
||||
<input type="text" class="form-control" id="property_type" name="property_type" required>
|
||||
<select class="form-select" id="property_type" name="property_type" required>
|
||||
{% for key, value in property_types.items() %}
|
||||
<option value="{{ key }}">{{ value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="latitude" class="form-label">Latitude</label>
|
||||
|
||||
Reference in New Issue
Block a user