Python ORM (ActiveRecord) and Disabling / Hiding contents in Joomla

Categories: Development



no_entry.jpg

Woh.. I thought this day would pass away like the day before. But.. work really caught up to me and beat me down to it.

The migration of student data for UTM. I stalled it for quite some time. It lack interesting stuff for my attention but I wouldn’t want Dla to be mad at me again. So I did it.

Originally I used mysql using select queries.. the usual stuffs. But then, the errors are hard to keep track if I use record[0].. record[1] untul record[18]. I’ve been spoiled by activeRecords / active record pattern in codeigniter. So I went on searching on google and found something quite similar. "An ActiveRecord like ORM (object relation mapper) under 200 lines" on activestate’s recipes. It fits my needs. Done and done.

cipher-2-900px_400.jpg

To use it without any relation to other tables. Use it like this

class Tablename(Storm):
   pass

    

More info.. read the recipe and this blog (More on Python Metaprogramming).

Other than that..someone asked for to do this, encrypt and disable content from users ( I try not to reinvent the wheel, I’ve learned it the hard way). Basically it just makes it hard for most users to copy and paste it. Still it can be reversed if you know how. :D The source code is encoded with unicode decimal values. I cant paste it here. :D

<script language="JavaScript1.2">

function disabletext(e){return false}

function reEnable(){return true}

//if the browser is IE4+document.onselectstart=new Function ("return false")

//if the browser is NS6if (window.sidebar){document.onmousedown=disabletextdocument.onclick=reEnable}</script>

Just delay the inevitable and make it hard enough to shoo away normal users. Still using it like this take considerable amount of power from the server (encoding) and from the user, decoding. It’ll limit the amount of users but hey.. I’m just doing what people ask me to do as long it doesnt involve kicking babies and hunting dragons (with the right equipment and after training I’ll go).

There’s also quite some service that I discovered.

No Comments yet »

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds. Valid XHTML and CSS.