Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
In-memory variables versus querying database
Part of my app is to render many charts whose data are updated at some predefined time interval. The conventional Django way is obvious: write new data to database; if the view of the charts is called, query the database for the desired records, and render them in the charts. Clearly, this results in a lot of database hits and data frame manipulation, which put latency of chart rendering. So I want to read the desired number of records into memory right when the Django server starts (for simplicity, read into a pandas data frame). That data frame's, df, size is fixed, say N x M. When new data arrives at the app, this df then pop and push accordingly to maintain the N x M size. And at the same time, update the charts. Writing the new data into database can be done separately. Specifically: #data_utils.py def read_db(): ... return df #views.py def all_charts(request): ... chart_components = show_charts(df) return render(request, 'charts/charts.html', chart_components) #urls.py app_name = 'charts' urlpatterns = [ path('', views.all_charts, name='all_charts'), ] For simplicity, assume that the function show_charts() returns appropriate stuff to render the charts (i.e. HTML and JavaScript, etc.) My question: is this approach recommended within … -
How can I convert raw join query into django orm query
I have three models and i want to get data related products throughout these models, there is Product Model,Product Review Model,Colour,Product Image model. I want to get model,review,colour,image of every product. Models.py class Product(models.Model): product_name=models.CharField(max_length=300,blank=True) product_description=models.CharField(max_length=5000,blank=True) sale_price=models.IntegerField(blank=True) review_count=models.IntegerField(default=3.9,blank=True,null=True) created_date=models.DateField(blank=True,null=True) category_name=models.CharField(max_length=50,null=True,blank=True) class Colour(models.Model): colour_name=models.CharField(max_length=20,blank=True) colour_product=models.ForeignKey(Product,on_delete=models.CASCADE) class ProductImages(models.Model): image=models.ImageField(upload_to='product_images',null=True,blank=True) image_product=models.ForeignKey(Product,on_delete=models.CASCADE) class ProductReviews(models.Model): product=models.ForeignKey(Product,on_delete=models.CASCADE,null=True,blank=True) stars=models.FloatField(null=True,blank=True) I have developed raw query, how can convert this query into ORM query, i have researched and checked out select_related, can someone guide how can i use this in most optimized way, below is my raw query: query = """ SELECT p.id, p.name, pi.image, r.review, c.color FROM Product as p, ProductImages as pi, ProductReviews as r, Colour as c WHERE p.id= pi.product_id AND p.id=r.product_id AND p.id=c.product_id; """ How can i use this in django ORM -
Unable to import file of another folder in Django Project
Screenshot of Error I'm unable to import class from file Views.py(location: another folder) in file urls.py It is showing error No module named VisitorAPI.views (seems like it is looking for file in same folder not in another folder) Tried various solutions but nothing is working out! -
Django Datatable View column sorting
I am using django-datatable-view from here https://django-datatable-view.readthedocs.io/en/latest/index.html. I am having some issues and the documentation doesn't seem to cover reasons as to why. My guess is that the data is not from the model itself but an annotated field added to queryset. I have a table with many field but the ones in question would be 'active' and 'get_set'. class RetailerStoresDatatable(Datatable): geo = columns.TextColumn( "Geo", sources=["geo_set"], processor="get_geo", sortable=True ) class Meta: model = StoreAddress page_length = 50 columns = [ ... "active", ] processors = { ..., "active": helpers.make_xeditable, } structure_template = "datatableview/bootstrap_structure.html" def get_geo(self, instance, *args, **kwargs): return render_to_string( "administrator/retailer_stores_columns.html", dict(column_key="get_geo", store=instance) ) class AdminRetailserStoresView(XEditableDatatableView): datatable_class = RetailerStoresDatatable def get_queryset(self): queryset = ( StoreAddress.objects.filter(...) .annotate( geo_set=Case( When(geo_lat__isnull=False, geo_lng__isnull=False, then=True), default=False, output_field=BooleanField(), ), ) ) return queryset I am filtering by active / not, and it works with below JS. Example for true. value = true $('.datatable').DataTable().columns({{ columns_map|get_dict_item:"active" }}).search(JSON.parse(value)).draw() I am trying the exact same with geo but it just ignores and returns all records that were already present. Set Geo column is True/False text. It i change "geo" to "active" just to test it filters active fine. So as above, i think it is to do with the fact … -
HttpResponseRedirect have extra path and fail
this is code views.py def monthly_challenges_by_number(request,month): months = list(monthly_challenges.keys()) redirect_month = months[month-1] return HttpResponseRedirect("challenges/" + redirect_month) def monthly_challenge(request,month): try: content_text = monthly_challenges[month] return HttpResponse(content_text) except: return HttpResponseNotFound("this is not supported!!") challenges/urls.py urlpatterns = [ path("<int:month>", views.monthly_challenges_by_number), path("<str:month>", views.monthly_challenge), ] monthly_challenges/urls.py urlpatterns = [ path('admin/', admin.site.urls), path("challenges/",include("challenges.urls")) ] error : Not Found: /challenges/challenges/february Using the URLconf defined in monthly_challenges.urls, Django tried these URL patterns, in this order: admin/ challenges/ <int:month> challenges/ <str:month> The current path, challenges/challenges/february, didn’t match any of these. i am following a django course and follow his code,but i don't know why HttpResponseRedirect is two challenges ? please help! thank you -
How to filter category wise products and display it on same all products page without creating extra category.html
I actuallu stuck on this problem that where i have an index.html page, it shows all stores and their category and if someone clicks on this category i want to filter out stores by that category and i want to show this stores on same index.html page without creating extra category.html so here my code View.py def index(request,stores_name=None): stores = stores_model.objects.all() context = {'stores': stores} return render(request,'Stores/index.html', context) def categories(request , cats): categoriesproduct = stores_model.objects.filter(scategory = cats) context = {'categoriesproduct':categoriesproduct} return render(request , 'Stores/categories.html') index.html {%for i in stores%} {{i.stores_name}} <a href={{i.get_absolute_url}}>{{i.category}}</a> {%endfor%} is any idea if someone click on category then same index.html should open and instead of all stores only stores of that category should show -
I am getting this error for deploying my app on heroku
ERROR: Command errored out with exit status 1: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sfkqlnxn/h5py/setup.py'"'"'; file='"'"'/tmp/pip-install-sfkqlnxn/h5py/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-rhckdime/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/h5py Check the logs for full command output. ! Push rejected, failed to compile Python app. ! Push failed -
Django no reverse match for view details
im stuck on show details for object, no matter i do (following all guides on internet ) still getting reverse not match error `views.py def val_details(request, id): val = Validator.objects.get(id=id) print(f'vali: {val}') context = dict(val=val) return render(request, 'users/val_details.html', context) print(f'vali: {val}') printing vali: Validator object (14) html <button class="btn btn-warning " href="{% url 'val-details' val.id %}">detals</button> urls.py path('validator/<int:id>/', user_views.val_details, name='val-details'), models.py class Validator(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=True) name = models.CharField(max_length=200, blank=True, null=True) address = models.CharField(max_length=200, blank=True, null=True) owner = models.CharField(max_length=250, blank=True, null=True) created_at = models.DateTimeField(auto_now_add=True) def __int__(self): return self.id error django.urls.exceptions.NoReverseMatch: Reverse for 'val-details' with arguments '('',)' not found. 1 pattern(s) tried: ['users/validator/(?P<id>[0-9]+)/$'] -
TabularInline not syncing properly
I am a beginner in python-django coding. Currently, I am following a guide which is https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Admin_site. I am stuck on the last step where TabularInline is used to display all the identical books data under the same Genre. I have 2 books under the same genre 'Game'. But when I click on Books and 'Wild Rift Guide' (Book data under 'Game' genre). Another book which is also under the same genre doesnt show in tabularinline. It only shows the one I clicked. Appreciate it if anyone can help me. Thank you Codes: In admin.py from django.contrib import admin # Register your models here. from .models import Author, Genre, Book, BookInstance # admin.site.register(Book) # admin.site.register(Author) admin.site.register(Genre) # dmin.site.register(BookInstance) # Define the admin class class AuthorAdmin(admin.ModelAdmin): list_display = ('last_name', 'first_name', 'date_of_birth', 'date_of_death') fields = ['first_name', 'last_name', ('date_of_birth', 'date_of_death')] # Register the admin class with the associated model admin.site.register(Author, AuthorAdmin) class BooksInstanceInline(admin.TabularInline): model = BookInstance # Register the Admin classes for Book using the decorator @admin.register(Book) class BookAdmin(admin.ModelAdmin): list_display = ('title', 'author', 'display_genre') inlines = [BooksInstanceInline] # Register the Admin classes for BookInstance using the decorator @admin.register(BookInstance) class BookInstanceAdmin(admin.ModelAdmin): list_filter = ('status', 'due_back') fieldsets = ( (None, { 'fields': ('book', 'imprint', 'id') }), … -
Django - Trying to return object.id to see item as id in list at the admin site but TypeError at /.../1/change/
I created a model and registered it for the admin site but when I enter the admin site it is shown like "intensivecare_forms_data object (1)" I just try to make it id number to see it in the list I wrote return code but when I try to click on it it gives error. class intensivecare_forms_data(models.Model): id = models.IntegerField(primary_key=True) data = models.JSONField() def __str__(self): return self.id This is the error. TypeError at /admin/DataCollector/intensivecare_forms_data/1/change/ __str__ returned non-string (type int) Request Method: GET Request URL: http://localhost:8000/admin/DataCollector/intensivecare_forms_data/1/change/ Django Version: 3.2.4 Exception Type: TypeError Exception Value: __str__ returned non-string (type int) Exception Location: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/django/contrib/admin/options.py, line 1632, in _changeform_view Python Executable: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3 Python Version: 3.9.6 -
How do I introduce a constraint in django table where 2 values of a column will be unique in a table and other rows can have duplicate pairs?
How do I introduce a constraint in django table where 2 values of a column will be unique in a table and other rows can have duplicate pairs? like a True a False a False a False but not a True a True a False a False a False -
Django admin tabular inline sorting
I am trying to implement the same way of sorting in tabular inline, like in list view. I have found and tried a couple of plugins(There is a django-admin-sortable2 enabled on the first screenshot), but none of them actually allow to click on the table head and sort by columns(See where my cursor is on screenshot). Is this even possible? Here how it is in tabular inline view Here hot it is in list view -
Django admin looks different when I use incognito mode, and I want it always to look like the one in incognito
UI in incognito mode: https://drive.google.com/file/d/10d874FS4JjaB_lJ0aJK29BVcP-dWfu0P/view?usp=sharing UI in normal mode: https://drive.google.com/file/d/1z7iYb6Lx755S1jqTJvW3r47ml-JY8NJV/view?usp=sharing -
Django translation with variable not working
If I do the following works: django.utils.translation.gettext("hola mundo %(variable)s") % { "variable": "test" } Result: 'Une test' But if I do the following it doesn't work: class SiteText(models.Model): HOLA1 = django.utils.translation.gettext_noop("hola mundo %(variable)s") % { "variable": "test" } HOLA2 = django.utils.translation.gettext_lazy("hola mundo %(variable)s") % { "variable": "test" } HOLA3 = django.utils.translation.gettext("hola mundo %(variable)s") % { "variable": "test" } HOLA4 = django.utils.translation.ugettext_lazy("hola mundo %(variable)s") % { "variable": "test" } SiteText.HOLA1 SiteText.HOLA2 SiteText.HOLA3 SiteText.HOLA4 Results: hola mundo test Without variables YES it works, but with variables NO. Why doesn't it work? -
Trying to send emails using Django OSError: [Errno 101] Network is unreachable
I was trying to send email from gmail account to another using django as show in images below settings.py file https://i.stack.imgur.com/4GXMx.png then i get this error when i use the send_mail() OSError: [Errno 101] Network is unreachable https://i.stack.imgur.com/5kISS.png -
How to Deploy a Django Web Application on the compagnie server (Windows Server)
I have just finished the first phase of a Django project (CRM) and willing to deply it in the server we have at the compagnie's level (A Windows server). the objective is to make the application accessible for my co-workers once the are connected to the server. Can you guide me how to do that or recommend some useful tutorials? -
ManyToMany relation queryset result when using prefetch_related
I have the following models shown below. class Document(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE,null=True,blank=True) name = models.CharField(max_length=255,null=True, blank=True) url = models.TextField(null=True, blank=True) objection_no = models.CharField(max_length=255,null=True, blank=True) file = models.FileField(upload_to='objections/',storage=RawMediaCloudinaryStorage()) size = models.CharField(max_length=255,null=True, blank=True) created_at = models.DateTimeField(auto_now_add=True) modified_at = models.DateTimeField(auto_now_add=True) class Property(models.Model): """Represents property class model""" serial_no = models.CharField(unique=True,max_length=255,blank=True,null=True) map_no = models.CharField(max_length=255,blank=True,null=True) lr_no = models.CharField(max_length=255,blank=True,null=True) locality = models.CharField(max_length=255,blank=True,null=True) class PropertyObjection(models.Model): """Represents property objection class. This has properties that have been objected""" objector_name = models.CharField(max_length=255,null=True, blank=True) objection_no = models.CharField(max_length=255,null=True, blank=True) properties = models.ManyToManyField(Property,blank=True) documents = models.ManyToManyField(Property,blank=True) ratable_owner = models.BooleanField(null=True,blank=True) ratable_relation = models.CharField(max_length=50,null=True, blank=True) serializer.py class CustomPropertyObjectionSerializer(serializers.Serializer): objection_no = serializers.CharField() properties__serial_no = serializers.CharField() properties__id = serializers.IntegerField() properties__map_no = serializers.CharField() properties__lr_no = serializers.CharField() ratable_owner = serializers.BooleanField() ratable_relation = serializers.CharField() documents = DocumentSerializer(many=True) class Meta: model = PropertyObjection fields = [ 'properties__serial_no', 'properties__id', 'properties__map_no', 'properties__lr_no', 'properties__locality', 'documents' ] I have the following implementation below and would like to refactor it to return also the documents as a list of objects so that the are serialized into a JSON list. When I make a request I get the following error: TypeError at api/all_objections/'int' object is not iterable. The documents field is returning documents an integer from the queryset result but the field documents in the PropertyObjection model … -
Django ImageField Creating New Folder by ID on upload?
I'm Currently developing creating app with a ManyToMany ImageField Relantionship . I want to have the ImageField save all images to a specific folder based on the ID of the Relantionship. I want to have something like this. class PostImages(models.Model): image = models.ImageField(upload_to='Post_Images/post/' + post.id) class Post(models.Model): images = models.ManyToManyField(JobImages) How do I access the post.id to do this ? Would this affect Database optimization in any way when I deploy ? I intend for this app to have a few thousand users and was gonna use AWS for the images. I mostly want to do this for organization purposes right now cause its on my local machine but also see no reason to change it when I deploy. -
pass some variable of a row in Vue.js as parameters to vue.js method and send out using axios
I have a web app, used Django as backend, Vue.js for the frontend. In the cell, that's a button for every row, which is supposed to get the detail info of the row after click. So I want to pass some variable of a row in Vue.js as parameters to Vue.js method. But I failed to do that, when I tried to click the button, it always submitted the form, but I have added type="button" already. <tbody> <tr v-for="(row, index) in filteredRows" :key="`isbn-${index}`"> <td name="`title_${index}`" v-html="highlightMatches(row.title)">{{ row.title }}</td> <td v-html="highlightMatches(row.author)">{{ row.author }}</td> <td><button type="button" v-on:click="greet( $event, {{ row.title }})">Greet</button></td> <td name="`discipline_code_course_code_${index}`" bgcolor= "white"><div contenteditable></div></td> </tr> </tbody> <script> const app = new Vue({ el: '#app', data:() => ({ filter: '', rows: book_rows }), methods: { greet: function (event, title) { alert(title); #undefined when debug this.$http.post( '/check_code/', { title: title } ); } }, </script> How could I pass some variable of a row in Vue.js as parameters to Vue.js method and send out using axios? -
python command only gives "Python"
enter image description here i got a terminal problem using python. ex) when typing "python --version" and tapping Enter, my terminal only gives "Python" all the other command starting with "python" gives "Python", without executing the command i think it's not that complicated problem, but i don't know what keyword has to be searched. -
update datetime field in model form only shows plain text instead datepicker Django
I'm trying to update my DateTimeField field , but it only shows a plain text of numbers instead of the date picker class MyModel(models.Model): date= models.DateTimeField(default=timezone.now) #others forms.py class UpdateMyModelForm(forms.ModelForm): date= forms.DateTimeField(required=True,input_formats=['%Y-%m-%dT%H:%M','%Y-%m-%dT%H:M%Z'],widget=forms.DateTimeInput(attrs={'type':'datetime'})) class Meta: model = MyModel fields = ['date','others] when i use forms.DateTimeField it doesnt show the previous date which i've selected before! and when i remove forms.DateTimeField it only show a plain text type=text i also tried to use class DateInput(forms.DateInput): input_type = 'date' but it shows only show Y-m-d : year-month-day i have to display hour and minute as well ? is there something else i have to change please -
Page not found (404) likes button
I have a button in my template but it returned None to me. What's my problem HTML code <form action="{% url 'blog:like_post' post.id post.slug %}"> {% csrf_token %} <button type='submit',name = 'post_id', value = "{{post.id}}" class="btn btn_primary btn_sm">Like</button> {{ total_likes }} Likes </form> views.py @login_required def like(request, id, slug): pk = request.POST.get('post_id') print(pk) post = get_object_or_404(Post, id = pk) post.likes.add(request.user) return HttpResponseRedirect(reverse('blog:detail'),kwargs={'id': id, 'slug':slug}) @login_required def DetailPost(request, id, slug): post = Post.objects.get(id=id, slug=slug) total_likes = post.total_likes() context = { 'post' : post, 'total_likes' : total_likes, } return render(request, 'blog/PostDetail.html', context) urls.py urlpatterns = [ re_path(r'detail/(?P<id>[0-9]+)/(?P<slug>[-\w]+)/', DetailPost, name='detail'), re_path(r'like/(?P<id>[0-9]+)/(?P<slug>[-\w]+)/', like, name='like_post') ] I print pk in my terminal and it's show None for value of pk -
Django order by multiple related datetimefields - how to ignore null values
I have one model (Model1) that has multiple related to fields to another model (Model2). What I would like to do is to sort Model1 based on the datetimefields in the related fields to Model2. The issue is that the realted_x fields can be None. class Model1: related_1 = models.ForeignKey(Model2, null=True, default=None, ...) related_2 = models.ForeignKey(Model2, null=True, default=None, ...) related_3 = models.ForeignKey(Model2, null=True, default=None, ...) class Model2: .... planned_publication_datetime = models.DatetimeField(null=True, default=None, ...) I tried the following queries but the ordering is not correct due to None values in the related_x fields. Model1.objects.all().annotate( latest_publication_dt = Greatest( 'related_1__planned_publication_datetime', 'related_2__planned_publication_datetime', 'related_3__planned_publication_datetime', ) ).order_by('latest_publication_dt') The result is ordered in blocks. The first block is only the objects where related_1 is not None, the second one, where related_1 and related_2 is not None and so on. Within the blocks the ordering is correct. What I am trying to achieve is to order Model1 by the latest planned_publication_datetime of the related fields without having the "ordered blocks". -
django heroku programming error: syntax error when migrating
I'm currently pushing my django app to heroku. It successfully deployed. but when i tried to migrate using "heroku run python3 manage.py migrate --app ******", it turned an error, programming error: syntax error. here's the log/error message. Running migrations: Applying core.0001_initial...Traceback (most recent call last): File "/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/utils.py", line 82, in _execute return self.cursor.execute(sql) psycopg2.errors.SyntaxError: syntax error at or near "100000000000" LINE 1: ...Y KEY, "title" varchar(200) NULL, "story" varchar(1000000000... ^ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute output = self.handle(*args, **options) File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/base.py", line 89, in wrapped res = handle_func(*args, **kwargs) File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 244, in handle post_migrate_state = executor.migrate( File "/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/executor.py", line 117, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/executor.py", line 227, in apply_migration state = migration.apply(state, schema_editor) File "/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/migration.py", line 126, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "/app/.heroku/python/lib/python3.9/site-packages/django/db/migrations/operations/models.py", line 92, in database_forwards schema_editor.create_model(model) File "/app/.heroku/python/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 345, … -
TypeError: argument must be int of float
I am getting TypeError: argument must be int of float in django template when running the server Django 2.2.23 python 3.5.2 Here is what my models, views, template looks like models.py class Items(models.Model): DRAFT = 1 APPROVED = 2 SENT = 3 STATUS = ( (DRAFT, '1'), (APPROVED, '2'), (SENT, '3'), ) client = models.ForeignKey("core.Client", null=True, blank=True,on_delete=models.CASCADE) invoice_number = models.IntegerField(blank=True, null=True) class ItemsAdded(models.Model): item_invoice = models.ForeignKey(Items,on_delete=models.CASCADE) class ProductionBill(models.Model): invoice_item = models.ForeignKey(ItemsAdded,on_delete=models.CASCADE) class Sales(models.Model): ''' Records the movements of objects in sale ''' invoice_item = models.ForeignKey(ItemsAdded, related_name='invoice_item', blank=True, null=True,on_delete=models.CASCADE) bom_item = models.OneToOneField(ProductionBill, blank=True, null=True,on_delete=models.CASCADE) status = models.CharField(max_length=20, choices=SALES_STATUS_CHOICES, default='in_stock') This is my views.py class DispatchList(View): def get(self, request): client = request.user.client sales_order = Items.objects.filter(client=client, deleted=False) sales_movements = Sales.objects.filter(status='in_stock') boms = ProductionBill.objects.filter(original_item=True,salesmovement__in=sales_movements) dispatched_items = ItemsAdded.objects.filter(productionbillofmaterials__in=boms,item_invoice__in=sales_order).order_by('-item_invoice__invoice_number') data = { 'sales_order': sales_order, 'dispatched_items': dispatched_items, 'status_options': SALES_STATUS_CHOICES, } return render(request, 'stock/transfersout/dispatch_list_detail.django.html', data) Here is my template template/dispatchlist.html {% if dispatched_items %} <div class="row"> <div class="span11"> <table class="table table-striped"> <thead> <tr> <th class="essential persist">{% trans "Sales Order" %}</th> <th class="essential persist">{% trans "Item Name" %}</th> </tr> </thead> <tbody> {% for item in dispatched_items %} <tr> <td> {{ item.item_invoice.invoice_number }} </a> </td> <td> {{ item.item.item_name }} </a> </td> </tr> {% endfor %} </tbody> </table> </div> <!--/span10--> </div> …