Hi.
Can anybody recommend a good tool (or PyDev/Eclipse plugin) for
formatting template files?
HTMLTidy with its default settings just doesn't cut it -- it insists on
inserting HTML and body tags around the template and screwing up the
template statements.
Or maybe someone has a good working se
Hello,
I am defining a Product class that gets inherited by various products,
so I am defining in it all the base attributes that exist on all child
products.
I want to know if its possible to forbid changing the actual "products"
table unless you add one of the actual child products.
Also, wha
Hi all,
I have this model
class Photo(models.Model):
name = models.CharField(maxlength=20)
image = models.ImageField(upload_to="cetl/")
def save(self):
import commands
self.image = 'cetl/%s' % commands.getoutput("uuidgen")
super(Photo, self).save()
def __
from django.core import meta
from django.models.auth import users ???
class Recette(meta.Model):
slug = meta.SlugField("Slug", prepopulate_from=('nom',) ,unique=True,
blank=True)
nom = meta.CharField(maxlength=80,help_text=_('Nom de la recette'),
unique=True)
[]
e.g.
from django.models import auth
owner = meta.ForeignKey(auth.User)
... that works for me.
>
> from django.core import meta
> from django.models.auth import users ???
>
> class Recette(meta.Model):
> slug = meta.SlugField("Slug", prepopulate_from=('nom',) ,unique=True,
> blank=True)
> nom
from django.models.auth import User
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email
For Emacs users: Emacs' nxml-mode seems to work rather well with Django
templates. It underlines tags and variable references with a red line,
but otherwise it's nice to work with.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
Hi Malcolm,
{{forloop.counter|add:offset}} works fine.
Thanks,
Rob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubs
I found this discussion concerning HTML Tidy and ASP.NET tags:
http://blogs.borland.com/stevet/archive/2004/10/11/1568.aspx
Another idea: Write a wrapper for HTML Tidy to convert Django tags/vars
to HTML comments and back. It would be a serious hack, but could work:
{% tagname parameters %} =>
Thank you, I'll have a look.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EM
I want to create a form for entering data and all of its related data,
on one form. Here's a simplified model to illustrate:
class Author(meta.Model):
name = meta.CharField(maxlength=40)
class Book(meta.Model):
title = meta.CharField(maxlength=40)
authors = meta.ManyToManyField(Auth
Hi all,
After tearing my hair out with an "OperationalError: Unable to close
due to unfinalised statements" exception this afternoon under SQLite, I
switched over to Postgres. This threw more helpful exceptions, and led
me to discover that when calling save() on an AddManipulator instance,
any un
hi,
this is a general question,
I'm planning to use django for a personal-maybe_someday_big database based
project. I saw that
version 1.0 has not been released yet, but sbdy warned me that many things are
changing.
This plus the "Note that, until 1.0, there is no guarantee of
backwards-compati
I see that this is related to using Django with FastCGI and MySQL.
Is there anything that is pertinient to using Django and MySQL with
mod_python?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" gro
I have just started in with Django development and the warnings about
the upcoming 1.0 release (and 0.92, for that matter) don't scare me
at all. The current code works well and you may not ever have to
upgrade if you don't feel the need to. A lot of the coming changes
are for cleaning up
MarC wrote:
>hi,
>this is a general question,
>I'm planning to use django for a personal-maybe_someday_big database based
>project. I saw that
>version 1.0 has not been released yet, but sbdy warned me that many things are
>changing.
>This plus the "Note that, until 1.0, there is no guarantee o
On 3/12/06, MarC <[EMAIL PROTECTED]> wrote:
> Is "svn co http://code.djangoproject.com/svn/django/trunk/"; close enough to
> the final 1.0 version
> and safe/stable enough?
It's safe enough for use, but the next version, 0.92, is going to make
a huge number of backwards-incompatible changes. My
I found that a subclass' _pre_save method superceeds it's parent's
and I have a situation where I need it to do something in addition
to what it's parent does.
e.g.
class One(model):
def _pre_save: ...something...
class Two(One):
def _pre_save:
?
Based on Python
On Sun, 2006-03-12 at 14:45 +, tonemcd wrote:
> Hi all,
> I have this model
>
> class Photo(models.Model):
> name = models.CharField(maxlength=20)
> image = models.ImageField(upload_to="cetl/")
>
> def save(self):
> import commands
> self.image = 'cetl/%s' % comma
On Sun, 2006-03-12 at 17:14 +, Zanchey wrote:
> Hi all,
>
> After tearing my hair out with an "OperationalError: Unable to close
> due to unfinalised statements" exception this afternoon under SQLite, I
> switched over to Postgres. This threw more helpful exceptions, and led
> me to discover
On Sun, 2006-03-12 at 14:46 -0800, Glenn Tenney wrote:
> I found that a subclass' _pre_save method superceeds it's parent's
> and I have a situation where I need it to do something in addition
> to what it's parent does.
>
> e.g.
>
> class One(model):
> def _pre_save: ...something...
>
I had wanted to make up a unique field combining some other field and,
ideally, an autoincrementing number unique to this class... I'd love
to make this the primarykey, but I can't make up a SlugField as the
primary key and another field to be the autoincrementing number
because AutoField is only
Ahhh...
Should have said I was using magic-removal, and that this is within the
admin interface.
The reason for the uuid filename is because I'm thinking of having a
lot of files uploaded and I could end up with dozens of files called
'TEST.DOC' and this is one way of guaranteeing that the filen
[EMAIL PROTECTED] wrote:
> I see that this is related to using Django with FastCGI and MySQL.
>
> Is there anything that is pertinient to using Django and MySQL with
> mod_python?
More precisely the problem makes FastCGI with MySQL almost unusable. The
patch itself is generic enough. Give it a
I'm having trouble using the python calendar module in Django. If I
type:
>>> import calendar
>>> print calendar.monthcalendar(2006, 3)
at the python shell (not the shell in Django) it works as advertised,
but if I type the same code through python manage.py shell, I get:
Traceback (most recent
On 3/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I'm having trouble using the python calendar module in Django. If I
> type:
>
> >>> import calendar
> >>> print calendar.monthcalendar(2006, 3)
>
> at the python shell (not the shell in Django) it works as advertised,
> but if I type the
I guess there maybe a same named file calendar.py or calendar packagein your directory, which is duplicated with python
calendar.py modulefile.Ahh... that would be the app I created in my project called calendar :) You can tell I'm new to Python (and Django)Thanks for the quick reply.
--~--~
On 3/13/06, Brendon Kelly <[EMAIL PROTECTED]> wrote:
>
> >
> > I guess there maybe a same named file calendar.py or calendar package
> > in your directory, which is duplicated with python calendar.py module
> > file.
> >
> >
>
> Ahh... that would be the app I created in my project called calendar
hum to reformulate simpler,
how can i tell in url.py to use generic.simple, and a extra_context
which will replace
context_instance=DjangoContext(request) i was using in my view method.
def faq(request):
return render_to_response('faq', {'section':'faq'},
context_instance=DjangoContext(r
On 3/8/06, Andu <[EMAIL PROTECTED]> wrote:
> One of the problems I faced when using Django's admin was the filter
> part overlapped the table with data, when I showed lots of fields in
> the admin listing.
>
> I did a quick hack today and made it toggable. If you want to aply a
> filter, show it.
On 3/12/06, Brendon Kelly <[EMAIL PROTECTED]> wrote:
> > I guess there maybe a same named file calendar.py or calendar package
> > in your directory, which is duplicated with python calendar.py module
> > file.
>
> Ahh... that would be the app I created in my project called calendar :) You
> can
On 3/11/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> i want to pass different widths depending on what the user wants. I
> tried this:
>
> width="{{size}}" />
>
> but it doesnt parse. Any clues?
Hey Kenneth,
Variables within variables aren't supported. To accomplish what you
want, you'll
On 3/12/06, Glenn Tenney <[EMAIL PROTECTED]> wrote:
> Although the docs say that _pre_save "is called just before an object
> is saved to the database", that's not quite correct. _pre_save is
> called long before the db is committed, and BEFORE the AutoField "id"
> is set meaning that when _pre_s
On 3/12/06, Mike Kent <[EMAIL PROTECTED]> wrote:
> What I want to do is create a form that lets me enter the book title,
> and a comma-separated list of author names. The list of author names
> would then be split on the commas, and if an author name was not in the
> Author table, it would be ins
On 3/13/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
On 3/12/06, Glenn Tenney <[EMAIL PROTECTED]> wrote:The auto-incrementing happens at the database level, after the INSERTstatement is done. This happens at the database level on purpose --
Django doesn't do the auto-incrementing for you, because
Here is a simplified version of what I am trying to do:
App X:
class A:
shortname = meta.CharField(maxlength=6)
App Y:
class B:
the_A = meta.ForeignKey(A)
Y.views:
blist = bs.get_list(order_by=['as.shortname'])
But Django is telling me that there is no table named 'as'.
Everything seem
36 matches
Mail list logo