Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    django-smart-slug 0.1.0

    Download button

    No screenshots available
    Downloads: 191  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Charles Leifer | More programs
    MIT/X Consortium Lic... / FREE
    July 6th, 2010, 15:57 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-smart-slug description

    A smart slug field for your models

    django-smart-slug is a Django app that provides slug fields for the lazy.

    Examples

    There are exhausting examples in the tests, but here's the quick rundown:

    from django.db import models
    from smart_slug.fields import SmartSlugField

    class Simple(models.Model):
     slug = SmartSlugField(max_length=5, underscores=False)

    class Complex(models.Model):
     title = models.CharField(max_length=100)
     slug = SmartSlugField(
     source_field='title',
     date_field='pub_date',
     split_on_words=True,
     max_length=10)
     pub_date = models.DateTimeField(auto_now=True)

    >>> s1 = Simple.objects.create(slug='simple')
    >>> s1.slug
    simpl

    >>> s2 = Simple.objects.create(slug='simple')
    >>> s2.slug
    sim-1

    >>> s3 = Simple.objects.create(slug='simple')
    >>> s3.slug
    sim-2

    >>> c1 = Complex.objects.create(title='complex example')
    >>> c1.slug
    complex

    >>> c2 = Complex.objects.create(title='complex example')
    >>> c2.slug
    complex_



    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    slug field | Django plugin | Django | slug | field

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM