Re: how to saven models dynamically inputted by user in form

2014-07-01 Thread Aashita Dutta
here is my model- from django.db import models import useraccounts from librehatti.catalog.models import * from django.contrib.auth.models import User class QuotedOrder(models.Model): quote_buyer_id = models.ForeignKey(User) quote_is_debit = models.BooleanField()

Re: Creating subusers

2014-07-01 Thread Lachlan Musicman
I would recommend Intermediate Models as a good solution for these type of weird situations https://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships Cheers L. On 2 July 2014 12:20, Jorge Andrés Vergara Ebratt wrote: > Hello

Re: Creating subusers

2014-07-01 Thread Mario Gudelj
Hey Jorge, I think you should extend the Abstract User instead of doing it the old way, which is creating that OneToOne relationship with a custom model. So, you'll end up with this: class IndependentAgent(AbstractBaseUser, PermissionsMixin): tipo_licencia = models.CharField(max_lenght=140)

Creating subusers

2014-07-01 Thread Jorge Andrés Vergara Ebratt
Hello everyone, I'm trying to create a system that has 3 different user types: Independent Agent, that basically is what it sounds like, and Django's User Model works fine for this one. But the catch comes from the other 2, because it also needs to support agencies and agencies have

Re: how to saven models dynamically inputted by user in form

2014-07-01 Thread Lachlan Musicman
Woah there. Ok, well it's hard to help without more info, but here are some tips: - please don't ask a community project to "reply soon". We will reply when and if we can. Obviously ideally we would reply, and speedily, but we get what we got. - How to save the ForeignKey on an item? Well

is there any way to set a default formating for float/decimal numbers like default formats for date/datetime values?

2014-07-01 Thread Juan Jose Huelga
I would like to set a float or decimal format like those set in django.conf.locale.en.formats, for example a default format that floatformat template filter could use to format my numbers by default without decimal places. Something like settings.USE_THOUSAND_SEPARATOR that django use by

Re: how to saven models dynamically inputted by user in form

2014-07-01 Thread Aashita Dutta
On Tuesday, July 1, 2014 5:58:59 PM UTC+5:30, Lachlan Musicman wrote: > > Hi Aashita, > > There's a couple of things happening here. I'm no expert and this is a > rushed end of evening email. > > For getting the obj.save() to work, here: > > cd = form.cleaned_data >

Re: how to saven models dynamically inputted by user in form

2014-07-01 Thread Aashita Dutta
On Tuesday, July 1, 2014 5:58:59 PM UTC+5:30, Lachlan Musicman wrote: > > Hi Aashita, > > There's a couple of things happening here. I'm no expert and this is a > rushed end of evening email. > > For getting the obj.save() to work, here: > > cd = form.cleaned_data >

Re: how to saven models dynamically inputted by user in form

2014-07-01 Thread Aashita Dutta
PurchaseOrder has no use here, and yes item is foreign key to Product class which consists of item's name i.e item__name. Actually my QuotedItem class in models consist of 5 fields, and i want to save only two. Would this method be work? And also can we save method item__name which is foreign

Re: page not found errors for most urls but main landing page displaying okay

2014-07-01 Thread Lee
Thank you everyone. I solved the problem. It was a relative vs absolute url issue. There was a line in the static/js/applications.js file that had to be changed: RELATIVE_URL = '/myproject'; //for development leave this blank. For production it should be '/myproject' This was hard to debug

Re: pre_save on password

2014-07-01 Thread Avraham Serour
you should only store the user password once, if you are trying to catch it just to register in another application then you now have two problems you should set django use the other system as authentication backend, new users should just register there and change their passwords there, on the

Re: pre_save on password

2014-07-01 Thread Tom Evans
On Tue, Jul 1, 2014 at 1:27 PM, guillaume wrote: > Hi Tom, > > Yes indeed, I know that page, but there is no way I can make it the same > than the other one which relies on SHA256, some system key I don't know and > a random salt. So there is no way for me to find the

Re: pre_save on password

2014-07-01 Thread guillaume
Hi Phil, Actually not at the hasher level, because I need to know the user's details as well, but it's a good hint. I should try to subclass to User Model set_password method. Thanks ! Guillaume Le mardi 1 juillet 2014 15:03:58 UTC+2, Philip a écrit : > > If the username/whatever is

Re: pre_save on password

2014-07-01 Thread Philip Mountifield
If the username/whatever is available within the hasher you could create a subclass of the hasher you're using in Django and intercept the plain-text password there, call your API and then call the superclass? Phil On 01/07/2014 13:27, guillaume wrote: Hi Tom, Yes indeed, I know that page,

Re: pre_save on password

2014-07-01 Thread guillaume
Hi Tom, Yes indeed, I know that page, but there is no way I can make it the same than the other one which relies on SHA256, some system key I don't know and a random salt. So there is no way for me to find the correct encryption for the remote database, that's why I want to use it's API

Re: pre_save on password

2014-07-01 Thread Tom Evans
On Tue, Jul 1, 2014 at 1:12 PM, guillaume wrote: > > Hi, > thanks for your reply. Actually I don't want to store the uncrypted > password, just submit it to another app registration system, which will hash > it then. The two hashing systems are too different and

Re: pre_save on password

2014-07-01 Thread guillaume
Hi, thanks for your reply. Actually I don't want to store the uncrypted password, just submit it to another app registration system, which will hash it then. The two hashing systems are too different and complicated for me to use the django encrypted password in the other application database.

Re: pre_save on password

2014-07-01 Thread Rafael E. Ferrero
Sorry... i meant Best Regards (without ? hahahaha... sorry) -- Rafael E. Ferrero 2014-07-01 8:04 GMT-03:00 Rafael E. Ferrero : > I see this too dangerous... it is not a good idea save uncrypted > password... too many hacker attack result on public user-password list.

Re: pre_save on password

2014-07-01 Thread Rafael E. Ferrero
I see this too dangerous... it is not a good idea save uncrypted password... too many hacker attack result on public user-password list. Why not save encrypted password on the other application too? Best Regards? -- Rafael E. Ferrero 2014-07-01 6:41 GMT-03:00 guillaume

pre_save on password

2014-07-01 Thread guillaume
Hi list, When registering a new user, or a password change, I need to register that user, or his new password, in another application through an internal API. I'm trying to catch the password from the different form they can be found in, but without success. Even the signal pre_save is