released source code of tipsforlinux.com

2010-09-10 Thread Gustavo Henrique
Hi!
I'm think the beginners can enjoy the source code...

website: http://tipsforlinux.com
source: http://github.com/gustavohenrique/TipsForLinux

Suggestions are welcome!


-- 
Gustavo Henrique
blog.gustavohenrique.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django using 2 DB

2009-10-30 Thread Gustavo Henrique

Thanks Russ!
How I create a combobox in ModelForm contains data from other database?
for exemple:
class Client(models.Model):
group = models.IntegerField() # this contains a id from another DB
...

class ClientForm(ModelForm):
group = ModelChoiceField(queryset=???)
class Meta:
model = Client


Thanks again!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django using 2 DB

2009-10-30 Thread Gustavo Henrique

Hi!
I have a project using mysql and it have to access a firebird BD for
get data.
What the better way to use 2 databases in django? What you recommend
me to do? Maybe SQLAlchemy?

Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django + QT4

2009-09-23 Thread Gustavo Henrique
I don't have much experience in pyhon and I need to create a desktop app to
works as complement to website made with django, both using same database.
So, I thing to use django with python + pyqt/pygtk/wxpython for database
management.

Thanks Brian!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django + QT4

2009-09-23 Thread Gustavo Henrique

Hi guys!
Is possible use django with qt4 for desktop apps?
if yes, where I can find about this? anyone have a example to study?

Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem with u'' in template

2009-08-24 Thread Gustavo Henrique

Sorry, I forgot about json.
Solved!
Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



problem with u'' in template

2009-08-24 Thread Gustavo Henrique

Hi!
I'm sending unicode string for template page, whitin a javascript
code, and I have a problem with the char u before string value.
For example:


{{ string|safe }} -->// {'fieldLabel': u'Cliente', 'name': u'cliente',
'value': u''}


In the body there isn't a problem, but in the javascript code it isn't
a valid code.

How can I remove this u?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Apache mod_wsgi Django setup - Forbidden You don't have permission to access /mysite on this server.

2009-08-11 Thread Gustavo Henrique

Do you using a windows ou linux?
if it's linux, try:

create a dir: /home/user/django and put your project inside it and
create a file called mysite.wsgi in same dir containing:

import os, sys
sys.path.append('/usr/lib/python2.6/site-packages/django/')
sys.path.append('/home/user/myproject')
os.environ['DJANGO_SETTINGS_MODULE']='myproject.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


and modofy the apache configuration (I'm using ubuntu):

# vim /etc/apache2/sites-enabled/000-default

WSGIRestrictStdout Off

LimitInternalRecursion 1000
ServerAdmin webmas...@localhost
ServerName localhost
DocumentRoot /home/user/django/
ErrorLog /home/user/django/apache.log
LogLevel warn
AddHandler wsgi-script .wsgi

AllowOverride FileInfo
Options ExecCGI MultiViews FollowSymLinks
MultiviewsMatch Handlers
Order deny,allow
Allow from all

Alias /media/ "/home/user/django/myproject/media/"

Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order allow,deny
    allow from all







-- 
Gustavo Henrique
http://www.gustavohenrique.net
http://blog.gustavohenrique.net

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Question about request.user

2009-08-11 Thread Gustavo Henrique

maybe a problem with cache.
try this:

from django.views.decorators.cache import never_cache
@never_cache
def yourview(request):
   # your code here




-- 
Gustavo Henrique
http://www.gustavohenrique.net
http://blog.gustavohenrique.net

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: unique_together with None

2009-08-11 Thread Gustavo Henrique

Try also: null=True, blank=True


-- 
Gustavo Henrique
http://www.gustavohenrique.net
http://blog.gustavohenrique.net

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django for smaller sites

2009-08-11 Thread Gustavo Henrique

Django is the best option for websites. It's very good for e-commerce,
cms, ERP, CRM, etc.
IMHO, the bests frameworks are:

1. Django
2. Rails
3. CakePHP
4. Code Igniter

PS.: I tried all php frameworks, but python frameworks only django.
See about web2py too.


-- 
Gustavo Henrique
http://www.gustavohenrique.net
http://blog.gustavohenrique.net

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: comparing date and datetime

2009-08-06 Thread Gustavo Henrique

Sorry, it were an human error!
Solved!



-- 
Gustavo Henrique
http://www.gustavohenrique.net
http://blog.gustavohenrique.net

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



comparing date and datetime

2009-08-06 Thread Gustavo Henrique

Hi!
I'm trying to compare 2 dates and appears the error message:
can't compare datetime.datetime to datetime.date

But in the shell is ok. why?

date1 = models.DateField()
date2 = datetime.date.today()

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problem sending json objects

2009-07-21 Thread Gustavo Henrique

Thanks, David!
I converted to string using:

str_obj = ''
$.each(obj, function(k, v) {
str_cols += '"'+k+'": "'+v+'",';
});
str_obj = '{'+str_obj.slice(0,-1)+'}';


-- 
Gustavo Henrique
Site: http://www.gustavohenrique.net
Blog: http://blog.gustavohenrique.net

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Problem sending json objects

2009-07-16 Thread Gustavo Henrique

Hi list!
I'm a problem with json and django. My javascript code send all data
by ajax but my view don't accept the content [Object Object] like json
object.
I try using jquery:

settings = {
model_name: 'Client',
cols: {"id": {"label":"", "width":"10px"}, "name":
{"label":"Nome", "width":"300px;"}}
}

$.ajax({
type: 'POST',
url: '/datagrid/',
dataType: 'json',
data: settings,
success: function(r) {


Django raise exception:
Exception Value: Expecting object: line 1 column 1 (char 1)
Exception Location: /usr/lib/python2.5/site-packages/django/utils/
simplejson/decoder.py in JSONArray, line 221

in my view I use:

def myview(request)
P = request.POST
cols = "%s" % simplejson.loads(P.get('cols'))

but the request's content is:


Can you help me?

Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Import all modelspy from all apps

2009-07-14 Thread Gustavo Henrique

Hi guys!

How to import all models.py from all apps in a specific views.py in
one app in my project automatically?

Thanks!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: DjangoCon '09

2009-07-14 Thread Gustavo Henrique

+1, too

I thinks interesting record in video all about that.
This important for consolidate the Django with all developers in the world.



-- 
Gustavo Henrique
Site: http://www.gustavohenrique.net
Blog: http://blog.gustavohenrique.net

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



apache, mod_wsgi and 100-continue

2009-06-28 Thread Gustavo Henrique

hi guys,
I have a problem with an URL sending a request POST with header 100-
continue to my app. I'm using a service similar to the Paypal. The
request don't sending the POST and GET content.
The result of the request:

,
POST:,
COOKIES:{},
META:{'CONTENT_LENGTH': '641',
 'CONTENT_TYPE': 'application/x-www-form-urlencoded',
 'DOCUMENT_ROOT': '/home/xsol/www/',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_CONNECTION': 'Keep-Alive',
 'HTTP_EXPECT': '100-continue',
 ... other data here ...
 'REQUEST_METHOD': 'POST',
 'REQUEST_URI': '/cart/finish/'
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SIGNATURE': '',
 'SERVER_SOFTWARE': 'Apache',
 'UNIQUE_ID': 'SkfIaX8AAAEAAHaKXs8AAABy',
 'mod_wsgi.application_group': 'www.mydomain.com.br|',
 'mod_wsgi.callable_object': 'application',
 'mod_wsgi.listener_host': '189.38.80.76',
 'mod_wsgi.listener_port': '80',
 'mod_wsgi.process_group': 'www.mydomain.com.br',
 'mod_wsgi.reload_mechanism': '1',
 'mod_wsgi.script_reloading': '1',
 'wsgi.errors': ,
 'wsgi.file_wrapper': ,
 'wsgi.input': ,
 'wsgi.multiprocess': True,
 'wsgi.multithread': True,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>

Can anybody help me?
Sorry for the my question, but my english is not perfect.

Thank you!



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: encoding question

2009-06-24 Thread Gustavo Henrique

try:

from unicodedata import normalize
mytext = '%u05D9%u05D2'
newtext = normalize('NFKD', mytext).encode('ASCII','ignore')

or:

import sys
reload(sys)
sys.setdefaultencoding('latin-1')

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: request.session in template tag?

2009-06-01 Thread Gustavo Henrique

Using direct_to_template the request var is passed as param.
So, you can access in template: {{ request.session.myvar }}



-- 
Gustavo Henrique
Site: http://www.gustavohenrique.net
Blog: http://blog.gustavohenrique.net

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---