Skip to main content

AutoSlugField for Django based on django-extensions AutoSlugField, adds option to track foreignkey/parent field for slug.

Project description

AutoSlugField for Django based on django-extensions AutoSlugField, adds option to track foreignkey/parent field for slug.

Installation

Install django-autoslug-field like you would install any other pypi package:

pip install django-autoslug-field

Configuration and usage

  • add django_autoslug to the list of INSTALLED_APPS in your settings.py

  • use in models.py:

    from django_autoslug.fields import AutoSlugField
    
    ...
    
    class MyModel(models.Model):
        lang = models.CharField(_('lang'), max_length=50, choices=settings.LANGUAGES)
        title = models.CharField(_('title'), max_length=255)
        parent = models.ForeignKey('MyModel', blank=True, null=True)
        slug = AutoSlugField(populate_from=('title',), recursive='parent', prefix_from=('lang',), unique=True, max_length=255, overwrite=True)
  • install http://pypi.python.org/pypi/pytils if you need russian translit support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-autoslug-field-0.2.1.tar.gz (6.6 kB view details)

Uploaded Source

File details

Details for the file django-autoslug-field-0.2.1.tar.gz.

File metadata

File hashes

Hashes for django-autoslug-field-0.2.1.tar.gz
Algorithm Hash digest
SHA256 25f629faafdced1e9b8ac5562083eab4e73319306603b3b26135cb79b8916a1b
MD5 7fb065b1e39cefad9784f7257fda64b0
BLAKE2b-256 14920748bee6fc4d9424820c1507e4cce32275e1426d1a9b30e4c6acb0083823

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page