Re: Slug (w/o using SlugField) Problems

2007-07-18 Thread Forest Bond
On Wed, Jul 18, 2007 at 07:10:27PM -, John-Scott wrote: > Next, change your urls.py like so: > > (r'^characters/(?P\d+)[-\w]+/$', object_detail, > dict(character_detail_dict)), > > This should capture the '123' and discard '-bob-and-jane'. This is a > fairly elegant solution that allows you t

Re: Slug (w/o using SlugField) Problems

2007-07-18 Thread John-Scott
The option I want to implement, and which my be a suitable solution for your situation, is to combine the object id with the slugified version of the object name. Then in your urls.py, only capture the object id and ignore the slug when retrieving the object (this gets you past any issues with rev

Re: Slug (w/o using SlugField) Problems

2007-07-18 Thread John-Scott
Hello, I'm using a solution I saw on a RoR blog (http:// blog.hasmanythrough.com/2006/7/7/more-on-naming-and-the-crud has a summary of the technique) which should address the 'reversibility' issue. Basically you just concatenate the object id with the slug of the human readable name, but then jus

Re: Slug (w/o using SlugField) Problems

2007-07-06 Thread Tim Chase
>> You might need to adopt a different approach to URL construction that is >> reversible (writing your own version of slugify, possibly?). > > Thanks for the help Malcolm. Using Jeff Croft's "I'm not a programmer" > excuse, would it be too much trouble to request a small example of a > reversibl

Re: Slug (w/o using SlugField) Problems

2007-07-06 Thread Bryan Veloso
> You might need to adopt a different approach to URL construction that is > reversible (writing your own version of slugify, possibly?). Thanks for the help Malcolm. Using Jeff Croft's "I'm not a programmer" excuse, would it be too much trouble to request a small example of a reversible slugify?

Re: Slug (w/o using SlugField) Problems

2007-07-06 Thread Malcolm Tredinnick
On Fri, 2007-07-06 at 11:41 +, Bryan Veloso wrote: > Alright, well let me get the information out of the way first: > > models.py > -- > char_id = models.IntegerField('Character ID', > primary_key=True) > name= models

Slug (w/o using SlugField) Problems

2007-07-06 Thread Bryan Veloso
Alright, well let me get the information out of the way first: models.py -- char_id = models.IntegerField('Character ID', primary_key=True) name= models.CharField('Name', maxlength=90) def get_absolute_url(self): ret