# Path: location/models.py
# class Location(models.Model):
# 	loc_id = models.AutoField(primary_key=True)
# 	city = models.CharField(max_length=30)
# 	state = models.CharField(max_length=30)
# 
# 	def __unicode__(self):
# 		return self.city + ', ' + self.state
# 	def __str__(self):
# 		return self.city + ', ' + self.state
# 
# Path: User/models.py
# class Farmer(models.Model):
# 	"""docstring for Farmer"""
# 	auto_id = models.AutoField(primary_key=True)
# 	name = models.CharField(max_length=30)
# 
# 	user_id = models.EmailField(max_length=30,unique=True)
# 	user_pwd = models.CharField(max_length=100)
# 
# 	contact = models.BigIntegerField()
# 	
# 	location = models.ForeignKey(Location, on_delete=models.CASCADE)
# 
# 	join_timestamp = models.DateTimeField(auto_now=False,auto_now_add=True)
# 	
# 	def __unicode__(self):
# 		return self.name
# 	def __str__(self):
# 		return self.name


from django.db import models
from location.models import Location
from User.models import Farmer
		return self.name + ", " + self.nut_type

class Disease(models.Model):
	"""docstring for Disease"""
	dis_id = models.AutoField(primary_key=True)
	name = models.CharField(max_length = 40)
	category = models.CharField(max_length = 50)
	image = models.FileField(null=True, blank=True, upload_to='diseases/'	)

	def __unicode__(self):
		return self.name + ", " + self.category
	def __str__(self):
		return self.name + ", " + self.category

class Fertilizer(models.Model):
	"""docstring for Fertilizer"""
	ferti_id = models.AutoField(primary_key=True)
	name = models.CharField(max_length = 40)

	def __unicode__(self):
		return self.name
	def __str__(self):
		return self.name

# Tables for many to many relationships
class SoilNutrient(models.Model):
	"""docstring for SoilNutrient"""
	class Meta:
		unique_together = (('location', 'nutrient'),)


# Path: location/models.py
# class Location(models.Model):
# 	loc_id = models.AutoField(primary_key=True)
# 	city = models.CharField(max_length=30)
# 	state = models.CharField(max_length=30)
# 
# 	def __unicode__(self):
# 		return self.city + ', ' + self.state
# 	def __str__(self):
# 		return self.city + ', ' + self.state
# 
# Path: User/models.py
# class Farmer(models.Model):
# 	"""docstring for Farmer"""
# 	auto_id = models.AutoField(primary_key=True)
# 	name = models.CharField(max_length=30)
# 
# 	user_id = models.EmailField(max_length=30,unique=True)
# 	user_pwd = models.CharField(max_length=100)
# 
# 	contact = models.BigIntegerField()
# 	
# 	location = models.ForeignKey(Location, on_delete=models.CASCADE)
# 
# 	join_timestamp = models.DateTimeField(auto_now=False,auto_now_add=True)
# 	
# 	def __unicode__(self):
# 		return self.name
# 	def __str__(self):
# 		return self.name


# Path: crop/models.py
from django.db import models
from location.models import Location
from User.models import Farmer

		return self.name + ", " + self.nut_type

class Disease(models.Model):
	"""docstring for Disease"""
	dis_id = models.AutoField(primary_key=True)
	name = models.CharField(max_length = 40)
	category = models.CharField(max_length = 50)
	image = models.FileField(null=True, blank=True, upload_to='diseases/'	)

	def __unicode__(self):
		return self.name + ", " + self.category
	def __str__(self):
		return self.name + ", " + self.category

class Fertilizer(models.Model):
	"""docstring for Fertilizer"""
	ferti_id = models.AutoField(primary_key=True)
	name = models.CharField(max_length = 40)

	def __unicode__(self):
		return self.name
	def __str__(self):
		return self.name

# Tables for many to many relationships
class SoilNutrient(models.Model):
	"""docstring for SoilNutrient"""
	class Meta:
		unique_together = (('location', 'nutrient'),)


	location = models.ForeignKey(Location, on_delete=models.CASCADE, blank=True, null=True)