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
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
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
>> 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
> 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?
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
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
7 matches
Mail list logo