Hey Victor,
-
I changed my subscription to my gmail-account because I'm not sure if my
email went trough. Here is it again.
-
I do the following to get data out of a related table/model:
Of course you could access your other model via __unicode__...
Or,
Hey Victor,
I do the following to get data out of a related table/model:
Of course you could access your other model via __unicode__...
Or, simply write a function for your model and use a callback in your
list_display:
Here an easy "quick and dirty" example:
class othermodel(models.Model)
impo
On Saturday, January 29, 2011 12:28:49 PM UTC, Victor Hooi wrote:
>
> Hi,
>
> I'm trying to use list_display in the django-admin, and I can't seem to
> find a way to get list_display to follow FK links.
>
> My models.py:
>
> class Site(models.Model):
> name = models.CharField(max_length=50, un
Hi,
I'm trying to use list_display in the django-admin, and I can't seem to find
a way to get list_display to follow FK links.
My models.py:
class Site(models.Model):
name = models.CharField(max_length=50, unique=True)
description = models.TextField()
def __unicode__(self):
On Mon, Aug 30, 2010 at 4:13 PM, christian.oudard <
christian.oud...@gmail.com> wrote:
> On Django 1.2, I'm getting a missing template variable when using a
> custom formatter in the django admin.
>
> Here is my admin class:
>
> class CustomerAdmin(admin.ModelAdmin):
>fields = [
>'name
On Django 1.2, I'm getting a missing template variable when using a
custom formatter in the django admin.
Here is my admin class:
class CustomerAdmin(admin.ModelAdmin):
fields = [
'name',
]
list_display = [
'name',
'customer_tenants',
]
def customer_ten
There is also an online version of one of the django books here:
http://djangobook.com/
On Jan 17, 5:08 pm, pfwd wrote:
> Thanks fantastic thank you
> I was also able to do:
> result = obj.task_set.aggregate(Count('id'))['id__count']
> to get the a count of the tasks for quote
>
> I don't suppose
I recommend this book - and the answer to your question is in chapter
8.
http://www.amazon.com/Practical-Django-Projects-Pratical/dp/1590599969
go ahead and get this one too
http://www.amazon.com/Python-Essential-Reference-David-Beazley/dp/0672329786/ref=pd_sim_b_4
and read http://diveintopython.
Thanks fantastic thank you
I was also able to do:
result = obj.task_set.aggregate(Count('id'))['id__count']
to get the a count of the tasks for quote
I don't suppose you know any good books regarding Python/Django that I
could buy to help me learn the syntax better?
Many thanks
On Jan 17, 10:15
On Jan 17, 8:28 pm, pfwd wrote:
> Hi am very new to Django/Python and I need some help with a model
> method
>
> I have two tables Linked by a foreign key and their forms are embedded
> in the admin interface.
> One table is called Quote and one table is called Task. The task table
> has a field c
Hi am very new to Django/Python and I need some help with a model
method
I have two tables Linked by a foreign key and their forms are embedded
in the admin interface.
One table is called Quote and one table is called Task. The task table
has a field called time_taken
In the Quote list I want to d
12:53 pm, paulh wrote:
>
>
>
> > Using the admin list_display and a callable with its allow_tags
> > property set to True you can plant a link for each object on the
> > changle_list display page of the admin. Is there some way of making
> > this
On Sep 26, 12:53 pm, paulh wrote:
> Using the admin list_display and a callable with its allow_tags
> property set to True you can plant a link for each object on the
> changle_list display page of the admin. Is there some way of making
> this link dynamic without having t
callables, or maybe I am looking in the
wrong place.
Paul Hide
On Sep 26, 12:53 pm, paulh wrote:
> Using the admin list_display and a callable with its allow_tags
> property set to True you can plant a link for each object on the
> changle_list display page of the admin. Is there so
Using the admin list_display and a callable with its allow_tags
property set to True you can plant a link for each object on the
changle_list display page of the admin. Is there some way of making
this link dynamic without having to extend the
ModelAdmin.changelist_view and its associated
rue, blank = True,
> null = True)
> city = models.CharField(max_length = 4, choices =
> SLOVAK_DISTRICT_CHOICES, db_index = True)
>
> def __str__(self):
> return '%s:' '%s' %(self.region, self.city)
>
h = 4, choices =
SLOVAK_DISTRICT_CHOICES, db_index = True)
def __str__(self):
return '%s:' '%s' %(self.region, self.city)
class Admin:
list_display = ('region', 'city')
class JobOffer(ATag):
17 matches
Mail list logo