# Path: tests/testapp/widgets/models.py
# class PointField(models.Model):
#     name = models.CharField(max_length=255)
#     location = models.PointField(srid=4326)
#     city = models.PointField(blank=True, null=True, srid=3857)
# 
#     def __unicode__(self):
#         return self.name
# 
# class Street(models.Model):
#     point = models.ForeignKey(PointField, blank=True, null=True, on_delete=models.SET_NULL)
#     name = models.CharField(max_length=255)
#     street = models.PointField(srid=4326)


import mapwidgets
from django.contrib import admin
from django.contrib.gis.db import models
from .models import PointField, Street




class StreetInline(admin.TabularInline):
    model = Street
    formfield_overrides = {
        models.PointField: {"widget": mapwidgets.GooglePointFieldWidget}
    }
    extra = 2
    

class PointFieldAdmin(admin.ModelAdmin):
    formfield_overrides = {

# Path: tests/testapp/widgets/models.py
# class PointField(models.Model):
#     name = models.CharField(max_length=255)
#     location = models.PointField(srid=4326)
#     city = models.PointField(blank=True, null=True, srid=3857)
# 
#     def __unicode__(self):
#         return self.name
# 
# class Street(models.Model):
#     point = models.ForeignKey(PointField, blank=True, null=True, on_delete=models.SET_NULL)
#     name = models.CharField(max_length=255)
#     street = models.PointField(srid=4326)


# Path: tests/testapp/widgets/admin.py
import mapwidgets
from django.contrib import admin
from django.contrib.gis.db import models
from .models import PointField, Street





class StreetInline(admin.TabularInline):
    model = Street
    formfield_overrides = {
        models.PointField: {"widget": mapwidgets.GooglePointFieldWidget}
    }
    extra = 2
    

class PointFieldAdmin(admin.ModelAdmin):
    formfield_overrides = {

        models.PointField: {"widget": mapwidgets.GooglePointFieldWidget}