from django import forms
from django.db import models
from django.conf import settings

from .widgets import LocationPickerWidget

class LocationField(models.CharField):

    def formfield(self, **kwargs):
        kwargs['widget'] = LocationPickerWidget
        return super(LocationField, self).formfield(**kwargs)
        
    #def south_field_triple(self):
        #"Returns a suitable description of this field for South."
        # We'll just introspect ourselves, since we inherit.
        #from south.modelsinspector import introspector
        #field_class = "django.db.models.fields.CharField"
        #args, kwargs = introspector(self)
        # That's our definition!
        #return (field_class, args, kwargs)