search
menu
person

NEWS AND UDATES


http://habrahabr.ru/blogs/sysadm/82552/ - настройка сетевого запуска

http://habrahabr.ru/tag/boot/

http://rutracker.org/forum/viewtopic.php?t=3540117 - Скрытый клинок / Kakushi-ken: oni no tsume / The Hidden Blade
Просмотров: 512 | Добавил: django | Дата: 14.12.2011 | Комментарии (0)

Django’s template system comes with a wide variety of built-in tags and filters designed to address the presentation logic needs of your application. Nevertheless, you may find yourself needing functionality that is not covered by the core set of template primitives. You can extend the template engine by defining custom tags and filters using Python, and then make them available to your templates using the {% load %} tag.

Code layout
Custom template tags and filters must live inside a Django app. If they relate to an existing app it makes sense to bundle them there; otherwise, you should create a new app to hold them.

The app should contain a templatetags directory, at the same level as models.py, views.py, etc. If this doesn’t already exist, create it - don’t forget the __init__.py file to ensure the directory is treated as a Python package.

Your custom tags and filters will live in a module inside the templatetags directory. The name of t ... Читать дальше »
Просмотров: 13382 | Добавил: django | Дата: 14.12.2011 | Комментарии (0)

Появилась очень удобная система для импорта данных из excel в django:

Чтобы начать использовать это приложение django в своем проекте:

1. Переходим на страницу https://github.com/ostrovok-team/django-import-excel и нажимаем кнопку Watch
2.Скачиваем проект себе https://github.com/ostrovok-team/django-import-excel/zipball/master
3. Распаковываем, переходим в папку и запускаем pip install -e . или же python setup.py install
4. В settings.py:

INSTALLED_APPS = [
...
'import_excel',
...
]

5. Итак, например, нам надо импортировать данные из excel для модели

class Book(models.Model):

name = models.CharField(max_length=255)
author = models.CharField(max_length=255)

Файл excel же содержит данные

name | author
Мастер и Маргарита | Михаил Булгаков
И дольше века длится день | Чингиз Айтматов

Для этого создаем форму ... Читать дальше »
Просмотров: 1999 | Добавил: django | Дата: 14.12.2011 | Комментарии (0)

This publication is present of django system for import data from excel:

Use this step by step for rapid start use wih django application:

1. Follow to page https://github.com/ostrovok-team/django-import-excel and push the button Watch
2.Download this project https://github.com/ostrovok-team/django-import-excel/zipball/master
3. Unpack, following to the folder and run pip install -e . or python setup.py install
4. In settings.py:

INSTALLED_APPS = [
...
'import_excel',
...
]

5. So, for example, you need import the data from excel for model

class Book(models.Model):

name = models.CharField(max_length=255)
author = models.CharField(max_length=255)

The excel file contains the data

name | author
Tom Sawyer | Mark Twain
The Sands of Mars | Arthur C. Clarke

To do is, create this form:

from django ... Читать дальше »
Просмотров: 544 | Добавил: django | Дата: 14.12.2011 | Комментарии (0)

Q
I'm using the forms framework. And when I set required=True, this error shows. What if I don't want it to say "This field", but instead, say the label?

Since i'm not going to be displaying it beneath the form input. I"m going to display all the errors at the top of the page.

A
An easy way to specify simple "required" validation messages is to pass the field the error_messages argument.

name = forms.CharField(error_messages={'required': 'Your Name is Required'})
Check the docs for which keys can be specified per field: http://docs.djangoproject.com/en/dev/ref/forms/fields/#django.forms.Field.error_messages

For anything else, you're going to need real form validation which means you'd be writing error messages anyways!

Источник
Просмотров: 1655 | Добавил: django | Дата: 14.12.2011 | Комментарии (0)

Этот документ описывает техническую сторону шаблонной системы Джанго, — как она работает и как ее расширять. Если вам нужно справочное руководство по синтаксису языка шаблонов, см. The Django template language.

Если вы собираетесь использовать шаблонную систему Джанго в качестве элемента отдельного приложения (т.е. не используя сам Джанго), — предварительно прочтите раздел настройки далее в этом документе.

Основы

Шаблон представляет собой текстовый документ или обычную строку Python, размеченную с использованием языка шаблонов Джанго. Шаблон может содержать блочные теги или переменные.

Блочный тег — это часть шаблона, выполняющая какие-либо действия.

Такое определение нарочно сделано размытым. В частности, теги могут выводить некое содержимое, управлять выводом (оператор “if” или цикл “for”), получать информацию из базы данных или включать доступ к другим тегам и фильтрам.

Теги окружены парами символов "{%" и ... Читать дальше »
Просмотров: 5829 | Добавил: django | Дата: 14.12.2011 | Комментарии (0)