<Property Id="WixQuietExecCmdLine" Value='"[INSTALLFOLDER]Lifen.exe" --new-version'/>
[INSTALLFOLDER]
, поскольку среда выполнения MSI гарантирует, что значения всех свойств установочной папки заканчиваются обратной косой чертой. То же самое для аргументов, вам нужно процитировать, если они могут содержать пробелы . Если у вас есть постоянный аргумент, такой как --new-version
, где вы точно знаете, что пробелов нет, вам не нужно заключать в кавычки. Для аргументов, которые содержат ссылки на свойства, безопаснее всегда заключать в кавычки. E. g.:
<Property Id="WixQuietExecCmdLine" Value='"[INSTALLFOLDER]Lifen.exe" "--new-version=[NEWVERSION]"'/>
Если вы сомневаетесь, загляните в подробный журнал , чтобы увидеть, является ли фактическое значение WixQuietExecCmdLine
что вы ожидаете Активируйте подробное ведение журнала, позвонив по номеру msiexec -l*v logfile.txt <OtherParameters>
.
Чтобы запустить 64-битные исполняемые файлы, используйте взамен настраиваемое действие WixQuietExec64
и свойство WixQuietExec64CmdLine
.
Если вы используете Django 1.1 beta (trunk):
Player.objects.values('player_type').order_by().annotate(Count('player_type'))
values ('player_type')
- только для включения поле player_type
в GROUP Предложение BY
. order_by ()
- для исключения возможного упорядочения по умолчанию, которое может вызвать включение ненужных полей в SELECT
и GROUP BY
. Django 1.1 does support aggregation methods like count. You can find the full documentation here.
To answer your question, you can use something along the lines of:
from django.db.models import Count
q = Player.objects.annotate(Count('games'))
print q[0]
print q[0].games__count
This will need slight tweaking depending on your actual model.
Edit: The above snippet generates aggregations on a per-object basis. If you want aggregation on a particular field in the model, you can use the values
method:
from django.db.models import Count
q = Player.objects.values('playertype').annotate(Count('games')).order_by()
print q[0]
print q[0].games__count
order_by()
is needed because fields that are in the default ordering are automatically selected even if they are not explicitly passed to values()
. This call to order_by()
clears any ordering and makes the query behave as expected.
Also, if you want to count the field that is used for grouping (equivalent to COUNT(*)
), you can use:
from django.db.models import Count
q = Player.objects.values('playertype').annotate(Count('playertype')).order_by()
print q[0]
print q[0].playertype__count