Re: how to list all model classes within admin that extends another model?

2011-05-15 Thread garagefan
basically speaking, i want a class' admin page w/ it's list of entries
listed on the client page.

so, every class object that has a Client pk foreign field relationship
is listed on that Client's admin page whether it is a portfolio
object, an invoice object, or any future class i create that gets a
foreign field relationship to Client

On May 15, 8:29 pm, garagefan  wrote:
> yeah, i've changed things around just slightly and included a
> tabularinline
>
> however, now i need to modify the template to display a link to each
> of the items pages, b/c as is it only allows one to update the name of
> the clientobject, which is now:
>
> class ClientObject(models.Model):
>   client = models.ForeignKey(Client)
>   name = models.CharField(max_length=250)
>   def __unicode__(self):
>     return self.name
>
> i would like each ClientObject listed to link to it's admin page.
> Right now i just have the portfolio application w/ the Portfolio class
> extending the ClientObjects class. Ultimately, i also wouldnt mind a
> list of classes that extend the ClietObjects class to be listed w/ an
> "add blahblahblah" to client link that pops open an admin popup
>
> On May 15, 7:42 pm, Shawn Milochik  wrote:
>
>
>
>
>
>
>
> > Try this:
>
> >http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contri...

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to list all model classes within admin that extends another model?

2011-05-15 Thread garagefan
yeah, i've changed things around just slightly and included a
tabularinline

however, now i need to modify the template to display a link to each
of the items pages, b/c as is it only allows one to update the name of
the clientobject, which is now:

class ClientObject(models.Model):
  client = models.ForeignKey(Client)
  name = models.CharField(max_length=250)
  def __unicode__(self):
return self.name

i would like each ClientObject listed to link to it's admin page.
Right now i just have the portfolio application w/ the Portfolio class
extending the ClientObjects class. Ultimately, i also wouldnt mind a
list of classes that extend the ClietObjects class to be listed w/ an
"add blahblahblah" to client link that pops open an admin popup

On May 15, 7:42 pm, Shawn Milochik  wrote:
> Try this:
>
> http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contri...

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to list all model classes within admin that extends another model?

2011-05-15 Thread Shawn Milochik

Try this:

http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin

--
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



how to list all model classes within admin that extends another model?

2011-05-15 Thread garagefan
building a client management application for myself

in one application model, called client_management, i have
class Client(models.Model):
  active = models.BooleanField(_('active client'), default=False)
  name = models.CharField(max_length=250)
  logo = models.ImageField(upload_to="logos")
  def __unicode__(self):
return self.name

class ClientObject(models.Model):
  class Meta:
abstract = True

in my portfolio app i have:

class Portfolio(ClientObject):
  client = models.ForeignKey(Client)
  active = models.BooleanField(_('active portfolio'), default=False)
  category = models.ForeignKey(PortfolioCategory)
  name = models.CharField(max_length=250)

within the main client_management application's Client within the
admin i want to list all apps, like Portfolio, that extend
ClientObject whose client foreign key is the current Client.

IE:

within a Client within the Client_Management in the admin i'd get a
link that says "add portfolio" perhaps with a list of portfolios
already added.

eventually i'd like to extend this with more client applications, like
invoices and notes, etc... plus unknown future applications, so i'd
like it to work without anything more than creating a class that
extends ClientObject

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.