Pegar todos os objetos semelhantes em tempo de execu ção

2010-03-09 Thread Edgard Matos
Caros,

Tenho um object no django e quero pegar todos os objetos daquele mesmo tipo.
Sendo que eu não sei qual é o tipo deste objeto em tempo de execução.

Alguém sabe como fazer isso?
Obrigado!

-- 
Atenciosamente,

Edgard Matos

-- 
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: Erro ao tentar importar DjangoGateway

2010-03-08 Thread Edgard Matos
Obrigado pela resposta Jorge!
Eu instalei o Django através da seguinte instrução:

python setup.py install --disable-ext

Não instalei através do easy_install por não estar com o compilador do c
aqui meu OSX.
O engraçado é que se eu for no console do python e realizar o import, o
import é feito sem problemas.

Mesmo assim, será que é porque o PyAMF ainda não estar no PYTHON_PATH ?
Como eu faço pra colocá-lo lá?

Obrigado!

2010/3/8 Jorge Silva <juniorj...@gmail.com>

> Esse erro indica que o módulo PyAMF não está na PYTHON_PATH. Podes tentar
> adicioná-lo manualmente mas o ideal é usar o método easy_install que está
> descrito em  http://pyamf.org/install.html
>
> Podes descrever o modo como instalaste o PyAMF?
>
> 2010/3/8 Edgard Matos <edgardma...@gmail.com>
>
>> Caros,
>>
>> Estou tentando fazer uns testes com o PyAmf. Instalei a biblioteca
>> normamente.
>> Sendo que quando tento importar seus pacotes, não consigo.
>>
>> . Error was: cannot import name DjangoGateway
>>
>>
>> O meu gateway está assim:
>> from pyamf.remoting.gateway import DjangoGateway
>> import TesteAMF.cadastros.models as models
>>
>> services = {
>> 'Clientes': models
>> }
>>
>> echoGateway = DjangoGateway(services)
>>
>> Alguém sabe se eu tenho que configurar mais alguma coisa?
>> Obrigado!!!
>>
>> --
>> Atenciosamente,
>>
>> Edgard Matos
>> Direção de Projetos
>>
>> Deway - Inovação Digital
>> http://www.deway.com.br
>> Celular: (85) 8106 8252
>> Fortaleza: (85) 4062-9094
>> São Paulo: (11) 3522-9094
>> Skype: edgardmatos
>>
>> --
>> 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<django-users%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Com os melhores cumprimentos / Best regards,
>
> Jorge Rodrigues Silva
>
>  --
> 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<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Atenciosamente,

Edgard Matos
Direção de Projetos

Deway - Inovação Digital
http://www.deway.com.br
Celular: (85) 8106 8252
Fortaleza: (85) 4062-9094
São Paulo: (11) 3522-9094
Skype: edgardmatos

-- 
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.



Erro ao tentar importar DjangoGateway

2010-03-08 Thread Edgard Matos
Caros,

Estou tentando fazer uns testes com o PyAmf. Instalei a biblioteca
normamente.
Sendo que quando tento importar seus pacotes, não consigo.

. Error was: cannot import name DjangoGateway

O meu gateway está assim:
from pyamf.remoting.gateway import DjangoGateway
import TesteAMF.cadastros.models as models

services = {
'Clientes': models
}

echoGateway = DjangoGateway(services)

Alguém sabe se eu tenho que configurar mais alguma coisa?
Obrigado!!!

-- 
Atenciosamente,

Edgard Matos
Direção de Projetos

Deway - Inovação Digital
http://www.deway.com.br
Celular: (85) 8106 8252
Fortaleza: (85) 4062-9094
São Paulo: (11) 3522-9094
Skype: edgardmatos

-- 
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: DateField with Django

2009-02-12 Thread Edgard Matos
You have reason Alex.

I'm sorry.

On Wed, Feb 11, 2009 at 3:21 PM, Alex Gaynor <alex.gay...@gmail.com> wrote:

>
>
> On Wed, Feb 11, 2009 at 12:19 PM, Edgard Matos <edgardma...@gmail.com>wrote:
>
>> Anybody help me?
>>
>> On Wed, Feb 11, 2009 at 11:36 AM, Edgard Matos <edgardma...@gmail.com>wrote:
>>
>>> Hi!
>>>
>>> I have a model with a DateField and I'm setting the input_formats
>>> properties to "%d/%m/%Y":
>>> birth_date = forms.DateField(input_formats=("%d/%m/%Y",))
>>>
>>> When I go add a object in this format ("%Y/%m/%d"), the django validation
>>> validate with sucess.
>>>
>>> But when I edit my object:
>>> form = UserForm(instance=stored_user)
>>> Django fill the DateField in this format: ("%Y-%m-%d")
>>>
>>> How I do to Django fill the field in this format ("%Y/%m/%d") ?
>>>
>>> Anybody help me?
>>> Thanks!
>>>
>>> Edgard Matos from Brazil
>>>
>>
>>
>>
>> --
>> Atenciosamente,
>> Edgard Matos
>> E-mail: edgardma...@gmail.com
>> Skype: edgardmatos
>> Celular: 85 8837 8285
>>
>>
>>
>>
> Please be more patient, you've scarcely waited 3 hours before sending
> another email.  Remember that everyone who replies here is a volunteer, and
> we are scattered around the world, across many time zones, so try to wait at
> least a full day before "bumping" a thread.
>
> Alex
>
> --
> "I disapprove of what you say, but I will defend to the death your right to
> say it." --Voltaire
> "The people's good is the highest law."--Cicero
>
> >
>


-- 
Atenciosamente,
Edgard Matos
E-mail: edgardma...@gmail.com
Skype: edgardmatos
Celular: 85 8837 8285

--~--~-~--~~~---~--~~
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: DateField with Django

2009-02-11 Thread Edgard Matos
Anybody help me?

On Wed, Feb 11, 2009 at 11:36 AM, Edgard Matos <edgardma...@gmail.com>wrote:

> Hi!
>
> I have a model with a DateField and I'm setting the input_formats
> properties to "%d/%m/%Y":
> birth_date = forms.DateField(input_formats=("%d/%m/%Y",))
>
> When I go add a object in this format ("%Y/%m/%d"), the django validation
> validate with sucess.
>
> But when I edit my object:
> form = UserForm(instance=stored_user)
> Django fill the DateField in this format: ("%Y-%m-%d")
>
> How I do to Django fill the field in this format ("%Y/%m/%d") ?
>
> Anybody help me?
> Thanks!
>
> Edgard Matos from Brazil
>



-- 
Atenciosamente,
Edgard Matos
E-mail: edgardma...@gmail.com
Skype: edgardmatos
Celular: 85 8837 8285

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



DateField with Django

2009-02-11 Thread Edgard Matos
Hi!

I have a model with a DateField and I'm setting the input_formats properties
to "%d/%m/%Y":
birth_date = forms.DateField(input_formats=("%d/%m/%Y",))

When I go add a object in this format ("%Y/%m/%d"), the django validation
validate with sucess.

But when I edit my object:
form = UserForm(instance=stored_user)
Django fill the DateField in this format: ("%Y-%m-%d")

How I do to Django fill the field in this format ("%Y/%m/%d") ?

Anybody help me?
Thanks!

Edgard Matos from Brazil

--~--~-~--~~~---~--~~
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: No module named PIL - Django - Gae

2009-02-06 Thread Edgard Matos
Karen!

Very thank you!
My problem it's resolved!!!

Here also have a solution:

http://groups.google.com/group/google-appengine/browse_thread/thread/3aedf3cbcce1fd88

On Fri, Feb 6, 2009 at 3:24 PM, Karen Tracey <kmtra...@gmail.com> wrote:

> On Fri, Feb 6, 2009 at 12:13 PM, Edgard Matos <edgardma...@gmail.com>wrote:
>
>> My code:
>>
>> In model:
>> class User(db.Model):
>>   user = db.UserProperty()
>>   avatar = db.BlobProperty()
>>   def __unicode__(self):
>> return self.email
>>
>> class UserForm(djangoforms.ModelForm):
>>   class Meta():
>> model = User
>>
>>
>> In view:
>> data = UserForm(request.POST, request.FILES)
>> if data.is_valid():
>>   user = users.get_current_user()
>>entity = data.save(commit=False)
>>   entity.user = users.get_current_user()
>>   entity.put()
>>
>>
>> But this error happen:
>>
>> 'NoneType' object has no attribute 'validate'
>>
>>
>> Somebody can help me?
>>
>
> What happened to the PIL error!?  Did you solve that one or just remove
> some image-specific code?
>
> This error looks to be in the GAE code, see:
>
>
> http://www.mibgames.co.uk/2008/09/11/google-appengine-django-and-file-uploads/
>
> Google search shows other reports of this, but no solutions that I can find
> in a brief scan.  It seems that using a djangoforms.ModelForm for a GAE
> model that contains a BlobProperty might be somewhat broken.  One way to get
> around it is to exclude the BlobProperty field from the
> djangoforms.ModelForm, replacing it with an explicit form FileField, and
> handle assigning the file data to the BlobProperty in your own code:
>
> from django import forms
> from google.appengine.ext.db import djangoforms
> class UserForm(djangoforms.ModelForm):
> avatar_file = forms.FileField()
> class Meta:
> model = User
> exclude = ['avatar']
>
> def user(request):
> if request.method == 'POST':
> form = UserForm(request.POST, request.FILES)
> if form.is_valid():
> user = users.get_current_user()
> entity = form.save(commit=False)
> entity.avatar = form.cleaned_data['avatar_file'].read()
> entity.user = users.get_current_user()
> entity.put()
> return HttpResponseRedirect('/')
> else:
> form = UserForm()
> return render_to_response('user.html', {'form': form })
>
> Karen
> >
>


-- 
Atenciosamente,
Edgard Matos
E-mail: edgardma...@gmail.com
Skype: edgardmatos
Celular: 85 8837 8285

--~--~-~--~~~---~--~~
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: No module named PIL - Django - Gae

2009-02-06 Thread Edgard Matos
My code:

In model:
class User(db.Model):
  user = db.UserProperty()
  avatar = db.BlobProperty()
  def __unicode__(self):
return self.email

class UserForm(djangoforms.ModelForm):
  class Meta():
model = User


In view:
data = UserForm(request.POST, request.FILES)
if data.is_valid():
  user = users.get_current_user()
  entity = data.save(commit=False)
  entity.user = users.get_current_user()
  entity.put()


But this error happen:

'NoneType' object has no attribute 'validate'


Somebody can help me?


On Fri, Feb 6, 2009 at 2:09 PM, Karen Tracey <kmtra...@gmail.com> wrote:

> On Fri, Feb 6, 2009 at 12:05 PM, Alex Gaynor <alex.gay...@gmail.com>wrote:
>
>> I'm fairly certain PIL doesn't work on Google App Engine so I think google
>> has their own image module, you should consult the GAE documentation.
>>
>
> Their own images API apparently uses PIL:
>
> http://code.google.com/appengine/docs/python/images/installingPIL.html
>
> ?
>
> Karen
>
> >
>


-- 
Atenciosamente,
Edgard Matos
E-mail: edgardma...@gmail.com
Skype: edgardmatos
Celular: 85 8837 8285

--~--~-~--~~~---~--~~
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: No module named PIL - Django - Gae

2009-02-06 Thread Edgard Matos
Somebody can help me?

On Fri, Feb 6, 2009 at 11:58 AM, Edgard Matos <edgardma...@gmail.com> wrote:

> I only installed PIL in my system.
>
> I din't installer PIL on my project.
> Do I have to do this? How I do?
>
> Thanks!
>
>
> On Fri, Feb 6, 2009 at 11:44 AM, Edgard Matos <edgardma...@gmail.com>wrote:
>
>> Swaroop,
>>
>> On local system.
>>
>>
>> On Fri, Feb 6, 2009 at 11:42 AM, Swaroop C H <swaroo...@gmail.com> wrote:
>>
>>>
>>> Hi Edgard,
>>>
>>> Are you running this on your local system or on GAE?
>>>
>>> Regards,
>>> Swaroop
>>>
>>> Books and Blog - http://www.swaroopch.com
>>> Microblog - http://twitter.com/swaroopch
>>>
>>>
>>>
>>> On Fri, Feb 6, 2009 at 7:34 PM, Edgard Matos <edgardma...@gmail.com>
>>> wrote:
>>> > Hi!
>>> >
>>> > I'm trying to do a form to upload a image using Google App Engine +
>>> Django.
>>> > In my view, I have:
>>> > data = UserForm(request.POST, request.FILES)
>>> > if data.is_valid():
>>> >   user = users.get_current_user()
>>> >
>>> > But when I submit the form, an error has:
>>> > No module named PIL
>>> >
>>> > I always installed the Pil from
>>> http://www.pythonware.com/products/pil/.
>>> > And the error still happen.
>>> >
>>> > I'm using Windows XP.
>>> >
>>> >
>>> > Somebody know how to resolve this problem?
>>> >
>>> > Thanks a lot!
>>> >
>>> > --
>>> > Atenciosamente,
>>> > Edgard Matos
>>> > E-mail: edgardma...@gmail.com
>>> > Skype: edgardmatos
>>> > Celular: 85 8837 8285
>>> >
>>> > >
>>> >
>>>
>>> >>>
>>>
>>
>>
>> --
>> Atenciosamente,
>> Edgard Matos
>> E-mail: edgardma...@gmail.com
>> Skype: edgardmatos
>> Celular: 85 8837 8285
>>
>
>
>
> --
> Atenciosamente,
> Edgard Matos
> E-mail: edgardma...@gmail.com
> Skype: edgardmatos
> Celular: 85 8837 8285
>



-- 
Atenciosamente,
Edgard Matos
E-mail: edgardma...@gmail.com
Skype: edgardmatos
Celular: 85 8837 8285

--~--~-~--~~~---~--~~
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: No module named PIL - Django - Gae

2009-02-06 Thread Edgard Matos
I only installed PIL in my system.

I din't installer PIL on my project.
Do I have to do this? How I do?

Thanks!

On Fri, Feb 6, 2009 at 11:44 AM, Edgard Matos <edgardma...@gmail.com> wrote:

> Swaroop,
>
> On local system.
>
>
> On Fri, Feb 6, 2009 at 11:42 AM, Swaroop C H <swaroo...@gmail.com> wrote:
>
>>
>> Hi Edgard,
>>
>> Are you running this on your local system or on GAE?
>>
>> Regards,
>> Swaroop
>>
>> Books and Blog - http://www.swaroopch.com
>> Microblog - http://twitter.com/swaroopch
>>
>>
>>
>> On Fri, Feb 6, 2009 at 7:34 PM, Edgard Matos <edgardma...@gmail.com>
>> wrote:
>> > Hi!
>> >
>> > I'm trying to do a form to upload a image using Google App Engine +
>> Django.
>> > In my view, I have:
>> > data = UserForm(request.POST, request.FILES)
>> > if data.is_valid():
>> >   user = users.get_current_user()
>> >
>> > But when I submit the form, an error has:
>> > No module named PIL
>> >
>> > I always installed the Pil from http://www.pythonware.com/products/pil/
>> .
>> > And the error still happen.
>> >
>> > I'm using Windows XP.
>> >
>> >
>> > Somebody know how to resolve this problem?
>> >
>> > Thanks a lot!
>> >
>> > --
>> > Atenciosamente,
>> > Edgard Matos
>> > E-mail: edgardma...@gmail.com
>> > Skype: edgardmatos
>> > Celular: 85 8837 8285
>> >
>> > >
>> >
>>
>> >>
>>
>
>
> --
> Atenciosamente,
> Edgard Matos
> E-mail: edgardma...@gmail.com
> Skype: edgardmatos
> Celular: 85 8837 8285
>



-- 
Atenciosamente,
Edgard Matos
E-mail: edgardma...@gmail.com
Skype: edgardmatos
Celular: 85 8837 8285

--~--~-~--~~~---~--~~
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: No module named PIL - Django - Gae

2009-02-06 Thread Edgard Matos
Swaroop,

On local system.

On Fri, Feb 6, 2009 at 11:42 AM, Swaroop C H <swaroo...@gmail.com> wrote:

>
> Hi Edgard,
>
> Are you running this on your local system or on GAE?
>
> Regards,
> Swaroop
>
> Books and Blog - http://www.swaroopch.com
> Microblog - http://twitter.com/swaroopch
>
>
>
> On Fri, Feb 6, 2009 at 7:34 PM, Edgard Matos <edgardma...@gmail.com>
> wrote:
> > Hi!
> >
> > I'm trying to do a form to upload a image using Google App Engine +
> Django.
> > In my view, I have:
> > data = UserForm(request.POST, request.FILES)
> > if data.is_valid():
> >   user = users.get_current_user()
> >
> > But when I submit the form, an error has:
> > No module named PIL
> >
> > I always installed the Pil from http://www.pythonware.com/products/pil/.
> > And the error still happen.
> >
> > I'm using Windows XP.
> >
> >
> > Somebody know how to resolve this problem?
> >
> > Thanks a lot!
> >
> > --
> > Atenciosamente,
> > Edgard Matos
> > E-mail: edgardma...@gmail.com
> > Skype: edgardmatos
> > Celular: 85 8837 8285
> >
> > >
> >
>
> >
>


-- 
Atenciosamente,
Edgard Matos
E-mail: edgardma...@gmail.com
Skype: edgardmatos
Celular: 85 8837 8285

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Redirect with reverse

2009-02-03 Thread Edgard Matos
Hello!

I need help!
In my project, I need authenticate user in a module and sends user to
previews page.

I was try so:

  url_to_redirect = request.get_full_path()
  return HttpResponseRedirect(reverse('users.views.add',
args=(url_to_redirect,)))

And in my view, users.views.add, I get the url_to_redirect, to sends the
user.
But a exception occurs: Reverse for '' with
arguments '(u'/links/adicionar/',)' and keyword arguments '{}' not found.

How can I do this?

Very thanks!

-- 
Atenciosamente,
Edgard Matos
E-mail: edgardma...@gmail.com
Skype: edgardmatos
Celular: 85 8837 8285

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---