<commit_before># -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division

from django.contrib import admin

from apps.core import models


class LayerTagInline(admin.TabularInline):
    extra = 0
    model = models.LayerTag


class LayerImageInline(admin.TabularInline):
    extra = 0
    model = models.LayerImage


class LayerMetaInline(admin.TabularInline):
    extra = 0
    model = models.LayerMeta


class LayerAdmin(admin.ModelAdmin):
    inlines = [LayerTagInline, LayerImageInline, LayerMetaInline]
    readonly_fields = ('created_at', 'updated_at')
    fieldsets = (
        (None, {
            'fields': (
                'user', 'name', 'description',
                ('capture_start', 'capture_end'),
                ('area', 'area_unit'),
                'projection', 'srid',
                'created_at', 'updated_at', 'deleted_at'
            )
        }),
        ('Tiles', {
            'fields': (
                'tile_srid', 'tile_format', 'tile_origin', 'resampling',
                'transparency'
            )
        }),
    )


admin.site.register(models.Layer, LayerAdmin)<commit_msg>Add favorited layers to admin<commit_after># -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division

from django.contrib import admin

from apps.core import models


class LayerTagInline(admin.TabularInline):
    extra = 0
    model = models.LayerTag


class LayerImageInline(admin.TabularInline):
    extra = 0
    model = models.LayerImage


class LayerMetaInline(admin.TabularInline):
    extra = 0
    model = models.LayerMeta


class LayerAdmin(admin.ModelAdmin):
    inlines = [LayerTagInline, LayerImageInline, LayerMetaInline]
    readonly_fields = ('created_at', 'updated_at')
    fieldsets = (
        (None, {
            'fields': (
                'user', 'name', 'description',
                ('capture_start', 'capture_end'),
                ('area', 'area_unit'),
                'projection', 'srid',
                'created_at', 'updated_at', 'deleted_at'
            )
        }),
        ('Tiles', {
            'fields': (
                'tile_srid', 'tile_format', 'tile_origin', 'resampling',
                'transparency'
            )
        }),
    )


admin.site.register(models.Layer, LayerAdmin)
admin.site.register(models.UserFavoriteLayer, admin.ModelAdmin)
{'fraction_non_alphanumeric': 0.11504065040650406, 'fraction_numerical': 0.0032520325203252032, 'mean_word_length': 2.4133148404993063, 'pattern_counts': {'":': 0, '<': 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': '891833', 'n_tokens_mistral': 733, 'n_tokens_neox': 705, 'n_words': 153}