<commit_before>from django.db import models
from django.contrib.gis.db import models
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.auth.models import User;
import datetime
from datetime import datetime
import uuid

# Create your models here.
class EventType(models.Model):
    name = models.CharField(null=False, max_length=30)

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

class MapEntity(models.Model):
    # Name and type are required
    # entityName = models.TextField(null=False)
    # entityType = models.TextField(null=False)


    entityName = models.CharField(max_length=60, help_text="Insert name here")
    entityType = models.ForeignKey(EventType, help_text="What type of event is it?")
    entityDescription = models.TextField(max_length=300, help_text="Very awesome party at my place")
    owner = models.ForeignKey(User, on_delete=models.CASCADE)

    # set the publish date on creation
    publishDate = models.DateTimeField(null=False, auto_now_add=True)

    # time markers for start/end -> can be edited prior to start time
    startDate = models.DateTimeField(null=True, blank=False)
    endDate = models.DateTimeField(null=True, blank=True)

    # auto update on last save
    lastModDate = models.DateTimeField(null=True, auto_now=True)

    uuid = models.UUIDField(default=uuid.uuid4, editable=False)


    # this has to be a proper GeoField
    # locLat = models.FloatField()
    # locLong = models.FloatField()
    # srid=4326 is compatible with google maps
    geoLocationField = models.PointField(srid=4326)
    objects = models.GeoManager()

    def setLocationField(self, lat, lng) :
        self.geoLocationField = GEOSGeometry('POINT(' + str(lng)  + ' '+ str(lat)  + ')', srid=4326)

    # json encode maybe?!
    def __unicode__(self):
        return str(self.entityName)


class Player(models.Model):
    user = models.OneToOneField(User)
    lastLocation = models.PointField(srid=4326)
    objects = models.GeoManager()<commit_msg>more __str__<commit_after>from django.db import models
from django.contrib.gis.db import models
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.auth.models import User;
import datetime
from datetime import datetime
import uuid

# Create your models here.
class EventType(models.Model):
    name = models.CharField(null=False, max_length=30)

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

class MapEntity(models.Model):
    # Name and type are required
    # entityName = models.TextField(null=False)
    # entityType = models.TextField(null=False)


    entityName = models.CharField(max_length=60, help_text="Insert name here")
    entityType = models.ForeignKey(EventType, help_text="What type of event is it?")
    entityDescription = models.TextField(max_length=300, help_text="Very awesome party at my place")
    owner = models.ForeignKey(User, on_delete=models.CASCADE)

    # set the publish date on creation
    publishDate = models.DateTimeField(null=False, auto_now_add=True)

    # time markers for start/end -> can be edited prior to start time
    startDate = models.DateTimeField(null=True, blank=False)
    endDate = models.DateTimeField(null=True, blank=True)

    # auto update on last save
    lastModDate = models.DateTimeField(null=True, auto_now=True)

    uuid = models.UUIDField(default=uuid.uuid4, editable=False)


    # this has to be a proper GeoField
    # locLat = models.FloatField()
    # locLong = models.FloatField()
    # srid=4326 is compatible with google maps
    geoLocationField = models.PointField(srid=4326)
    objects = models.GeoManager()

    def setLocationField(self, lat, lng) :
        self.geoLocationField = GEOSGeometry('POINT(' + str(lng)  + ' '+ str(lat)  + ')', srid=4326)

    # json encode maybe?!
    def __str__(self):
        return str(self.entityName)


class Player(models.Model):
    user = models.OneToOneField(User)
    lastLocation = models.PointField(srid=4326)
    objects = models.GeoManager()
{'fraction_non_alphanumeric': 0.10072663492858933, 'fraction_numerical': 0.01202706088699574, 'mean_word_length': 4.1048593350383635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6490461', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1191, 'n_words': 308}