Re: How do I customize registration form HTML?

2017-12-01 Thread Luiz Guilherme Schiefler de Arruda
Hello, I don't know if this tutorial will help you. It helped me a lot. https://simpleisbetterthancomplex.com/series/2017/09/25/a-complete-beginners-guide-to-django-part-4.html#sign-up It is a very good serie teaching how to build a board. Em quinta-feira, 30 de novembro de 2017 22:50:35 UTC-2,

Re: Exception Value: UNIQUE constraint failed: accounts_profile.user_id

2017-11-05 Thread Luiz Guilherme Schiefler de Arruda
; > See > http://musings.tinbrain.net/blog/2015/jun/10/updating-two-models-single-post/ > for proper solution. > > 5.11.2017 0.01 "Luiz Guilherme Schiefler de Arruda" > kirjoitti: > >> Hello folks, >> >> I'm studying Django and everything was ok until this mo

Exception Value: UNIQUE constraint failed: accounts_profile.user_id

2017-11-04 Thread Luiz Guilherme Schiefler de Arruda
Hello folks, I'm studying Django and everything was ok until this morning. After creating a form using inlineformset_factory, I can't create an user. I got this error when creating the user inside the form I've created: Exception Value: UNIQUE constraint failed: accounts_profile.user_id Ana

Re: Modeling Question on Many-to-Many(with through) and Proxy models

2012-04-22 Thread Arruda
#x27;) > > @property > def foo1bar_list(self): > qr = self.foobar_list.filter(foo__type=1) > qr.model = Foo1Bar > return qr > > def __unicode__(self): > return "%s" %(self.pk) And this is aparently working, but

Re: Modeling Question on Many-to-Many(with through) and Proxy models

2012-04-22 Thread Arruda
Thanks, I saw that .model thing too, but was also unsure about it... I might just test it. Em sábado, 21 de abril de 2012 19h04min30s UTC-3, akaariai escreveu: > > On Apr 21, 8:35 pm, Arruda wrote: > > Should I create this many-to-many table as a normal model(no proxy) and > s

Modeling Question on Many-to-Many(with through) and Proxy models

2012-04-21 Thread Arruda
ad of Foo? Or should I use only FooBar as many-to-many and create some specific queries that would convert ALL the returned foo objects as Foo1 instance? And if I'm going to have not only Foo1 proxy model, but Foo2, Foo3, and Foo4 and maybe Foo5... which approach is the best? And of co

Re: Dynamically generated models using exec. Is it too custly?

2012-04-17 Thread Arruda
s they are called etc... > > http://docs.python.org/library/profile.html#module-profile > > Regards > Phil > > On 17/04/2012 13:48, Arruda wrote: > > yes, I see, but how can I measure this? Do you know the function that is > used? > Thanks for the help. > &g

Re: Dynamically generated models using exec. Is it too custly?

2012-04-17 Thread Arruda
In terms of performance, I suggest trying out both approaches and > measuring the time taken to do it a few hundred or thousand times and > compare. > > Regards > Phil > > > On 16/04/2012 17:55, Arruda wrote: > > Hummm, I see, thanks for that, I didn't know about t

Re: Dynamically generated models using exec. Is it too custly?

2012-04-16 Thread Arruda
example: >> >> >>> class X(object):... a = 1 >> Is exactly the same as doing...>>> X = type('X', (object,), dict(a=1)) >> >> No exec required... >> >> Regards >> Phil >> >> >> >> On 16/04/2012

Dynamically generated models using exec. Is it too custly?

2012-04-16 Thread Arruda
I'm doing something like this to generate some models dynamically: SIMILAR_MODELS_TEMPLATE= > """ > @some_decorator > class %(PREFIX)sModel (Some_Abs_model): > \"""%(DESCRIPTION)s > \""" > pass > """ then I have a factory: > def similar_models_factory(prefix,description): > for

Re: mocking out a Model

2012-04-15 Thread Arruda
Have you ever tried model-mommy? It's has some nice features, don't know if you find what you want there but it's a good shot. Em sábado, 14 de abril de 2012 08h49min06s UTC-3, jonas escreveu: > > Hello, > > I'm trying to test a function that imports and acts upon a django model, > named House.

Re: Add new QuerySet to reverse of a ManyToMany relation

2012-04-15 Thread Arruda
Sorry everyone, I just found out this was a fixed issue in the PassThroughManager of django-model-utils, in 1.1.0 it adds also the queryset to the related. =) Em segunda-feira, 16 de abril de 2012 00h08min03s UTC-3, Arruda escreveu: > > Hi there, I don't know if I put the right tit

Add new QuerySet to reverse of a ManyToMany relation

2012-04-15 Thread Arruda
Hi there, I don't know if I put the right title, so here is what I'm stuck with: I have this model: > class Foo(models.Model): > name = models.CharField(...) this one: > class Bar(models.Model): > name = models.CharField() And their connection: > class FooBar(models.Model): >

Re: PythonScript(Zope) like in a django app, any tips?

2012-04-15 Thread Arruda
Nice one this PyPy, I'll test this soon =) thanks! Em domingo, 15 de abril de 2012 07h58min41s UTC-3, Kevin escreveu: > > Check out PyPy Sandboxing, it may be your best bet: > > http://pypy.org/features.html#sandboxing > > > On Saturday, 14 April 2012 11:45:41 UTC-5, Ar

Re: PythonScript(Zope) like in a django app, any tips?

2012-04-14 Thread Arruda
oh, I see, but the problem is that I need this scripts to be ran often and if I make a request to a sandbox, and then this sandbox send other requests to my server getting and changing data(since some scripts change the data of my server) this would take too long, and make the server unable to r

Re: PythonScript(Zope) like in a django app, any tips?

2012-04-14 Thread Arruda
Is this what you're talking about? https://developers.google.com/appengine/docs/python/overview Still don't understand how this would be used. Em sábado, 14 de abril de 2012 14h19min01s UTC-3, Andy McKay escreveu: > > That's not something I'd ever recommend an untrusted user do. There > are still

PythonScript(Zope) like in a django app, any tips?

2012-04-14 Thread Arruda
Hi there, I'm doing a system where I want the users to be able to set/change some scripts that are dynamically run(RPG like scripts). So a user can change the way the Kill_a_player script is run. I thought of doing this by using exec, like this: class Script(models.Model): > script_py = mod

Re: Question about threading a view[REPOSTED]

2012-04-09 Thread Arruda
ame server and same process? > > That is why there exists things like django-celery and rabbitmq (message > broker). How they work is already explained to you. > > 20.3.2012 16:52, Arruda kirjoitti: > > Thanks every one, I've manage to work this around. > > The soluti

Re: How can I access log production server?

2012-04-07 Thread Arruda
s UTC-3, Ejah escreveu: > > You can set your logging params at the bottom of your settings.py > file. Here you can determine when, how and where django will log. > Hth > > On 7 apr, 00:04, Arruda wrote: > > Hi there, I'm using nginx and fastcgi(using threaded me

How can I access log production server?

2012-04-06 Thread Arruda
Hi there, I'm using nginx and fastcgi(using threaded method) to run a django project, but when another thread start I get some erros. But I don't know if this is a thread problem or a db problem or what... But wanted to know if there is someway to get log from the production server. When I use r

Re: Question about threading a view[REPOSTED]

2012-03-25 Thread Arruda
use it xD). Thanks! Em terça-feira, 20 de março de 2012 12h01min47s UTC-3, Javier Guerra escreveu: > > On Tue, Mar 20, 2012 at 9:52 AM, Arruda > > > wrote: > > But I still wanted to know how to use the celery in this case =/ > > the idea is to use a Queue: > >

Re: Question about threading a view[REPOSTED]

2012-03-20 Thread Arruda
nda-feira, 19 de março de 2012 15h18min09s UTC-3, Arruda escreveu: > > *(I've created a topic like this a few minutes ago, but was using the old > google groups, and now it's broken. So I created a new one using the new > google groups).* > Hi, I'll try to explain th

Re: Question about threading a view[REPOSTED]

2012-03-19 Thread Arruda
min03s UTC-3, Kurtis escreveu: > > Did you check out django-celery yet? > > On Mon, Mar 19, 2012 at 2:18 PM, Arruda wrote: > >> *(I've created a topic like this a few minutes ago, but was using the >> old google groups, and now it's broken. So I created a new one usin

Question about threading a view[REPOSTED]

2012-03-19 Thread Arruda
*(I've created a topic like this a few minutes ago, but was using the old google groups, and now it's broken. So I created a new one using the new google groups).* Hi, I'll try to explain the best I can my problem, and I don't know if what I'm trying to archive is the best way to get where I want

Question about threading a view

2012-03-19 Thread Felipe Arruda
Hi, I'll try to explain the best I can my problem, and I don't know if what I'm trying to archive is the best way to get where I want, but here is it: I want that a specific view to run in a new thread, ex: def foo(request): do_something_slow() return httpResponse But I DON'T want that a

Django Deploy - Some Questions regarding it

2012-01-28 Thread Felipe Arruda
Hi there everyone, I'm trying to make my first deploy of a project, and encountered some problems. Here is the scenario: I read that to make uploaded files only accessible for the uploader(the user) was a better choice to use nginx(apparently more easy to configure). But after following a couple of

Starting Your Project With Django-Structurer

2011-11-22 Thread Felipe Arruda
ust do pip: pip install django-structurer Here is the repository: https://github.com/arruda/django-structurer for the ones that are willing to help. And the docs: https://github.com/arruda/django-structurer/wiki/Docs Hope it helps you all, and if you want you can create your own project structur

Re: Work in memory instead of BD, how to?

2011-08-18 Thread Felipe Arruda
Humm, I see, the second case I could make out of it somehow(just have some doubts in 2.5: How am I supposed to do this?) The first one I could't see how I'm not going to lose the changes, done in cache. My biggest problem is in altering some value in some models, since this operation will be done m

Re: Work in memory instead of BD, how to?

2011-08-18 Thread Felipe Arruda
y app which spares you from > reinventing the wheel:http://bitbucket.org/kmike/django-cache-utils/ > > Cheers, > AT > > On Thu, Aug 18, 2011 at 10:22 AM, Felipe Arruda < > > > > > > > > felipe.arruda.pon...@gmail.com> wrote: > > Hi there, I was

Work in memory instead of BD, how to?

2011-08-18 Thread Felipe Arruda
Hi there, I was doing some project recently and faced a problem of performance. I need to be able to do a lot of access to some information on the DB, almost all the time, and doing so seams to be taking too long. Is it possible do do something like this: Get the infos from the BD and put them in

Creating a System that allow to create sub-systems

2011-01-06 Thread Arruda
Hi there, I'm new here and kind of new to Django too, but after messing with other things like Java, I was impressed in the agility and facility that Django does things. So here is the deal, I'm trying to create a site that allow the users to have something like a small personal system. And each s

Using sqlite :memory: database for development.

2010-08-17 Thread Thiago de Arruda
Hi, I'm coming to django from grails, in which which I used an in-memory hsql database for development and in my startup script I initialized the in-memory database with some stub values/users that were inserted everytime I started the server. This setup was really helpful in early stage devel