gnue-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUe-dev] Sort-Order of Null values


From: Johannes Vetter
Subject: [GNUe-dev] Sort-Order of Null values
Date: Mon, 17 Jan 2005 21:36:46 +0100

Hi,

Since most of the database-backends can or do handle sort-order of
null-values differently, we made appserver able to be very flexible. 
There are two new configuration settings for gnue.conf now:

null_first_asc = True/False
null_first_dsc = True/False

Using these settings you can define wether null values are sorted at the
beginning or the end of a resultset. use 'null_first_asc' for ascending
sort order, and 'null_first_dsc' for descending sort order.

Additionally I did some changes to NullObjects in the language
interface. If you access a reference property of a class which is NULL,
you'll get a NullObject instance. If you access a non-reference-property
of a NullObject or another instance None will be returned. 

Example: if a person has no country assigned

address_person.address_country  --> NullObject
address_perons.address_country.address_name  --> None
x = address_person.address_country
y = x.address_name
x --> NullObject
y --> None

This means to you: you will always get None if you access a
non-reference property. you will always get a NullObject if you access a
reference property which is Null. following access to this NullObject is
possible and handled according to the classrepository.

Comparing:

x = NullObject
y = None
z = 'foo'

x == y  True
x !=    False
x < z   True

cmp (x, y)      0
cmp (x, z)      -1
cmp (x, y)      0


Thanks,
Johannes
 

-- 
BYTEWISE Software GmbH          Tel +43 (5577) 89877-0
i.A. Johannes Vetter            Fax +43 (5577) 89877-66
A-6890 Lustenau, Enga 2         http://www.bytewise.at
-------------------------------------------------------
Wir bieten die Installation von Debian GNU/Linux auf
Servern für kleinere Netzwerke zum Pauschalpreis an.
Mehr dazu unter http://www.bytewise.at/texte/pl-debian

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]