Adrian Holovaty wrote:
> You're best off searching by the exact fields rather than messing with
> derived fields.
Would you offer some insight please?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
On 5/25/06, Gary Wilson <[EMAIL PROTECTED]> wrote:
> Yes, I would like to provide my users with a single search box where
> they could enter a first name, a last name, or a first name and last
> name. So maybe...
>
> if one word entered:
> search in last name OR first name
> elif two words en
Gary Wilson wrote:
> Am I correct that it is good database-design practice to not store
> derived or calculated fields in your database (e.g. full_name when you
> have first_name and last_name)? How then do you go about querying a
> derived field?
I believe that people often use 'indexed views
Adrian Holovaty wrote:
> On 5/23/06, Gary Wilson <[EMAIL PROTECTED]> wrote:
> > Yes, I guess I could split the text entered and then do a search for
> > each word in both first_name and last_name like the admin interface
> > does... just seems like this would return many more results than wanted
>
On 5/23/06, Gary Wilson <[EMAIL PROTECTED]> wrote:
> Yes, I guess I could split the text entered and then do a search for
> each word in both first_name and last_name like the admin interface
> does... just seems like this would return many more results than wanted
> with a large user group.
It w
Waylan Limberg wrote:
> For an example of how the admin app does this see search_fields
> http://www.djangoproject.com/documentation/model_api/#search-fields
>
> --
>
> Waylan Limberg
> [EMAIL PROTECTED]
Yes, I guess I could split the text entered and then do a search for
each word in both f
For an example of how the admin app does this see search_fields
http://www.djangoproject.com/documentation/model_api/#search-fields
On 5/23/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>
> Hi Gary,
>
> On Mon, 2006-05-22 at 21:20 -0700, Gary Wilson wrote:
> > I have a model similar to:
> > =
I have a model similar to:
===
class User:
first_name = CharField()
last_name = CharField()
def get_full_name(self):
return "%s %s" % (self.first_name, self.last_name)
===
Is there a way I can search by full name (without storing the
calculated
Hi Gary,
On Mon, 2006-05-22 at 21:20 -0700, Gary Wilson wrote:
> I have a model similar to:
> ===
> class User:
> first_name = CharField()
> last_name = CharField()
>
>def get_full_name(self):
> return "%s %s" % (self.first_name, self.last_name)
> ===
9 matches
Mail list logo