Re: [WebDNA] feature request - .hdr files
This WebDNA talk-list message is from 2011
It keeps the original formatting.
numero = 106563
interpreted = N
texte = OMG, a 5 year old post of mine, and it's still relevant :)I've been extensively redoing 2 websites in WebDNA over the last few =months, and... Wow, did I write bad code in the old days, lol. I've come =to realize that the [function] tag is one of the most underutilized tag =that makes WebDNA closer to other programming languages.=20Additionally, after playing with Django (Python) and Rails (Ruby) one of =the things that still irritates me the most about WebDNA is the =primitive handling of the databases. Specifically the header file.example:inventory.hdr (webdna)RID
SKU AddDate ModDate ModTime OnWeb = status mfg model descriptionprices.hdrPID SKU QTY PRICE updated_onthe current header file is just the first title line from a tab =delimited file, stripped out and made into its own file.What if instead it was totally different, it more like a Django model:Inventory.hdr=20 (id field is implied, you dont need to define it, it's always the =first field of every (database/table) and always auto incremented for a =new record) sku =3D CharField(max_length=3D20, db_index=3DTrue, unique=3DTrue) created_at =3D DateTimeField(auto_now_add=3DTrue, ) updated_at =3D DateTimeField(auto_now=3DTrue, ) is_public =3D BooleanField(default=3DTrue) #onweb. note that the =pound sign lets you comment a field status =3D CharField(max_length=3D8, choices=3DSTATUS_CHOICES, =default=3D"X") mfg =3D CharField(max_length=3D100, ) model =3D CharField(max_length=3D150) description =3D TextField(, blank=3DTrue) STATUS_CHOICES =3D ('X', 'Normal'), ('N', 'New'), ('C', 'Clearance'), ('H', 'Showcase'), ('S', 'Special Order'), ('R', 'Rebuild'), ('O', 'Obsolete'), ('D', 'Discontinued'),Price.hdr (id field is implied, you dont need to define it, it's always the =first field of every (database/table) and always auto incremented for a =new record) product =3D ForeignKey('Inventory.db') qty =3D IntegerField(max_length=3D11) price =3D DecimalField(max_digits=3D11, decimal_places=3D2, =blank=3DTrue) updated_at =3D DateTimeField(auto_now_add=3DTrue, auto_now=3DTrue, )This would put us a little closer to using "models" around our data, and =help cut down on "webdna isn't a modern language" arguments, while also =cleaning up significantly our search and append code. It also allows up =to better document (thru comments) reasons why a field exists or what it =is used for, etc. Very handy for multiple developer projects or projects =that run for years unattended, then need maintenance years later...Brian B. Burtonbrian@burtons.com"Remember though, it is not the jar that is important but the empty =space inside that is of value."On Apr 17, 2011, at 2:55 PM, Govinda wrote:> Hi Chris>=20> I do respect and really enjoy the rich feature set that is webdna.. =but we do still need development. I try to keep my requests to a =practical minimum.. and not just complain.>=20> Here is a real need I have had many times in the last year:> We need a quick way to debug RAM tables. It is a slow pain to find an =issue when tables are involved. Brian described it well here:>=20> =http://dev.webdna.us/TalkListArchive/DetailResults.tpl?command=3Dsearch&db==3Dwebdna-talk.db&eqIDdata=3D57773&max=3D1&words=3DListFields%20table%20bu=g>=20> Once small quick fix might be to add [Table]s to [ListFields]'s =capabilities.>=20> - Govinda
Associated Messages, from the most recent to the oldest:
OMG, a 5 year old post of mine, and it's still relevant :)I've been extensively redoing 2 websites in WebDNA over the last few =months, and... Wow, did I write bad code in the old days, lol. I've come =to realize that the [function] tag is one of the most underutilized tag =that makes WebDNA closer to other programming languages.=20Additionally, after playing with Django (Python) and Rails (Ruby) one of =the things that still irritates me the most about WebDNA is the =primitive handling of the databases. Specifically the header file.example:inventory.hdr (webdna)RID SKU AddDate ModDate ModTime OnWeb = status mfg model descriptionprices.hdrPID SKU QTY PRICE updated_onthe current header file is just the first title line from a tab =delimited file, stripped out and made into its own file.What if instead it was totally different, it more like a Django model:Inventory.hdr=20 (id field is implied, you dont need to define it, it's always the =first field of every (database/table) and always auto incremented for a =new record) sku =3D CharField(max_length=3D20, db_index=3DTrue, unique=3DTrue) created_at =3D DateTimeField(auto_now_add=3DTrue, ) updated_at =3D DateTimeField(auto_now=3DTrue, ) is_public =3D BooleanField(default=3DTrue) #onweb. note that the =pound sign lets you comment a field status =3D CharField(max_length=3D8, choices=3DSTATUS_CHOICES, =default=3D"X") mfg =3D CharField(max_length=3D100, ) model =3D CharField(max_length=3D150) description =3D TextField(, blank=3DTrue) STATUS_CHOICES =3D ('X', 'Normal'), ('N', 'New'), ('C', 'Clearance'), ('H', 'Showcase'), ('S', 'Special Order'), ('R', 'Rebuild'), ('O', 'Obsolete'), ('D', 'Discontinued'),Price.hdr (id field is implied, you dont need to define it, it's always the =first field of every (database/table) and always auto incremented for a =new record) product =3D ForeignKey('Inventory.db') qty =3D IntegerField(max_length=3D11) price =3D DecimalField(max_digits=3D11, decimal_places=3D2, =blank=3DTrue) updated_at =3D DateTimeField(auto_now_add=3DTrue, auto_now=3DTrue, )This would put us a little closer to using "models" around our data, and =help cut down on "webdna isn't a modern language" arguments, while also =cleaning up significantly our search and append code. It also allows up =to better document (thru comments) reasons why a field exists or what it =is used for, etc. Very handy for multiple developer projects or projects =that run for years unattended, then need maintenance years later...Brian B. Burtonbrian@burtons.com"Remember though, it is not the jar that is important but the empty =space inside that is of value."On Apr 17, 2011, at 2:55 PM, Govinda wrote:> Hi Chris>=20> I do respect and really enjoy the rich feature set that is webdna.. =but we do still need development. I try to keep my requests to a =practical minimum.. and not just complain.>=20> Here is a real need I have had many times in the last year:> We need a quick way to debug RAM tables. It is a slow pain to find an =issue when tables are involved. Brian described it well here:>=20> =http://dev.webdna.us/TalkListArchive/DetailResults.tpl?command=3Dsearch&db==3Dwebdna-talk.db&eqIDdata=3D57773&max=3D1&words=3DListFields%20table%20bu=g>=20> Once small quick fix might be to add [table]s to [listfields]'s =capabilities.>=20> - Govinda
"Brian B. Burton"
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Search in 2 or more catalogs (1997)
Security Tip (1996)
RE: Automatic thumbnail images (1998)
Emailer (1997)
RE: Include (1998)
My web page only... (2003)
Help name our technology! I found it (1997)
Extended [ConvertChars] (1997)
WCS Newbie question (1997)
Accepting credit cards (1997)
[showif] / [hideif] (1997)
Protect (1997)
[WebDNA] Hard-coded db write delay when running certain code? (2011)
categories and subcategories (2004)
Updating checkboxes made easy !!! (1998)
[input] [/input] (1997)
Spaces inside [AppendFile] (1998)
WebCat editing, SiteGuard & SiteEdit (1997)
RE: 2nd WebCatalog2 Feature Request (1996)
RE: [WebDNA] Upload file to mysql (2017)