#5172: Extend the {% for %} tag to work as a simple loop
---------------------------------------------+------------------------------
          Reporter:  SmileyChris             |         Owner:  nobody           
          
            Status:  reopened                |     Milestone:                   
          
         Component:  Template system         |       Version:  SVN              
          
        Resolution:                          |      Keywords:  for-tag 
enhancement feature
             Stage:  Design decision needed  |     Has_patch:  1                
          
        Needs_docs:  1                       |   Needs_tests:  0                
          
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Changes (by danielcristian):

 * cc: [EMAIL PROTECTED] (added)
  * status:  closed => reopened
  * resolution:  wontfix =>

Comment:

 I had this model:

 {{{
 class Mana(models.Model):
     name = models.CharField(u'Mana', max_length=200, unique=True)
     image = models.ImageField(u'Symbol', upload_to='manas/')

 class Cost(models.Model):
     card = models.ForeignKey(Card)
     quantity = models.IntegerField('Quantity', max_length=2)
     mana = models.ForeignKey(Mana, related_name=u'mana',
 verbose_name=u'Mana')
 }}}

 (Yes, it's related to Magic Cards...)

 Some cards had a cost with a quantity value (1 Forest, 3 Islands, 5
 Mountains), and I need to loop quantity times to show n-times the image
 cost.

 It could be done with this kind of loop.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5172#comment:12>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to