Author: Dave Kelly
Posted: 2012-06-19 11:24:10 Link
I am following along with the PyCon tutorial but using my own data from a
PostgreSQL database and I have a couple of newbie questions.
First Problem:
I have a date field in the Postgres database called birth_date. As per the
tutorial, I changed it to the following code:
## Field public.employees.birth_date
label = dabo.ui.dLabel(self, NameBase="lblbirth_date",
Caption=biz.getColCaption("birth_date"))
objectRef = dabo.ui.dDateTextBox(self, NameBase="birth_date",
DataSource="public.employees", DataField="birth_date",
ToolTipText=biz.getColToolTip("birth_date"),
HelpText=biz.getColHelpText("birth_date")
)
gs.append(label, alignment=("top", "right") )
gs.append(objectRef)
gs.append( (25, 1) )
The Problem is, the date field only accepts two digit dates. When I put in
birth dates, they default to the 2000's. Therefore, my birthdate in the
database becomes 2064 rather than 1964. How do I fix this?
Second problem:
I have an address field which is a varchar(255). I exported this from a
Microsoft Access database to Postgres and it has multiple lines separated by
crlf. It displays fine in PgAdmin III on Linux Mint but in a Dabo text
field it is all on one line with an unprintable character between what
should be the lines. How can I make this display properly?
Thanks for all your help and I am sorry if these questions are hopelessly
newbie.
Dave Kelly
The Priory Inn
<http://www.theprioryinn.co.uk/> www.theprioryinn.co.uk
"Dining in a 30 Mile Food Zone"
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/006701cd4e37$f55e7af0$e01b70d0$@theprioryinn.co.uk
Author: Ed Leafe
Posted: 2012-06-19 15:47:10 Link
On Jun 19, 2012, at 11:24 AM, Dave Kelly wrote:
> The Problem is, the date field only accepts two digit dates. When I put in
> birth dates, they default to the 2000's. Therefore, my birthdate in the
> database becomes 2064 rather than 1964. How do I fix this?
I'm not sure I understand - what do you mean by "the date field only accepts two digit dates"? A dDateTextBox should default to 4-digit years.
> I have an address field which is a varchar(255). I exported this from a
> Microsoft Access database to Postgres and it has multiple lines separated by
> crlf. It displays fine in PgAdmin III on Linux Mint but in a Dabo text
> field it is all on one line with an unprintable character between what
> should be the lines. How can I make this display properly?
Hmmm... looks like something strange is going on. I just took a dEditBox, and set its Value to:
r"\n".join(['foo', 'bar', 'baz'])
I would expect this to show the three words all on separate lines, but instead it's showing "foo\nbar\nbaz". I'll have to dig into the code to see where it is escaping the newline character.
-- Ed Leafe
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/EAD78632-FA51-468B-8EC8-C9ADD96A849C@leafe.com
Author: dave@theprioryinn.co.uk
Posted: 2012-06-20 02:17:36 Link
Regarding the date field,
I have attached 4 screen shots. They show before and after an update of birth_date. The interesting thing
is that if you change a date after 1970, it defaults to the 1900s. If birth_date is changed before 1970,
it defaults to the 2000s.
As you can see from the screen shot, Dabo is only seeking a two digit date.
Thanks for all your help!
On Tue 19/06/12 9:47 PM , Ed Leafe ed@leafe.com sent:
> On Jun 19, 2012, at 11:24 AM, Dave Kelly wrote:
>
> > The Problem is, the date field only accepts two
> digit dates. When I put in> birth dates, they default to the 2000's.
> Therefore, my birthdate in the> database becomes 2064 rather than 1964. How do I
> fix this?
> I'm not sure I understand - what do you mean by "the date field only
> accepts two digit dates"? A dDateTextBox should default to 4-digit
> years.
> > I have an address field which is a varchar(255).
> I exported this from a> Microsoft Access database to Postgres and it has
> multiple lines separated by> crlf. It displays fine in PgAdmin III on Linux
> Mint but in a Dabo text> field it is all on one line with an unprintable
> character between what> should be the lines. How can I make this display
> properly?
> Hmmm... looks like something strange is going on. I just took a dEditBox,
> and set its Value to:r"\n".join(['foo', 'bar', 'baz'])
>
> I would expect this to show the three words all on separate lines, but
> instead it's showing "foo\nbar\nbaz". I'll have to dig into the code to see
> where it is escaping the newline character.
>
> -- Ed Leafe
>
>
>
> _______________________________________________
> Post Messages to: Dabo-use
> rs@leafe.comSubscription Maintenance: http://leafe.com/mailman/listinfo/dabo-usersSearchable Archives:
http://leafe.com/archives/search/dabo-usersThis message: http://leafe.com/archives/byMID/EAD78632-FA51-
468B-8EC8-C9ADD96A849C@leafe.com
>
>
>
--- StripMime Report -- processed MIME parts ---
multipart/mixed
text/plain (text body -- kept)
image/png
image/png
image/png
image/png
---
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/16346.1340176656@theprioryinn.co.uk
Author: Dave Kelly
Posted: 2012-06-20 02:53:40 Link
I just realised that you might have a text only email. You can see all the
screen shots here: http://theprioryinn.co.uk/specials/dabo.aspx.
Thanks!
Dave Kelly
The Priory Inn
01666 502 251
www.theprioryinn.co.uk
"Dining in a 30 Mile Food Zone"
-----Original Message-----
From: dabo-users-bounces@leafe.com [mailto:dabo-users-bounces@leafe.com] On
Behalf Of dave@theprioryinn.co.uk
Sent: 20 June 2012 08:18
To: Dabo Users list
Subject: Re: [dabo-users] Y2K issue with date fields and multi line text
fields
Regarding the date field,
I have attached 4 screen shots. They show before and after an update of
birth_date. The interesting thing is that if you change a date after 1970,
it defaults to the 1900s. If birth_date is changed before 1970, it defaults
to the 2000s.
As you can see from the screen shot, Dabo is only seeking a two digit date.
Thanks for all your help!
On Tue 19/06/12 9:47 PM , Ed Leafe ed@leafe.com sent:
> On Jun 19, 2012, at 11:24 AM, Dave Kelly wrote:
>
> > The Problem is, the date field only accepts two
> digit dates. When I put in> birth dates, they default to the 2000's.
> Therefore, my birthdate in the> database becomes 2064 rather than
> 1964. How do I fix this?
> I'm not sure I understand - what do you mean by "the date field only
> accepts two digit dates"? A dDateTextBox should default to 4-digit
> years.
> > I have an address field which is a varchar(255).
> I exported this from a> Microsoft Access database to Postgres and it
> has multiple lines separated by> crlf. It displays fine in PgAdmin
> III on Linux Mint but in a Dabo text> field it is all on one line with
> an unprintable character between what> should be the lines. How can I
> make this display properly?
> Hmmm... looks like something strange is going on. I just took a
> dEditBox, and set its Value to:r"\n".join(['foo', 'bar', 'baz'])
>
> I would expect this to show the three words all on separate lines, but
> instead it's showing "foo\nbar\nbaz". I'll have to dig into the code
> to see where it is escaping the newline character.
>
> -- Ed Leafe
>
>
>
> _______________________________________________
> Post Messages to: Dabo-use
> rs@leafe.comSubscription Maintenance:
http://leafe.com/mailman/listinfo/dabo-usersSearchable Archives:
http://leafe.com/archives/search/dabo-usersThis message:
http://leafe.com/archives/byMID/EAD78632-FA51-
468B-8EC8-C9ADD96A849C@leafe.com
>
>
>
--- StripMime Report -- processed MIME parts --- multipart/mixed
text/plain (text body -- kept)
image/png
image/png
image/png
image/png
---
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/16346.1340176656@theprioryinn.co.uk
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/000301cd4eb9$cec51070$6c4f3150$@theprioryinn.co.uk
Author: John Fabiani
Posted: 2012-06-20 08:15:23 Link
On 06/20/2012 12:17 AM, dave@theprioryinn.co.uk wrote:
> Regarding the date field,
>
> I have attached 4 screen shots. They show before and after an update of birth_date. The interesting thing
> is that if you change a date after 1970, it defaults to the 1900s. If birth_date is changed before 1970,
> it defaults to the 2000s.
>
> As you can see from the screen shot, Dabo is only seeking a two digit date.
>
> Thanks for all your help!
>
>
I just ran AppWizard against a Postgres database. My dates use four (4)
digits for year. Have you modified the app? Did you create a settings
file?
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4FE1CCEB.80309@jfcomputer.com
Author: John Fabiani
Posted: 2012-06-20 08:32:53 Link
On 06/20/2012 06:22 AM, Dave Kelly wrote:
> Nope, I just ran it out of the box. I have just followed the PyCon demo up
> to this point. I have neither modified the app other than what it says in
> the demo and I have not create a settings file. (I do not know how. If I
> can change this in a setting file, I would be happy to change it to a 4
> digit year.)
>
> Dave Kelly
> The Priory Inn
> 01666 502 251
> www.theprioryinn.co.uk
> "Dining in a 30 Mile Food Zone"
>
>
>
>
OK please post your code to http://dabo.codepad.org/.
I don't normally use AppWizard to create an app - I'll have to check
your code.
Please include the code to create the database table.
Also post the url of demo you are using.
Maybe Paul will jump in here.
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4FE1D105.5030907@jfcomputer.com
Author: Ed Leafe
Posted: 2012-06-20 08:46:36 Link
On Jun 20, 2012, at 2:53 AM, Dave Kelly wrote:
> I just realised that you might have a text only email. You can see all the
> screen shots here: http://theprioryinn.co.uk/specials/dabo.aspx.
Yes, attachments to the list are stripped.
What happens if you run the following in Python?
import locale
print locale.nl_langinfo(locale.D_FMT)
-- Ed Leafe
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/9F979B20-AFB8-402B-A0F5-6804BF48CA9A@leafe.com
Author: Dave Kelly
Posted: 2012-06-20 09:23:28 Link
It returns:
%m/%d/%y
Dave Kelly
The Priory Inn
01666 502 251
www.theprioryinn.co.uk
"Dining in a 30 Mile Food Zone"
-----Original Message-----
From: dabo-users-bounces@leafe.com [mailto:dabo-users-bounces@leafe.com] On
Behalf Of Ed Leafe
Sent: 20 June 2012 14:47
To: Dabo Users list
Subject: Re: [dabo-users] Y2K issue with date fields and multi line text
fields
On Jun 20, 2012, at 2:53 AM, Dave Kelly wrote:
> I just realised that you might have a text only email. You can see
> all the screen shots here: http://theprioryinn.co.uk/specials/dabo.aspx.
Yes, attachments to the list are stripped.
What happens if you run the following in Python?
import locale
print locale.nl_langinfo(locale.D_FMT)
-- Ed Leafe
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/9F979B20-AFB8-402B-A0F5-6804BF48CA9A@leafe.c
om
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/007701cd4ef0$4359d250$ca0d76f0$@theprioryinn.co.uk
Author: John Fabiani
Posted: 2012-06-20 11:12:57 Link
On 06/20/2012 08:29 AM, Dave Kelly wrote:
> I pasted the PagEditPublic_Employees.py program in its entiriety to the
> codepage.pad site. I also posted the SQL used to create the table. The
> PyCon tutorial I used is from the dabodev.com/documents website but it links
> to
> https://docs.google.com/document/pub?id=1N01Wgj3L1iec8WzjlC3MsAIf2XmOcuTRxCs
> zCYd91uQ.
>
> My location, btw, is United Kingdom.
>
> Don't get me wrong, I think Dabo is great. So far, it's exactly what I am
> looking for.
First please reply to the list and NOT directly to me. Others maybe
able to help.
I just created a App using AppWizard using your table. I added a record
since I had no data. I do NOT see the two year date???
I do not think this a locale setting (your response to Ed question
matched my locale setting). If you have a place to post a snapshot
(mine appears to be down) I can show you.
You sure you did not change something or add something from the demo?
Actually, I don't see how if you just followed the AppWizard instructions.
I've forgotten what OS are you using?
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4FE1F689.4000006@jfcomputer.com
Author: Dave Kelly
Posted: 2012-06-20 12:55:45 Link
Sorry about the over enthusiastic use of the reply button.
I too have recreated the table in another Postgresql database using the SQL
I posted. I added no data. I ran the AppWizard on that database/table and
then ran the application without making any modifications to the generated
code. When I added a new record using Dabo, I changed the birth_date field
to 01/01/65. This again showed up in the Postgres database as 01/01/2064.
I added another recorde and changed the birthdate to 12/31/80 and it stored
the correct date.
I have put a dump of this test database in my public dropbox folder at
https://dl.dropbox.com/u/34624974/dabo_test.backup
I am using Linux Mint Lisa on the client machine. I have PostgreSQL 9.1 on
an Ubuntu 12.04 server.
I am going to try to install on a Windows machine here tonight.
Regards,
Dave Kelly
The Priory Inn
01666 502 251
www.theprioryinn.co.uk
"Dining in a 30 Mile Food Zone"
-----Original Message-----
From: John Fabiani [mailto:johnf@jfcomputer.com]
Sent: 20 June 2012 17:13
To: Dave Kelly
Cc: Dabo Users list
Subject: Re: [dabo-users] Y2K issue with date fields and multi line text
fields
On 06/20/2012 08:29 AM, Dave Kelly wrote:
> I pasted the PagEditPublic_Employees.py program in its entiriety to
> the codepage.pad site. I also posted the SQL used to create the
> table. The PyCon tutorial I used is from the dabodev.com/documents
> website but it links to
> https://docs.google.com/document/pub?id=1N01Wgj3L1iec8WzjlC3MsAIf2XmOc
> uTRxCs
> zCYd91uQ.
>
> My location, btw, is United Kingdom.
>
> Don't get me wrong, I think Dabo is great. So far, it's exactly what
> I am looking for.
First please reply to the list and NOT directly to me. Others maybe able to
help.
I just created a App using AppWizard using your table. I added a record
since I had no data. I do NOT see the two year date???
I do not think this a locale setting (your response to Ed question
matched my locale setting). If you have a place to post a snapshot
(mine appears to be down) I can show you.
You sure you did not change something or add something from the demo?
Actually, I don't see how if you just followed the AppWizard instructions.
I've forgotten what OS are you using?
Johnf
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/001901cd4f0d$eb28a110$c179e330$@theprioryinn.co.uk