# 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
# 
# class Expert(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=30)
# 
# 	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 django.core.urlresolvers import reverse
from User.models import Farmer, Expert
# -*- coding: utf-8 -*-
from __future__ import unicode_literals



POST_CATEGORIES = {
	1: "Crop Disease/Problems",
	2: "Climate Related",
	3: "Others",
}

# Create your models here.
class Post(models.Model):
	"""docstring for Posts"""
	post_id = models.AutoField(primary_key=True)
	title = models.CharField(max_length = 120)
	description = models.TextField()
	category = models.CharField(max_length = 100)

	author_expert = models.ForeignKey(Expert, on_delete=models.CASCADE, blank=True, null=True)

# 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
# 
# class Expert(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=30)
# 
# 	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: post/models.py
from django.db import models
from django.core.urlresolvers import reverse
from User.models import Farmer, Expert

# -*- coding: utf-8 -*-
from __future__ import unicode_literals



POST_CATEGORIES = {
	1: "Crop Disease/Problems",
	2: "Climate Related",
	3: "Others",
}

# Create your models here.
class Post(models.Model):
	"""docstring for Posts"""
	post_id = models.AutoField(primary_key=True)
	title = models.CharField(max_length = 120)
	description = models.TextField()
	category = models.CharField(max_length = 100)

	author_expert = models.ForeignKey(Expert, on_delete=models.CASCADE, blank=True, null=True)

	author_farmer = models.ForeignKey(Farmer, on_delete=models.CASCADE, blank=True, null=True)