• Что нового в моем гео-сервисе

    Март 23, 2010

    Недавно в моем маленьком и уютном гео-сервисе произошли некоторые изменения: 1. Он переехал с http://1adg.ru на http://location.dmitko.ru/ — проверьте, должно работать! 2. Регистрация открыта для всех! 3. Появился новый Windows mobile клиент любезно разработанный http://www.softexpanse.com — посетите страничку Программное обеспечение для получения дополнительной информации.

  • Enable IE8 to pass username and password in url

    Март 23, 2010

    To disable the new default behavior in Windows Explorer and Internet Explorer which does not allow to pass username and password in urls, create iexplore.exe and explorer.exe DWORD values in the following registry keys and set their value data to 0. HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE P.S. Works in Windows Server 2008

  • check login decorator for json responses

    Март 21, 2010

    Django has a login_required decorator that redirects to the login page if user is not authenticated, here I’ll show how to write a custom decorator for json responses. If the uses is authenticated then decorated function returns the desired data otherwise some error in json format. NB — this decorator is for view functions with […]

  • dynamic forms in dajngo

    Март 18, 2010

    Django has a very convenient forms framework and I want to show how to implement a form with dynamic set of fields. First — declare a form class: from django import forms class SomeAddressForm(forms.Form): pass Then the tricky part — declare a function that returns type of dynamic form: def getAddressForm(addMoreField): fields = {«city» : […]

  • add custom styles to yui datatable

    Март 16, 2010

    If you want to change styles of yui components — it’s easy. All you need is to make some overriding in your css files. My example looks like this: As you can see, I don’t want most borders and gradient backgrounds. This is done via the following style overriding: .yui-skin-sam .yui-dt th { border-right: 0px […]

  • Have ascii coding error in django admin?

    Март 10, 2010

    If you have some unicode data in tables e.g. some Russian names and want them to be displayed  by default you need to do some trick: class SomeTable(models.Model): name = models.CharField(max_length=def_max_length) def __unicode__(self): return «%s» % self.name See that — instead of returning self.name directly I returned «%s» % self.name and admin panel is shining!

  • .ready() experience

    Март 5, 2010

    jQuery has a rich set of functions including .ready() http://api.jquery.com/ready/ which is very helpful if you want to perform some operations on page ready. Initially I thought — wow! I can make whole body invisible until it’s ready (no working garbage apper). After done that I noticed that pages became very slow. After some investigation I realized that while […]

  • Django is slow?

    Март 2, 2010

    Check that Debug=False and that Google Analytics is off! In my case analytics slows speed dramatically.

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org