Django 4.2.x Documentationlookup had failed, it would’ve tried a list-index lookup. Method-calling happens in the {% for %} loop: question.choice_set.all is interpreted as the Python code question.choice_set.all(), which returns development practice in general. forloop.counter indicates how many times the for tag has gone through its loop Since we’re creating a POST form (which can have the effect of modifying data), we need to worry above, as you cannot call blocking synchronous code from asynchronous code - it will block up the event loop (or, more likely, Django will notice and raise a SynchronousOnlyOperation to stop that from happening)0 码力 | 3305 页 | 3.16 MB | 1 年前3
Django 4.1.x Documentationlookup had failed, it would’ve tried a list-index lookup. Method-calling happens in the {% for %} loop: question.choice_set.all is interpreted as the Python code question.choice_set.all(), which returns development practice in general. forloop.counter indicates how many times the for tag has gone through its loop Since we’re creating a POST form (which can have the effect of modifying data), we need to worry above, as you cannot call blocking synchronous code from asynchronous code - it will block up the event loop (or, more likely, Django will notice and raise a SynchronousOnlyOperation to stop that from happening)0 码力 | 3240 页 | 3.13 MB | 1 年前3
Django 4.0.x Documentationlookup had failed, it would’ve tried a list-index lookup. Method-calling happens in the {% for %} loop: question.choice_set.all is interpreted as the Python code question.choice_set.all(), which returns practice in general. • forloop.counter indicates how many times the for tag has gone through its loop 2.6. Writing your first Django app, part 4 39 Django Documentation, Release 4.0.11.dev20230214085346 the save() method is called on each instance, you don’t need any special function to handle that. Loop over them and call save(): for item in my_queryset: item.save() Calls to update can also use F expressions0 码力 | 2248 页 | 7.90 MB | 1 年前3
Django 4.0.x Documentationlookup had failed, it would’ve tried a list-index lookup. Method-calling happens in the {% for %} loop: question.choice_set.all is interpreted as the Python code question.choice_set.all(), which returns development practice in general. forloop.counter indicates how many times the for tag has gone through its loop Since we’re creating a POST form (which can have the effect of modifying data), we need to worry the save() method is called on each instance, you don’t need any special function to handle that. Loop over them and call save(): for item in my_queryset: item.save() Calls to update can also use0 码力 | 3184 页 | 3.14 MB | 1 年前3
Django 3.2.x Documentationlookup had failed, it would’ve tried a list-index lookup. Method-calling happens in the {% for %} loop: question.choice_set.all is interpreted as the Python code question.choice_set.all(), which returns practice in general. • forloop.counter indicates how many times the for tag has gone through its loop 2.6. Writing your first Django app, part 4 39 Django Documentation, Release 3.2.21.dev • Since the save() method is called on each instance, you don’t need any special function to handle that. Loop over them and call save(): for item in my_queryset: item.save() 128 Chapter 3. Using Django Django0 码力 | 2199 页 | 7.89 MB | 1 年前3
Django 3.2.x Documentationlookup had failed, it would’ve tried a list-index lookup. Method-calling happens in the {% for %} loop: question.choice_set.all is interpreted as the Python code question.choice_set.all(), which returns development practice in general. forloop.counter indicates how many times the for tag has gone through its loop Since we’re creating a POST form (which can have the effect of modifying data), we need to worry the save() method is called on each instance, you don’t need any special function to handle that. Loop over them and call save(): for item in my_queryset: item.save() Calls to update can also use0 码力 | 3121 页 | 3.08 MB | 1 年前3
Django 3.1.x Documentationlookup had failed, it would’ve tried a list-index lookup. Method-calling happens in the {% for %} loop: question.choice_set.all is interpreted as the Python code question.choice_set.all(), which returns development practice in general. forloop.counter indicates how many times the for tag has gone through its loop Since we’re creating a POST form (which can have the effect of modifying data), we need to worry the save() method is called on each instance, you don’t need any special function to handle that. Loop over them and call save(): for item in my_queryset: item.save() Calls to update can also use0 码力 | 3094 页 | 3.03 MB | 1 年前3
Django 4.1.x Documentationlookup had failed, it would’ve tried a list-index lookup. Method-calling happens in the {% for %} loop: question.choice_set.all is interpreted as the Python code question.choice_set.all(), which returns practice in general. • forloop.counter indicates how many times the for tag has gone through its loop • Since we’re creating a POST form (which can have the effect of modifying data), we need to worry above, as you cannot call blocking synchronous code from asynchronous code - it will block up the event loop (or, more likely, Django will notice and raise a SynchronousOnlyOperation to stop that from happening)0 码力 | 2777 页 | 9.32 MB | 1 年前3
Django 4.2.x Documentationlookup had failed, it would’ve tried a list-index lookup. Method-calling happens in the {% for %} loop: question.choice_set.all is interpreted as the Python code question.choice_set.all(), which returns practice in general. • forloop.counter indicates how many times the for tag has gone through its loop • Since we’re creating a POST form (which can have the effect of modifying data), we need to worry above, as you cannot call blocking synchronous code from asynchronous code - it will block up the event loop (or, more likely, Django will notice and raise a SynchronousOnlyOperation to stop that from happening)0 码力 | 2842 页 | 9.47 MB | 1 年前3
Django 3.1.x Documentationlookup had failed, it would’ve tried a list-index lookup. Method-calling happens in the {% for %} loop: question.choice_set.all is interpreted as the Python code question.choice_set.all(), which returns practice in general. • forloop.counter indicates how many times the for tag has gone through its loop • Since we’re creating a POST form (which can have the effect of modifying data), we need to worry the save() method is called on each instance, you don’t need any special function to handle that. Loop over them and call save(): 124 Chapter 3. Using Django Django Documentation, Release 3.1.15.dev0 码力 | 2053 页 | 6.92 MB | 1 年前3
共 91 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10













