from django.db import models

class Contact(models.Model):
	first_name = models.CharField(max_length=50, blank=True, null=True)
	last_name = models.CharField(max_length=50, blank=True, null=True)
	nick = models.CharField(max_length=128)
	email = models.EmailField(max_length=254)

	def __unicode__(self):
		return (self.nick)

	def get_absolute_url(self):
		return reverse('contact-detail', kwargs={'pk': self.pk})

class Position(models.Model):
	contact = models.ForeignKey('Contact')
	street = models.CharField(max_length=200, blank=True, null=True)
	city = models.CharField(max_length=100, blank=True, null=True)
	address_description = models.TextField(blank=True, null=True)
	altitude = models.FloatField(blank=True, null=True)
	latitude = models.FloatField(blank=True, null=True)

	def __unicode__(self):
		return (self.street)

	def get_absolute_url(self):
		return reverse('position-detail', kwargs={'pk': self.pk})

from django.db import models

class Position(models.Model):
	first_name = models.CharField(max_length=50, blank=True, null=True)
	last_name = models.CharField(max_length=50, blank=True, null=True)
	nick = models.CharField(max_length=128)
	email = models.EmailField(max_length=254)
	street = models.CharField(max_length=200, blank=True, null=True)
	city = models.CharField(max_length=100, blank=True, null=True)
	address_description = models.TextField(blank=True, null=True)
	altitude = models.FloatField(blank=True, null=True)
	latitude = models.FloatField(blank=True, null=True)

	def __unicode__(self):
		return (self.street)

	def get_absolute_url(self):
		return reverse('position-detail', kwargs={'pk': self.pk})

Revert splitting of model as its adding to much complexitiy for the timebeing to later logics IIt's just not adding enought value for having a more complicated implementation.
Revert splitting of model as its adding to much complexitiy for the timebeing to later logics
IIt's just not adding enought value for having a more complicated implementation.

  from django.db import models
  
- class Contact(models.Model):
+ class Position(models.Model):
  	first_name = models.CharField(max_length=50, blank=True, null=True)
  	last_name = models.CharField(max_length=50, blank=True, null=True)
  	nick = models.CharField(max_length=128)
  	email = models.EmailField(max_length=254)
- 
- 	def __unicode__(self):
- 		return (self.nick)
- 
- 	def get_absolute_url(self):
- 		return reverse('contact-detail', kwargs={'pk': self.pk})
- 
- class Position(models.Model):
- 	contact = models.ForeignKey('Contact')
  	street = models.CharField(max_length=200, blank=True, null=True)
  	city = models.CharField(max_length=100, blank=True, null=True)
  	address_description = models.TextField(blank=True, null=True)
  	altitude = models.FloatField(blank=True, null=True)
  	latitude = models.FloatField(blank=True, null=True)
  
  	def __unicode__(self):
  		return (self.street)
  
  	def get_absolute_url(self):
  		return reverse('position-detail', kwargs={'pk': self.pk})
  
Revert splitting of model as its adding to much complexitiy for the timebeing to later logics IIt's just not adding enought value for having a more complicated implementation.
## Code Before:
from django.db import models

class Contact(models.Model):
	first_name = models.CharField(max_length=50, blank=True, null=True)
	last_name = models.CharField(max_length=50, blank=True, null=True)
	nick = models.CharField(max_length=128)
	email = models.EmailField(max_length=254)

	def __unicode__(self):
		return (self.nick)

	def get_absolute_url(self):
		return reverse('contact-detail', kwargs={'pk': self.pk})

class Position(models.Model):
	contact = models.ForeignKey('Contact')
	street = models.CharField(max_length=200, blank=True, null=True)
	city = models.CharField(max_length=100, blank=True, null=True)
	address_description = models.TextField(blank=True, null=True)
	altitude = models.FloatField(blank=True, null=True)
	latitude = models.FloatField(blank=True, null=True)

	def __unicode__(self):
		return (self.street)

	def get_absolute_url(self):
		return reverse('position-detail', kwargs={'pk': self.pk})

## Instruction:
Revert splitting of model as its adding to much complexitiy for the timebeing to later logics IIt's just not adding enought value for having a more complicated implementation.
## Code After:
from django.db import models

class Position(models.Model):
	first_name = models.CharField(max_length=50, blank=True, null=True)
	last_name = models.CharField(max_length=50, blank=True, null=True)
	nick = models.CharField(max_length=128)
	email = models.EmailField(max_length=254)
	street = models.CharField(max_length=200, blank=True, null=True)
	city = models.CharField(max_length=100, blank=True, null=True)
	address_description = models.TextField(blank=True, null=True)
	altitude = models.FloatField(blank=True, null=True)
	latitude = models.FloatField(blank=True, null=True)

	def __unicode__(self):
		return (self.street)

	def get_absolute_url(self):
		return reverse('position-detail', kwargs={'pk': self.pk})
