Oh ... by the way, we aren't using Access as a front end to Django.
There is nothing (far as I know) in Django to front-end to!

This app has been successfully making us money for more than 20
years.  The data side moved to MySQL a long time ago (can't remember
when) to enhance performance and security, but the relatively
sophisticated Access side remained in place and continued to evolve.
Still see no viable replacement on the horizon for Access for the
front end for use by people.  There are a number of tools that have
suficient capability to replace it but all would cost a fortune to
make it happen.  Instead, we're using Python/Django as a basis now for
enhanced reporting/number-crunching and future automation (which sends
us in the direction of having so many people having to use the Access
app).   Had we had Python and Django in the late 1980's we'd probably
be there now.

On Jul 14, 3:57 pm, Tom Evans <tevans...@googlemail.com> wrote:
> On Wed, Jul 14, 2010 at 1:45 PM, rmschne <rmsc...@gmail.com> wrote:
> > As I understand, in Django/Python, True is 1 and False=0.  And when
> > connected to the database, we use a TinyInt for that variable and
> > assign it to a NullBooleanField.
>
> True and False are global objects of type bool, not 1 and 0. bool
> constructor converts integers to True/False as appropriate.
>
>
>
> > Problem is that some people use their PC's with a Microsoft Access
> > based front end to the database (MySQL).  The forms use check-boxes,
> > and when checked, which is supposed be "true", Access puts -1 into the
> > data base.  Django doesn't recognize that value as True.
>
> Yes, Access is dire. I think you can probably count the number of
> people using Access as a front end to django on one hand (possibly one
> hand with four fingers cut off).
>
>
>
> > I can't change the Access forms or system and don't tell me to stop
> > using Access. We don't have unlimited resources to fix all the
> > problems in the world!
>
> > I'm wondering if there is some way to tell Django in the data model to
> > let a model variable return True when <>0 (instead of when=1) , and
> > False when 0?
>
> > This seems the cleanest easiest way; but I can't see how to make this
> > possible?  Is it?  Or is there another approach ?
>
> Define a MyBooleanField that extends models.BooleanField, override
> to_python(). Use that instead of models.BooleanField.
>
> Docs on that:http://docs.djangoproject.com/en/1.2/howto/custom-model-fields/
>
> Cheers
>
> Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to