Re: How can i use Knockout Java Script with my Django Project?
Please ask questions about using Django on django-users. The topic of this list is the development of Django itself. Thanks, Karen -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
How can i use Knockout Java Script with my Django Project?
Hello Everyone, I am beginner to Django and currently i developing a project using django and for client side i would like to use knockout JS, So would you please help to achieve this. Thanks a lot, Regards, abdul -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: cycle in nested loops
Hi, On Friday 01 February 2013, Aymeric Augustin wrote: > Hi Wim, > > Le 21 janv. 2013 à 18:01, Wim Feijen a écrit : > > Actually, the current behaviour is not to reset between loops. Is that > > intentional? > > Yes, this behavior is intentional. See Malcolm's comment (#4) on the > ticket. > > > A patch to ticket 5908 adds a reset_cycle tag, which resets the > > cycle-loop. I am wondering if it is the right way to solve this problem > > That's what Malcolm said, and I tend to agree with him. I'm not > particularly excited by adding a new tag but I don't have a better idea. > Something like {% cycle row_colors reset %} would conflict with the > regular {% cycle %} syntax. > There are two other ways I see. 1) There is a way to include a 'reset' keyword in the cycle tag -- it only requires the use of an assignment; the same way allows use of the 'silent' keyword. {% cycle 'v1' 'v2' v3 as dummy reset %} This is a little awkward -- the 'silent' keyword indeed doesn't make sense without an assignment, but for 'reset' forcing the assignment is only done for backwards-compatibility's sake. Also, as Aymeric said, > Besides, introducing coupling between {% cycle %} and > {% for %} / {% endfor %} sounds like a bad idea. 2) I think it may be better to solve this by giving the user more control over the cycling -- letting them set the index variable, so, use something like {% cycle 'v1' 'v2' v3 index=forloop.counter0 %} Where this still deserves being called "cycle" and not "select" because of the cyclic interpretation of the index. This solves the problem in the ticket, and allows other possibilities as well. The syntax is new, so it doesn't collide with old syntax in the cycle tag. Named arguments like this are not used often in template tags, but they do exist in the {% include %} tag (admittedly, there is a reason for it there that is not present here). Other alternatives which I see as acceptable are to use one of the keywords used in other tags -- 'on' (used in autoescape) or 'by' (used in regroup) seem appropriate: {% cycle 'v1' 'v2' v3 by forloop.counter0 %} This is strictly not backwards-compatible, as it will break templates where a context-variable named 'by' was used as an argument to the cycle tag, but I suspect that may be acceptable. Anyway, my 2 cents, Shai. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: search across models
You also posted this to django-users, which is where it belongs. Please do not crosspost usage questions to django-developers; the topic of this list is the development of Django itself. Thanks, Karen -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
search across models
hi all, i have a big question. how can i perform search queries like on following models RESTAURANT_TYPES = ( ('C', 'Chinese'), ('A', 'American'), ('J', 'Japanese'), ) class city (models.Model): name = models.CharField(max_length=200) class restaurants(models.Model): name = models.CharField(max_length=456) city = models.ForeignKey(city) type = models.CharField(max_length=10, choices=RESTAURANT_TYPES) is_veg = models.BooleanField(default=True) search queries: 1. restaurants in city1 2. city1 restaurants 3. Chinese restaurants 4. Chinese restaurants in city1 5. vegetarian restaurants in city1 6. vegetarian american restaurants 7. and so on... -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.