> @G
>
> thanks for that. the code im writing will wait til dev version becomes
> 1.2 so at least i know there is a way to do it in the next version.
> must check when 1.2 is gonna land.
You probably noticed anyway but ifchanged is actually in the current
version (and has been since at least 1.0)
> finally when i write out the vehicles, i'd like to write a different
> line for the first of each type of vehicle. to explain that, the
> output should be an image linked to a fancybox gallery. because of the
> amount of different vehicles, i'd like to only show one image of each
> vehicle, but
On Apr 20, 11:35 am, Allen Machary wrote:
> Hellow..
> I have a problem on django signal and instances.
> i have a right some code that runs a function after a certain model is
> created but could not use the instace filter
>
> Help
>
> def send_sms_notifications(sender,
This can work when you know you want to use the object once it's been
retrieved. If all you want to do is check for existence then it's
better to do the check with a:
if Class.objects.filter(pk=pk).count() == 0:
# Do object doesn't exist stuff
else:
# Do object does exist stuff
--
G
On
On Apr 7, 6:26 pm, Vinicius Mendes wrote:
> On Wed, Apr 7, 2010 at 2:00 PM, Tom Evans wrote:
> > On Wed, Apr 7, 2010 at 5:39 PM, Daniel wrote:
> > > Hi,
>
> > > Thank you for your help everyone. I know that I need to learn
Hi,
I'm running the django 1.2 beta and am testing out the multi-db
system. Unfortunately I have run into an issue where I have:
class A(models.Model):
name = models.CharField()
class B(models.Model):
a = models.ForeignKey(A)
I also have database routers set up so that A
if bids is ordered by index then you could just return
BID.objects.filter(...).filter(pk__lte=id).count() and that should be
what your after in one step (if I've understood the question
correctly).
--
G
On Mar 7, 7:10 am, Hasan Karahan wrote:
> Hi,
>
> I'm wondering
On Feb 16, 1:20 pm, Derek wrote:
> Is there a secure method to override the facility for "and it's related
> items will be deleted" for a specific model in the Django Admin?
>
> In some cases it is not appropriate that the "parent" model is deleted until
> all the "child"
On Jan 19, 5:25 am, Victor Hooi wrote:
> heya,
>
> I'm trying to use an "Address" model as a generic relation against
> multiple other models (e.g. in a "User Profile", for each User, as
> well as for "Building", "Institution", and various other ones).
>
> So I've added the
On Jan 5, 2:24 pm, Bill Freeman wrote:
> On Mon, Jan 4, 2010 at 11:00 PM, Marc Aymerich wrote:
> > class user(models.model):
> > person = models.OneToOneField(person)
>
> I presume that you meant:
>
> person = models.OneToOneField(employee)
>
>
On Jan 5, 4:00 am, Marc Aymerich wrote:
> Hi!
> I have a model like this:
>
> class company(models.model):
> name = models.CharField(mx_length=20)
> class employee(models.model):
> comany = models.ForeignKey(company)
> class user(models.model):
> person =
On Jan 3, 2:36 pm, Tijmen wrote:
> Hi there,
>
> First of all let me say I'm just starting here but need some help with
> a rather basic question.
>
> I want to make an app that holds baseball statistics for players of
> each game and over several seasons. Now I'm
> > No, I don't.
>
> > I want to know the name of the url for a given url pattern. So, when I
> > get in my method the url someone is asking for (next='/people/'), I
> > want to know the name of the url that identifies this pattern
> > (people_name). It's not for a HttpRedirect, it's for
What sort of errors are you getting when you try this with the django
model?
Have you tried just assigning the function over the top of the
__unicode__ function already on Company?
i.e.
import Company
def CompanyUnicode(self):
return '%s [%s]' % (self.nick, self.legal_name)
On Jul 17, 3:06 pm, cornjuliox wrote:
> Hi everyone. I'm new to Django, learning things mostly through trial
> and error, but this time I can't seem to figure out what went wrong. I
> overrode the admin change_form.html for my model so that I could add a
> Javascript RTE
On Jul 1, 9:56 pm, Nick Fishman wrote:
> Hey everyone,
>
> I'm working with Django's named URL patterns, and was wondering how to
> fetch the name of the URL pattern that triggered the view. For
> example, with the following urlpatterns
>
> urlpatterns = patterns('',
>
On Jun 18, 5:56 pm, Lars Stavholm wrote:
> Has anyone been able to use django-navbar successfully
> in latest Django 1.1 (from trunk)?
>
> Any ideas on how to use it appreciated.
>
> Or maybe there's a better navigation bar plugin?
>
> /Lars Stavholm
I would say the
On Jun 15, 10:47 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Mon, Jun 15, 2009 at 4:39 PM, greatlemer <greatle...@googlemail.com>wrote:
>
>
>
>
>
> > Hi everyone,
>
> > I was creating some custom template tags and attempted to import my
>
Hi everyone,
I was creating some custom template tags and attempted to import my
models through the following import at the top of the file:
from ..models import *
Unfortunately this seems to be attempting to import from django.models
(which doesn't exist) rather than myapp.models and
Whoops, I think I hit the wrong reply option when I tried to post to
this just now as it doesn't seem to have gone to the group.
If what you're looking to do is to combine the results of both queries
into one then what you probably want to use are the django Q objects
to give something like
20 matches
Mail list logo