This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""admin.py""" | |
from django.contrib import admin | |
from django.contrib.admin.widgets import AdminURLFieldWidget | |
from django.db.models import URLField | |
from django.utils.safestring import mark_safe | |
from myapp.models import MyModel | |
class URLFieldWidget(AdminURLFieldWidget): | |
def render(self, name, value, attrs=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from django.contrib import admin | |
from poll.models import Site | |
class SiteForm(forms.ModelForm): | |
class Meta: | |
model = Site | |
def clean_name(self): | |
return self.cleaned_data['name'].strip() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error ini disebabkan karena collation di mysql menggunakan selain utf-8. | |
resolve : | |
================ | |
CARA PERTAMA : | |
================ | |
All I had to do was put this in settings.py: | |
'OPTIONS': { 'init_command': 'SET storage_engine=INNODB' } | |
Then I created the database myself in MySQL with: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//digunakan untuk mengubah semua collation ke utf-8 pada table. disini pada tabel oxero. | |
<?php | |
// your connection | |
mysql_connect("localhost","root","root"); | |
mysql_select_db("oxero"); | |
// convert code | |
$res = mysql_query("SHOW TABLES"); | |
while ($row = mysql_fetch_array($res)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chown www-data:www-data -R /var/www/drupal(or your drupal web root name)/sites |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A hex value is just RGB numbers represented in hexadecimal. So you just have to take each pair of hex digits and convert them to decimal. | |
Example: | |
#FF6400 = RGB(0xFF, 0x64, 0x00) = RGB(255, 100, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package omenk; | |
/** | |
* | |
* @author omenk | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package omenk; | |
/** | |
* | |
* @author omenk | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package omenk; | |
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package omenk; | |
/** | |
* | |
* @author omenk | |
*/ |