Hi all,
This is a little announcement of a tag library for {% macro %} support
in Django templates.
I have been using TAL template engine in my previous project and got
used to the concept of "macros" as building blocks of the final HTML
output. Now in Django I realised the missing support for "
olivier wrote:
> Hi Michal,
>
> On 11 août, 04:51, Michal Ludvig <[EMAIL PROTECTED]> wrote:
>
>> It works pretty well and the only drawback is that the defined macros
>> are local to each template file, i.e. are not inherited through
>> {%extends ...%}
b3n wrote:
> Why doesn't Django create primary key integer and tinyint integer
> database fields as UNSIGNED?
Assuming you're talking about MySQL ...
> Especially where a field is used as a flag. e.g. auth_user
>
> is_staff = tinyint(1)
> is_active = tinyint(1)
> is_superuser = tinyint(1)
>
>
b3n wrote:
> Thanks,
>
> OK, but if a field value is only ever going to be 0 or 1, why make it
> signed? It's misleading.
Signed is MySQL default. Use e.g. PositiveSmallIntegerField if you want
it unsigned.
> And what is the purpose of INT(11), why should it be that instead of
> INT(10) ?
Agai
Hi Papa
> i wonder if there is any way to have Macros in django templates
> similar to what Jinja has (http://jinja.pocoo.org/)?
Have a look at "Support for {% macro %} tags in templates" at
http://www.djangosnippets.org/snippets/363/
I bet it's exactly what you're after. It lets you define ma
Hi all,
for the project I'm working on I needed to create a custom template tag,
call it 'mytag'.
If I use it as {% mytag something %} everything goes fine (where
'something' is a string passed to the template).
However I can't add any filters to that 'something'. As soon as I do:
{% mytag somet
Rune Bromer wrote:
> On Dec 5, 2007, at 11:59 AM, Michal Ludvig wrote:
>
>> Hi all,
>>
>> for the project I'm working on I needed to create a custom template
>> tag,
>> call it 'mytag'.
>>
>> If I use it as {% mytag something %} e
Michal Ludvig wrote:
> for the project I'm working on I needed to create a custom template tag,
> call it 'mytag'.
>
> If I use it as {% mytag something %} everything goes fine (where
> 'something' is a string passed to the template).
> However I ca
Hi all,
I have a simple model with 'id' as a primary key and I have a list of
IDs that were already processed in variable 'processed_ids'.
How can I retrieve all objects that are *not* in that list?
Something like "Model.objects.filter(id__not_in = processed_ids)".
Unlike filter(id__in=...) whi
Tim Chase wrote:
>> How can I retrieve all objects that are *not* in that list?
>>
>> Something like "Model.objects.filter(id__not_in = processed_ids)".
>> Unlike filter(id__in=...) which works just fine the __not_in modifier
>> apparently isn't understood by django.
>
>
> As commented recently
Hi
I've got two Django models: Contact and Group, where Group has two
fields: contact and contact_primary linked to Contact. Like this:
|class Group(models.Model):
name = models.CharField(max_length=200)
contacts = models.ManyToManyField(Contact)
contact_primary = models.ForeignKey(Co
On 19/11/13 17:10, Michal Ludvig wrote:
>
> Hi
>
> I've got two Django models: Contact and Group, where Group has two
> fields: contact and contact_primary linked to Contact. Like this:
>
> |class Group(models.Model):
> name = models.CharField(m
12 matches
Mail list logo