Why SlugField overrides get_internal_type()?

91 views
Skip to first unread message

Val Neekman

unread,
Feb 7, 2014, 6:07:43 PM2/7/14
to django-d...@googlegroups.com
None of the other subclasses of CharField override get_internal_type() but the SlugField and I am wondering why?

Class SlugField(CharField):

    def get_internal_type(self):
        return "SlugField"

Thx,

Val

Carl Meyer

unread,
Feb 7, 2014, 6:14:35 PM2/7/14
to django-d...@googlegroups.com
Hi Val,
"Internal type" abstracts a field class from the database column type
used to represent it in various database backends. "SlugField" is a
distinct internal_type from "CharField" because we use different
database column types to represent SlugField and CharField in some
databases.

See the implementation of `Field.db_type()` and the `data_types` class
attribute on the various DatabaseCreation classes in the db backends.

Carl

Val Neekman

unread,
Feb 9, 2014, 12:13:00 PM2/9/14
to django-d...@googlegroups.com
Oh, I see.

Thanks Carl.

Val




Carl

--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/52F568DB.7030504%40oddbird.net.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages