Re: DB joining 3 tables in django admin, while searching on the primary table

2012-05-21 Thread Aditya Sriram M
Some one there can answer!? On Sunday, 20 May 2012 13:12:17 UTC+5:30, Aditya Sriram M wrote: > > Ooo.. Nice. > > Hmm.. I tried this but it failed? Can you pls correct me? > > def queryset(self, request): > result = super(CustomerAdmin, > self).queryset(r

Re: Nested Foreign Key relationships in Admin?

2012-05-20 Thread Aditya Sriram M
I too have a similar issue. Any workarounds to achieve this... On Saturday, 16 December 2006 09:52:39 UTC+5:30, Dan wrote: > > I'd like to represent foreign key relationships inside the Admin > interface when there are multiple nested one-to-many relationships. > Here's a simple example model to d

Re: How to popup a window from admin site from the admin table's cell html content?

2012-05-20 Thread Aditya Sriram M
Help please! :-| On Saturday, 19 May 2012 18:31:05 UTC+5:30, Aditya Sriram M wrote: > > I have a function like this.. > > list_display = (..,get_link_to_users, ..) > >def get_link_to_users(self, obj): > html_table = ' href="JavaScript:window.open

Re: DB joining 3 tables in django admin, while searching on the primary table

2012-05-20 Thread Aditya Sriram M
easier, but only > follows an fk in one direction. > > Matt. > > On Sunday, May 20, 2012 12:27:57 AM UTC+9:30, Aditya Sriram M wrote: >> >> Hi, >> >> again, my models are Customer, Users and Devices. >> >> I would like to search by Customer and

DB joining 3 tables in django admin, while searching on the primary table

2012-05-19 Thread Aditya Sriram M
Hi, again, my models are Customer, Users and Devices. I would like to search by Customer and retrieve all 'select_related' rows of all the three models. Eg. like this.. Customer1 User1 Device1 Customer1 User1 Device2 Customer1 User2 Device1 Customer1 User2 Device2 etc etc.. Is this possible in

How to display a table (with full functionalities like sorting, num rows etc) within a cell?

2012-05-19 Thread Aditya Sriram M
I have an admin site with two models, Customer and Users with one-to-many relationship. Now when I display the customer in admin site, I wanted to display it's Users in a table format. Basic HTML formatted table works fine but its too rugged and not very attractive. Note: I do this by manually

How to popup a window from admin site from the admin table's cell html content?

2012-05-19 Thread Aditya Sriram M
I have a function like this.. list_display = (..,get_link_to_users, ..) def get_link_to_users(self, obj): html_table = ' My Users ' % (obj.customer_id) print html_table return html_table get_link_to_fortress_users.short_description = 'Fortress Users' get_link_t

Re: Customizing Django Admin Site

2012-05-19 Thread Aditya Sriram M
t sure if this is what you look for, and I am not sure if > allow_tags is needed > > > > > On Monday, May 7, 2012 12:41:59 PM UTC+2, Aditya Sriram M wrote: >> >> Hi All, >> >> I could successfully try the Django framework on my Oracle DB. I never >&

Customizing Django Admin Site

2012-05-07 Thread Aditya Sriram M
Hi All, I could successfully try the Django framework on my Oracle DB. I never thought programming would be this easy!!! Thanks for the wonderful framework. Now, I want to have an Admin Site with 'another such admin site in its row'. Is it possible? Example: Take the models Customers, Users an

[VVIP] Displaying Tables in Admin Interface using non-foreign key

2012-05-01 Thread Aditya Sriram M
My models: * * > > *# models.py > class Model1(models.Model): > pk = models.BigIntegerField(primary_key=True) > col1 = models.IntegerField() > class Model2(models.Model): > fk = models.ForeignKey(Model1) > col1 = models.CharField(max_length=255) > # admin.py > class Model1Admin(adm

Re: Django admin site display (None) even when values are non-null/empty

2012-05-01 Thread Aditya Sriram M
Okay!! My bad.. was using the wrong function to fetch. Use fetchone() instead. On Tuesday, 1 May 2012 07:22:11 UTC+5:30, Aditya Sriram M wrote: > > > I have been trying a lot but could not make out why it happens, > > class FortressUserAdmin(admin.ModelAdmin):

Django admin site display (None) even when values are non-null/empty

2012-04-30 Thread Aditya Sriram M
I have been trying a lot but could not make out why it happens, class FortressUserAdmin(admin.ModelAdmin): list_display(. . . , get_my_schema) def get_my_schema(self, obj): sql_query = "select prop_val from customer_property where customer_id = %d and property_value like 'SCHEM

Re: Django help required with non foreign key relations

2012-04-22 Thread Aditya Sriram M
2012 21:30:41 UTC+5:30, akaariai wrote: > > On Apr 22, 1:31 pm, Aditya Sriram M wrote: > > File myapp/models.py has this sample code.. > > > > from django.db import models > > > > # model for 'user' table in database or

Django help required with non foreign key relations

2012-04-22 Thread Aditya Sriram M
File myapp/models.py has this sample code.. from django.db import models # model for 'user' table in database oracle_dbuser1:user class User(models.Model): . . . customerid = models.BigIntegerField() # model for 'customer' table in database oracle_dbuser2:customer # Note that there is