from schematics.models import Model
from schematics.types import StringType

class Step(Model):
	"""
		Represents an individual step
	"""
	html_instructions = StringType()

class Leg(Model):
	"""
		Represents an individual leg
	"""
	start_address = StringType()
	end_address = StringType()
	

class Route(Model):
	"""
		Represents an individual route whose attributes include
	"""
	summary = StringType(required=True)
	copyrights = StringType()

	@property
	def summary():
		return summary
from schematics.models import Model
from schematics.types import StringType, DecimalType
from schematics.types.compound import ListType

class Distance(Model):
	"""
		Represents the duration of a leg/step
	"""
	value = DecimalType()
	text = StringType()

class Duration(Model):
	"""
		Represents the duration of a leg/step
	"""
	value = DecimalType()
	text = StringType()


class Step(Model):
	"""
		Represents an individual step
	"""
	html_instructions = StringType()

class Leg(Model):
	"""
		Represents an individual leg
	"""
	start_address = StringType()
	end_address = StringType()
	steps = ListType(ModelType(Step))


class Route(Model):
	"""
		Represents an individual route whose attributes include
	"""
	summary = StringType(required=True)
	legs = ListType(ModelType(Leg))
	copyrights = StringType()

	@property
	def summary():
		return summary

Add more details to routes
Add more details to routes

  from schematics.models import Model
- from schematics.types import StringType
+ from schematics.types import StringType, DecimalType
+ from schematics.types.compound import ListType
+ 
+ class Distance(Model):
+ 	"""
+ 		Represents the duration of a leg/step
+ 	"""
+ 	value = DecimalType()
+ 	text = StringType()
+ 
+ class Duration(Model):
+ 	"""
+ 		Represents the duration of a leg/step
+ 	"""
+ 	value = DecimalType()
+ 	text = StringType()
+ 
  
  class Step(Model):
  	"""
  		Represents an individual step
  	"""
  	html_instructions = StringType()
  
  class Leg(Model):
  	"""
  		Represents an individual leg
  	"""
  	start_address = StringType()
  	end_address = StringType()
- 	
+ 	steps = ListType(ModelType(Step))
+ 
  
  class Route(Model):
  	"""
  		Represents an individual route whose attributes include
  	"""
  	summary = StringType(required=True)
+ 	legs = ListType(ModelType(Leg))
  	copyrights = StringType()
  
  	@property
  	def summary():
  		return summary
+ 
Add more details to routes
## Code Before:
from schematics.models import Model
from schematics.types import StringType

class Step(Model):
	"""
		Represents an individual step
	"""
	html_instructions = StringType()

class Leg(Model):
	"""
		Represents an individual leg
	"""
	start_address = StringType()
	end_address = StringType()
	

class Route(Model):
	"""
		Represents an individual route whose attributes include
	"""
	summary = StringType(required=True)
	copyrights = StringType()

	@property
	def summary():
		return summary
## Instruction:
Add more details to routes
## Code After:
from schematics.models import Model
from schematics.types import StringType, DecimalType
from schematics.types.compound import ListType

class Distance(Model):
	"""
		Represents the duration of a leg/step
	"""
	value = DecimalType()
	text = StringType()

class Duration(Model):
	"""
		Represents the duration of a leg/step
	"""
	value = DecimalType()
	text = StringType()


class Step(Model):
	"""
		Represents an individual step
	"""
	html_instructions = StringType()

class Leg(Model):
	"""
		Represents an individual leg
	"""
	start_address = StringType()
	end_address = StringType()
	steps = ListType(ModelType(Step))


class Route(Model):
	"""
		Represents an individual route whose attributes include
	"""
	summary = StringType(required=True)
	legs = ListType(ModelType(Leg))
	copyrights = StringType()

	@property
	def summary():
		return summary
