Re: A simple database project

2009-11-11 Thread Zeynel
Ok, I tried search_fields = ['school__lawyer_first'] and I get this error Cannot resolve keyword 'lawyer_first' into field. Choices are: id, lawyer, school In the variations that I tried only search_fields = ['school__school'] worked. I followed the tutorial and arranged lawyer names as a

Re: A simple database project

2009-11-11 Thread pjrhar...@gmail.com
> I tried > > search_fields = ['school__lawyer'] > > but I get an error message when I did a search for last name of > lawyer: > > Related Field has invalid lookup: icontains You need something like: search_fields = ['school__lawyer_last'] to specify which field on the related 'lawyer'

Re: A simple database project

2009-11-11 Thread Zeynel
In this document http://docs.djangoproject.com/en/dev/ref/contrib/admin/ ModelAdmin.search_fields is explained: "You can also perform a related lookup on a ForeignKey with the lookup API "follow" notation. search_fields = ['foreign_key__related_fieldname']" I tried search_fields =

Re: A simple database project

2009-11-10 Thread Kenneth Gonsalves
On Wednesday 11 Nov 2009 5:51:00 am Zeynel wrote: > So I want to enter in the search box "Lawyer1" and in the result page > I want to see "Lawyer1 knows Lawyer2" > if your school is a foreign key (I think it is) you need a related name to search for that. Check out ModelAdmin.search_fields in

Re: A simple database project

2009-11-10 Thread Zeynel
Hi Tomasz, I was able to build the admin page and put a search box there: class LawyerAdmin(admin.ModelAdmin): fieldsets = [ ('Name', {'fields': ['last', 'first', 'initial']}), ('School', {'fields': ['school', 'year_graduated']}), ] list_display = ('first',

Re: A simple database project

2009-11-07 Thread Zeynel
Thanks. I started to study. On Nov 7, 12:23 pm, Tomasz Zieliński wrote: > On 7 Lis, 15:58, Zeynel wrote: > > > Hello, > > > I am planning to build a demo prototype for a who-knows-who database > > for the legal profession. Database will

Re: A simple database project

2009-11-07 Thread Tomasz Zieliński
On 7 Lis, 15:58, Zeynel wrote: > Hello, > > I am planning to build a demo prototype for a who-knows-who database > for the legal profession. Database will consist of lawyer name, school > and year graduated. Searching by lawyer name will return other lawyers > graduated

A simple database project

2009-11-07 Thread Zeynel
Hello, I am planning to build a demo prototype for a who-knows-who database for the legal profession. Database will consist of lawyer name, school and year graduated. Searching by lawyer name will return other lawyers graduated from same law school the same year. Can I build this in Django? How