Z
Z
zelsky2016-01-27 15:03:51
Django
zelsky, 2016-01-27 15:03:51

Django-easy-map not displaying in admin?

I did everything according to the example from here, it displays correctly, . But after adding the field to the admin panel, I don’t see a widget in the admin panel itself to add a marker to the map.
d3ba2c495ecc4a738d1c55330aa2a5f8.png

"""Моделс"""
from django.db import models

# Create your models here.
class Firm(models.Model):
    address = models.TextField(max_length=900),

"""Админ пи"""
from django.contrib import admin
# Register your models here.
from django import forms
from django.contrib import admin

from easy_maps.widgets import AddressWithMapWidget

from .models import Firm

class FirmAdmin(admin.ModelAdmin):
    class form(forms.ModelForm):
        class Meta:
            widgets = {
                'address': AddressWithMapWidget({'class': 'vTextField'})
            }

admin.site.register(Firm, FirmAdmin)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Voronkov, 2016-01-28
@DmitryVoronkov

Maybe I forgot the static files from the widget?
Try
python manage.py collectstatic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question