Questions tagged [slugify]

Slugify is a PHP library which helps to convert a string into a slug.

Slugify

  • Removes all special characters from a string. Provides custom replacements for German, French, Spanish, Russian, Ukrainian, Polish, Czech, Latvian, Greek, Esperanto¹, Arabian, Vietnamese and Burmese special characters.
  • Instead of removing these characters, Slugify approximates them (e.g., ae replaces ä).
  • No external dependencies.
  • PSR-4 compatible.
  • Compatible with PHP >= 5.3.3 and HHVM.
  • Integrations for Symfony2, Silex, Laravel, Twig, Zend Framework 2, Nette Framework and Latte.
63 questions
0
votes
1 answer

Slugify and PIL images not working simultaneously inside Django Model Save method

models.py def rand_slug(): return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(6)) class Product(models.Model): """ The Product table contining all product items. """ title = models.CharField( …
0
votes
1 answer

Slugify column and parse csv in Python Pandas to a new csv output

I am a newbie to Python and Pandas. Not sure what I am doing wrong in my code but I am simply trying to convert product name values given in a csv column to a new output csv, as slug values of the corresponding product names. Input is:…
TheMissingNTLDR
  • 247
  • 1
  • 2
  • 10
0
votes
0 answers

How to generate Django slugs on the fly

My question is, is there a way to generate Django slugs on the fly WITHOUT storing them in the DB? I have been tinkering with get_absolute_url but no luck yet. def get_absolute_url(self): randstr =…
quba
  • 123
  • 9
0
votes
1 answer

How can I create Json with data from a form?

I recently started working on a project in which the administrator can create tours online by filling out a form. By completing the form the information to be introduced intro a Mongoose Schema and create JSON. In createcontent.js file takes the…
0
votes
1 answer

Skip saving row if slug already exists to avoid IntegrityError - Django

I'm setting up a function in my Django Views that calls an API and save the data into my Postgresql database. Everthing was working fine until I got an IntegrityError slugkey already exists, so I'm trying to find a way to skip or ignore the row if…
locq
  • 301
  • 1
  • 5
  • 22
0
votes
0 answers

Node blog post title to slug url

Fair warning I am fairly new to node and may not be asking the correct questions I am trying to make a blog on my website and would like the show route for my posts to contain a slugified version of the posts title instead of a long ID. An example…
klaurtar
  • 233
  • 3
  • 23
0
votes
1 answer

Django SlugField "This field is required" error

In my django project there's a Blog model which I'm willing to create a slug for it's title: class Blog(models.Model): title = models.CharField(default='', max_length=100, verbose_name=u'عنوان') slug = models.SlugField(max_length=100,…
Ghasem
  • 14,455
  • 21
  • 138
  • 171
0
votes
1 answer

Slugify a thread link and create it on the home.html

I am trying to slugify my hyperlinks. I created a Django board (home.html): Currently I have: http://127.0.0.1:8000/request/2/ But I want: http://127.0.0.1:8000/request/hallo-das-ist-ein-test-9/ {% for topic in topics %} {{…
JohnDole
  • 525
  • 5
  • 16
0
votes
1 answer

with migration to fill slug with default value

In my Laravel 5.6/PostgreSQL 10.5 application I have 2 tables : CREATE TABLE public.rt_genres ( id serial NOT NULL, published bool NULL DEFAULT false, created_at timestamp NOT NULL DEFAULT now(), updated_at timestamp NULL, …
mstdmstd
  • 586
  • 15
  • 39
0
votes
1 answer

Php Slugifiy function returned value is different in 2 servers

This is my slugify function: function slugify($text) { $text = preg_replace('~[^\\pL\d]+~u', '-', $text); $text = trim($text, '-'); $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); $text = mb_strtolower($text, 'UTF-8'); $text…
Andres SK
  • 10,779
  • 25
  • 90
  • 152
0
votes
1 answer

How to add slug to flask blog app

Recently I am trying to build a blog following Grinberg Miguel Flask mega tutorial. I got stocked when I try to slug my post title such that when it is clicked the detail will be displayed. This is my code: (models.py) class Post(db.Model): id =…
Mavis W L
  • 11
  • 2
0
votes
1 answer

Slugify issue in django template

I have a link in a django html template. I want to pass in a slugified string to the view for processing. I am getting an error and it is no slugifying the string. here is the code I have. Am I missing something or do i need to add something for…
Omar Jandali
  • 814
  • 3
  • 20
  • 52
0
votes
1 answer

Can't auto-generate slug realtime in Laravel 5.4

I want to auto-generate slug when user input the title.
Ave
  • 4,338
  • 4
  • 40
  • 67
0
votes
1 answer

where to define a slug without a model.py in Django

I am rather new to django, and am looking at where to define a slug in django when creating a backend without models. the url is created as such: url(r'^main/(?P[-\w]+)/', include('main.urls')), I have slugs within my main.urls which I define…
Desario
  • 13
  • 1
  • 4
0
votes
1 answer

Python Openpyxl - Copy values from column A to B with same rows range

I'm iterating through the column A. Inside this column I'm using two functions to unicode values. # -*- coding: utf-8 -*- from django.template import defaultfilters from unidecode import unidecode import openpyxl wb =…