<commit_before>"""
Models for the Map application
"""

from django.db import models
from django.utils.text import slugify

from djgeojson.fields import PointField

DEFAULT_CENTER_POINT = {'type': 'Point', 'coordinates': [39.83, -98.58]}
DEFAULT_ZOOM_LEVEL = 4

class Map(models.Model):
    """A map holds a collection of Markers."""
    title = models.CharField(max_length=80, unique=True)
    slug = models.SlugField(max_length=80, unique=True)
    description = models.TextField(blank=True)
    private = models.BooleanField(default=False)
    date_created = models.DateTimeField(auto_now_add=True)
    date_updated = models.DateTimeField(auto_now=True)
    center = PointField(default=DEFAULT_CENTER_POINT)
    zoom = models.IntegerField(default=DEFAULT_ZOOM_LEVEL)
    project = models.ForeignKey(
        'project.Project',
        on_delete=models.CASCADE,
        related_name='maps',
    )

    def save(self, *args, **kwargs):
        self.slug = slugify(self.title)
        super(Map, self).save(*args, **kwargs)

    def __unicode__(self):
        return unicode(self.title)
<commit_msg>fixes default center point json<commit_after>"""
Models for the Map application
"""

from django.db import models
from django.utils.text import slugify

from djgeojson.fields import PointField

DEFAULT_CENTER_POINT = {"type": "Point", "coordinates": [39.83, -98.58]}
DEFAULT_ZOOM_LEVEL = 4

class Map(models.Model):
    """A map holds a collection of Markers."""
    title = models.CharField(max_length=80, unique=True)
    slug = models.SlugField(max_length=80, unique=True)
    description = models.TextField(blank=True)
    private = models.BooleanField(default=False)
    date_created = models.DateTimeField(auto_now_add=True)
    date_updated = models.DateTimeField(auto_now=True)
    center = PointField(default=DEFAULT_CENTER_POINT)
    zoom = models.IntegerField(default=DEFAULT_ZOOM_LEVEL)
    project = models.ForeignKey(
        'project.Project',
        on_delete=models.CASCADE,
        related_name='maps',
    )

    def save(self, *args, **kwargs):
        self.slug = slugify(self.title)
        super(Map, self).save(*args, **kwargs)

    def __unicode__(self):
        return unicode(self.title)

{'fraction_non_alphanumeric': 0.11743450767841011, 'fraction_numerical': 0.011743450767841012, 'mean_word_length': 4.115473441108545, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '1321106', 'n_tokens_mistral': 716, 'n_tokens_neox': 685, 'n_words': 146}