Skip to main content

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

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.3.tar.gz (6.9 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-autoslug-field-0.2.3.tar.gz
Algorithm Hash digest
SHA256 584a207871f9ddbe814d0918f5aecc6faad3d3953f77b845f2cd9a086ab33cbd
MD5 cb0e6695bc5f9672b112f01e4b2d0bd3
BLAKE2b-256 b30ea2e884d089761372b8bf03134b9677c75368b4b81122b4a909e3d2255ce3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.3 This release

1 file

0.2.2

1 file

0.2.1

1 file

0.2

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page