Read some Django documentation about querysets, filters etc. There are
answers there ;)
Try this:
result = Person.objects.filter(nationality="American", age=17)
On 14 Mar, 04:20, django beginner wrote:
> Hi all,
>
> I would like to know is there any way I can search any data from
> tables given s
On Mon, 2011-03-14 at 15:47 +0600, Gennadiy Zlobin wrote:
> Yes, because you will have to update age every time on person's
> birthday and
> if you forget to do it, you get the invalid data.
>
> age = models.DateField()
date_of_birth = models.DateField()
def age(self):
return (datetime.datet
Yes, because you will have to update age every time on person's birthday and
if you forget to do it, you get the invalid data.
age = models.DateField()
- Gennadiy
On Mon, Mar 14, 2011 at 3:19 PM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:
> On 14 mar, 04:20, django beginner
On 14 mar, 04:20, django beginner wrote:
Main question already answered. As a side note:
> Suppose I have this person model:
>
> class Person(models.Model):
> userid = models.AutoField(primary_key=True)
> fname = models.CharField(max_length=30)
> lname = models.CharField(max_length=3
have you read the documentation already? i think this might help you
http://docs.djangoproject.com/en/1.2/topics/db/queries/
On Mon, Mar 14, 2011 at 11:20 AM, django beginner wrote:
> Hi all,
>
> I would like to know is there any way I can search any data from
> tables given some parameters:
> S
Hi all,
I would like to know is there any way I can search any data from
tables given some parameters:
Suppose I have this person model:
class Person(models.Model):
userid = models.AutoField(primary_key=True)
fname = models.CharField(max_length=30)
lname = models.CharField(max_length=
6 matches
Mail list logo