Hello,
I want to be able to add files inside a model to test that model.
However, I'm unable to find in the documentation any mention on how to
do so. I asked on IRC and somebody suggested the following:
from django.core.files import File
from myproject.myapp.models import MyModel
fd =
Hello,
I have been looking at the Jinja templating engine lately to be used
in our web sites. Their web site claims that it is in average three
times faster than Django's templating engine. I decided to see that
for myself by designing a few, simple test cases. The biggest
surprise came not
Hello,
I have a curious problem with a complex filter in 0.96:
Merchant.objects.filter(Q(categories_fr__name__icontains=s) |
Q(categories_en__name__icontains=s))
this returns an empty queryset even when 's' is in categories_fr.
Changing categories_fr__name with an attribute directly in the
{{ price|floatformat:2 }}
On Aug 19, 4:44 pm, Greg <[EMAIL PROTECTED]> wrote:
> I have a FloatField called price that stores the price of different
> elements. When the price is 19.99, 19.79, 19.01 etc... everything is
> displayed correctly. However, when I have a price of 19.00. The
> price
Hello,
My coworker and I have a sizable Django project called Gestio. We're
pretty much done writing it, so now we're making sure that it'll work
without hitches wherever we may install it. Thanks to the {% url %}
tag, we can choose to place the application under /, /gestio, /webapps/
gestio
There's django-multilingual for that.
On Aug 10, 1:05 pm, Grupo Django <[EMAIL PROTECTED]> wrote:
> Vincent Foley ha escrito:
>
>
>
> > Hello,
>
> > I work for a company who develops web sites and web applications for
> > clients in Quebec
Has your "Django Master Class" at OSCON 07 been taped?
Vincent
On Aug 10, 11:12 am, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]>
wrote:
> On 8/10/07, Brian Rosner <[EMAIL PROTECTED]> wrote:
>
> > I saw the video of you presenting Django to Google at one of their Tech
> > Talks and I am not sure if I
Hello,
I work for a company who develops web sites and web applications for
clients in Quebec. People in Quebec mainly speak french, but there
are english speaking people too. Most sites we make eventually want
to have a french and english version with french being the "main"
version.
I would
Hello,
I found a curious problem in my application when I put it into
production this week: when a models.FloatField is "extracted" from the
database, its type changes depending on the database. With SQLite in
development, I got back floats, while on MySQL in production I have
decimals. As
Use validators in newforms.
class MyForm(newforms.Form):
secret_phrase = newforms.CharField(label='Secret phrase',
required=True)
def clean_secret_phrase(self):
if self.cleaned_data.get('secret_phrase') == 'xyzzy':
return True
else:
raise
My problem is that I need to sort on a field in a another table. I
found a workaround:
File.objects.select_related().filter(...).order_by('app_table.column')
It works for me because the foreign key cannot be NULL.
Vincent.
On Jul 11, 6:27 pm, Drasty <[EMAIL PROTECTED]> wrote:
> Have you
It works fine with me:
>>> from django.template import Template, Context
>>> t = Template('''{% ifequal s "Some Thing" %}Equal{% else %}Not equal{%
>>> endifequal %}''')
>>> t.render(Context({'s': 'foo'}))
'Not equal'
>>> t.render(Context({'s': 'Some Thing'}))
'Equal'
What version of Django
There's more than one way to do it (with apologies if you don't like
Perl). One thing I like to use is IPython which allows you to start a
Python interpreter from any point in your code with the entire
context.
So to test a function, you could add the following lines at the bottom
of
the
13 matches
Mail list logo