{% include 'blocks/cart_items.html' %}
например.<div class="cart-wrap">
{% include 'blocks/cart_items.html' %}
</div>
$('.cart-wrap').html( 'тут дата которая пришла с сервера' );
Как можно переделать мой код, или что нужно сделать чтобы данные передавались?
{% block breadcrumbs %}
<div class="breadcrumb"><a href="/">Главная</a></div>
{% endblock %}
{% extends 'base.html' %}
{% block breadcrumbs %}
{{ block.super }}
<div class="breadcrumb"><a href="{% url 'articles:articles' %}">Каталог статей</a></div>
{% endblock %}
{% extends 'articles.html' %}
{% block breadcrumbs %}
{{ block.super }}
<div class="breadcrumb"><a href="{% url 'articles:article_view' article_id=article.id %}">{{ article.title }}</a></div>
{% endblock %}
filename=“myfile.doc”
Args:
chat_id (:obj:`int` | :obj:`str`): Unique identifier for the target chat or username
of the target channel (in the format @channelusername).
document (:obj:`str` | `filelike object` | :class:`telegram.Document`): File to send.
Pass a file_id as String to send a file that exists on the Telegram servers
(recommended), pass an HTTP URL as a String for Telegram to get a file from the
Internet, or upload a new one using multipart/form-data. Lastly you can pass
an existing :class:`telegram.Document` object to send.
filename (:obj:`str`, optional): File name that shows in telegram message (it is useful
when you send file generated by temp module, for example). Undocumented.
caption (:obj:`str`, optional): Document caption (may also be used when resending
documents by file_id), 0-1024 characters.
parse_mode (:obj:`str`, optional): Send Markdown or HTML, if you want Telegram apps to
show bold, italic, fixed-width text or inline URLs in the media caption. See the
constants in :class:`telegram.ParseMode` for the available modes.
disable_notification (:obj:`bool`, optional): Sends the message silently. Users will
receive a notification with no sound.
reply_to_message_id (:obj:`int`, optional): If the message is a reply, ID of the
original message.
reply_markup (:class:`telegram.ReplyMarkup`, optional): Additional interface options. A
JSON-serialized object for an inline keyboard, custom reply keyboard, instructions
to remove reply keyboard or to force a reply from the user.
thumb (`filelike object`, optional): Thumbnail of the
file sent. The thumbnail should be in JPEG format and less than 200 kB in size.
A thumbnail's width and height should not exceed 90. Ignored if the file is not
is passed as a string or file_id.
timeout (:obj:`int` | :obj:`float`, optional): Send file timeout (default: 20 seconds).
**kwargs (:obj:`dict`): Arbitrary keyword arguments.
Returns:
:class:`telegram.Message`: On success, the sent Message is returned
import sqlite3
import tkinter as tk
import tkinter.ttk as ttk
class Table(tk.Frame):
def __init__(self, parent=None, headings=tuple(), rows=tuple()):
super().__init__(parent)
table = ttk.Treeview(self, show="headings", selectmode="browse")
table["columns"] = headings
table["displaycolumns"] = headings
for head in headings:
table.heading(head, text=head, anchor=tk.CENTER)
table.column(head, anchor=tk.CENTER)
for row in rows:
table.insert('', tk.END, values=tuple(row))
scrolltable = tk.Scrollbar(self, command=table.yview)
table.configure(yscrollcommand=scrolltable.set)
scrolltable.pack(side=tk.RIGHT, fill=tk.Y)
table.pack(expand=tk.YES, fill=tk.BOTH)
data = (,)
with sqlite3.connect('test.db') as connection:
cursor = connection.cursor()
cursor.execute("SELECT * FROM users")
data = (row for row in cursor.fetchall())
root = tk.Tk()
table = Table(root, headings=('Фамилия', 'Имя', 'Отчество'), rows=data)
table.pack(expand=tk.YES, fill=tk.BOTH)
root.mainloop()
ImageField
можно добавить название, описание, сортировочный индекс и т.д. Как правило эти дополнительные данные всегда нужны.class Photoalbum(models.Model):
...
class PhotoalbumImage(models.Model):
photoalbum = models.ForeignKey(Photoalbum, ...)
image = models.ImageField('изображение', ...)
...