Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 23rd, 2012, 07:27 PM
Argento Argento is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Location: Argentina
Posts: 2 Argento User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 39 sec
Reputation Power: 0
What is the best way to encode a title for url structure ?

Hi, what is the best way to encode a title for url structure in Django ?

I think that i have this alternatives:

1) I can save the encoded url in my model (database) and then use it on the template.

2) I can make a method in the model and call it every time i access a content that use the encoded url string.

3) I can make it on urls.py maybe ???

And the other question, how can i make the encoding ?

Iam noob on python, iam starting ! thanks alot !

Reply With Quote
  #2  
Old October 23rd, 2012, 08:54 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is online now
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,379 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 13 h 3 m 20 sec
Reputation Power: 383
Use a unicode string.

Seriously, beats the heck out of me. Call me a curmudgeon, I say read the python tutorial, practice with some small programs, learn something about programming, python, and the standard modules before you try to program the fanciest web page.
Comments on this post
codergeek42 agrees!
__________________
[code]Code tags[/code] are essential for python code!

Reply With Quote
  #3  
Old October 24th, 2012, 01:03 AM
Argento Argento is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Location: Argentina
Posts: 2 Argento User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 39 sec
Reputation Power: 0
You dident understand my question.

I was asking for a method, i found it => slugify

And i was asking for the fastest arquitecture way to do it in this language, seems that saving the slug it is gonna be the best option.
Comments on this post
b49P23TIvg agrees: Correct! I did not understand your question.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > What is the best way to encode a title for url structure ?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap