from flask.ext.classy import FlaskView


class AnalyserView(FlaskView):
  def get(self):
    return "awesome"

from flask.ext.classy import FlaskView

from utils.decorators import validate, require
from utils.validators import validate_url


class AnalyserView(FlaskView):
  @require('url')
  @validate({
      'url': validate_url
  })
  def post(self, url):
    return url

Add more joy using decorators
Add more joy using decorators

  from flask.ext.classy import FlaskView
+ 
+ from utils.decorators import validate, require
+ from utils.validators import validate_url
  
  
  class AnalyserView(FlaskView):
-   def get(self):
-     return "awesome"
+   @require('url')
+   @validate({
+       'url': validate_url
+   })
+   def post(self, url):
+     return url
  
Add more joy using decorators
## Code Before:
from flask.ext.classy import FlaskView


class AnalyserView(FlaskView):
  def get(self):
    return "awesome"

## Instruction:
Add more joy using decorators
## Code After:
from flask.ext.classy import FlaskView

from utils.decorators import validate, require
from utils.validators import validate_url


class AnalyserView(FlaskView):
  @require('url')
  @validate({
      'url': validate_url
  })
  def post(self, url):
    return url
