Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #html
- <li><a href="/fiches-d-elevages/{{ fiche.categorie|slugify }}/{{ fiche.sous_categorie|slugify }}/{{ fiche.nom_latin|slugify }}-{{ fiche.nom_commun|slugify }}/" title="Afficher la fiche d'élevage de {{ fiche.nom_latin }}( {{ fiche.nom_commun }} - {{ fiche.categorie }}, {{ fiche.sous_categorie }})"> {{ fiche.nom_latin }} - {{ fiche.nom_commun }}</a></li>
- #urls.py
- (r'^(?P<categorie>\w+)/(?P<souscategorie>\w+)/(?P<nomlatin>\w+)-(?P<nomcommun>\w+)', 'fiches.views.details'),
- (r'^(?P<categorie>\w+)/(?P<nomlatin>\w+)-(?P<nomcommun>\w+)', 'fiches.views.details'),
- #views
- def details(request, categorie, souscategorie, nomlatin, nomcommun):
- if souscategorie:
- fiche = get_object_or_404(Fiches, nom_latin=nomlatin, nom_commun=nomcommun, categorie__nom=categorie, sous_categorie__nom=souscategorie)
- else:
- fiche = get_object_or_404(Fiches, nom_latin=nomlatin, nom_commun=nomcommun, categorie=categorie)
- return render_to_response('fiches/details.html', {'fiche':fiche})
- #results:
- fiches-d-elevages/reptiles/serpents/pantherophis-guttatus-guttatus-serpent-des-bles/
- app/category/subcategory/nom-latin-nom-commun/
- he existe with id 1
- (page not found - 404: No Fiches matches the given query.)
Add Comment
Please, Sign In to add comment