Xairro.com

Django Fragen

  • Chris
  • Avatar
  • Nov. 1, 2008, 2:46 p.m.

Hallo :D

lern grad mit Django Projekte zu erstellen und jetzt beim Templating hab ich ein paar Fragen:

1.) Wie kann ich mehrmals auftretende templateteile wieder einbauen? Also ein Template ins andere einfügen?

2.) Ich bau grad das Beispiel aus der Doku nach. Nur wie mach ich das? choice{{ choice.votes|pluralize }} ergibt votes. Stimme{{ choice.votes|pluralize }} ergibt aber auch Stimmes. Wie kann ich das abändern?

Danke :)

Rating: 0 Permalink

Also du meinst, wie du zum Beispiel den Seiteninhalt in ein Layout einfügen kannst? Wenn ja, dann sollte das hiermit gehen.

Und beim Plural machst du einfach das:

Stimme{{ choice.votes|pluralize:"n" }}

There are only 10 types of people in the world: Those who understand binary, and those who don't.

Rating: 0 Permalink
  • Chris
  • Avatar
  • Nov. 1, 2008, 3:10 p.m.

ersteres hab ich auch grad gelesen :) ist super gemacht mit den blöcken...

ah, das ist gut. danke ;)

Rating: 0 Permalink
  • Chris
  • Avatar
  • Nov. 1, 2008, 3:16 p.m.

Noch eine Frage: Wenn man am Anfang erstmal nur mit dem Testserver arbeitet, wo kann man dort Medien wie Icons oder Stylesheets verstauen?

Rating: 0 Permalink
  • Julian
  • Avatar
  • Nov. 1, 2008, 4:55 p.m.

Und mal wieder der Verweis auf die Dokumentation: http://docs.djangoproject.com/en/dev/howto/static-files/


There are only 10 types of people in the world: Those who understand binary, and those who don't.

Rating: 0 Permalink
  • Chris
  • Avatar
  • Nov. 1, 2008, 5:02 p.m.

Danke ;)

du bist eine gute bookmark-bibliothek :D

Rating: 0 Permalink