from django.shortcuts import render, redirect
#from django.contrib.gis.geos import GEOSGeometry
from django.views.generic import View
from .models import Baston
from .forms import bastonForm
# Create your views here.

class BastonView(View):
  form = bastonForm()
  template = "baston.html"

  def get(self, request, *args, **kargs):
    return render(request, self.template,{"form":self.form})

  def post(self, request, *args, **kargs):
    self.form = batonForm(request.POST)

    if self.form.is_valid():
      baston = Baston() 
      baston.comentario = self.form.cleaned_data["comentario"]
      baston.save()
      return redirect("baston-list")
    
    return redirect("baston-post")

40674aca694661a7dd30a3474a3c3c44f7c1f0f4
<mask token>


class BastonView(View):
    <mask token>
    <mask token>

    def get(self, request, *args, **kargs):
        return render(request, self.template, {'form': self.form})
    <mask token>

<mask token>


class BastonView(View):
    <mask token>
    <mask token>

    def get(self, request, *args, **kargs):
        return render(request, self.template, {'form': self.form})

    def post(self, request, *args, **kargs):
        self.form = batonForm(request.POST)
        if self.form.is_valid():
            baston = Baston()
            baston.comentario = self.form.cleaned_data['comentario']
            baston.save()
            return redirect('baston-list')
        return redirect('baston-post')

<mask token>


class BastonView(View):
    form = bastonForm()
    template = 'baston.html'

    def get(self, request, *args, **kargs):
        return render(request, self.template, {'form': self.form})

    def post(self, request, *args, **kargs):
        self.form = batonForm(request.POST)
        if self.form.is_valid():
            baston = Baston()
            baston.comentario = self.form.cleaned_data['comentario']
            baston.save()
            return redirect('baston-list')
        return redirect('baston-post')

from django.shortcuts import render, redirect
from django.views.generic import View
from .models import Baston
from .forms import bastonForm


class BastonView(View):
    form = bastonForm()
    template = 'baston.html'

    def get(self, request, *args, **kargs):
        return render(request, self.template, {'form': self.form})

    def post(self, request, *args, **kargs):
        self.form = batonForm(request.POST)
        if self.form.is_valid():
            baston = Baston()
            baston.comentario = self.form.cleaned_data['comentario']
            baston.save()
            return redirect('baston-list')
        return redirect('baston-post')

from django.shortcuts import render, redirect
#from django.contrib.gis.geos import GEOSGeometry
from django.views.generic import View
from .models import Baston
from .forms import bastonForm
# Create your views here.

class BastonView(View):
  form = bastonForm()
  template = "baston.html"

  def get(self, request, *args, **kargs):
    return render(request, self.template,{"form":self.form})

  def post(self, request, *args, **kargs):
    self.form = batonForm(request.POST)

    if self.form.is_valid():
      baston = Baston() 
      baston.comentario = self.form.cleaned_data["comentario"]
      baston.save()
      return redirect("baston-list")
    
    return redirect("baston-post")
