Cannot login with user credentials

2016-07-23 Thread Robin Lery
I have a made custom user model. class CustomUserManager(BaseUserManager): def _create_user(self, email, username, password, first_name, last_name, date_of_birth, gender, mobile_number, is_active, is_admin, is_superuser): """ Creates and saves a user with g

Re: Cannot login with user credentials

2016-07-23 Thread Robin Lery
But again, with the superuser's credentials, I can login On Sat, Jul 23, 2016 at 12:47 PM, Robin Lery wrote: > I have a made custom user model. > > class CustomUserManager(BaseUserManager): > def _create_user(self, email, username, password, first_name, > last_name, date_of_birth, gender, m

When it make sense to use a different name for a custom manager of the Django`s model?

2016-07-23 Thread Seti Volkylany
If why know good article about it, send me link, I will resolve of itself. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.

Feeding prefetched results into new queryset

2016-07-23 Thread Дилян Палаузов
Hello, for the rendering of one View I want to execute two queries: class A(model.Model): i = models.CharField(max_length=10) class B(model.Model): f = models.ManyToManyField(A, on_delete...) j = models.CharField(max_length=10) - All objects of type A queryset1 = A.objects.all() - All

Re: When it make sense to use a different name for a custom manager of the Django`s model?

2016-07-23 Thread Derek
https://docs.djangoproject.com/en/1.9/topics/db/managers/#modifying-a-manager-s-initial-queryset Note the difference between overriding the default queryset (called "objects" by Django) vs creating your own - in the example shown, it is called "dahl_objects" (but of course should be a name that

Re: When it make sense to use a different name for a custom manager of the Django`s model?

2016-07-23 Thread Seti Volkylany
Sorry, Derek but I am do not understand your answer. "(but of course should be a name that makes sense for your app)" - Why? I was completely satisfied with default manager`s name - "objects" In my project, I am using next code: class Poll(models.Model): [fields and class Meta] objects = models.

Django selected value

2016-07-23 Thread webmamoffice
How to get value/name of currently selected drop box item? my models.py : class Model2(models.Model): . choice_field = models.ManyToManyField(to=Model1) ..

Re: Django-filer FilerImageField how to use widget outside admin

2016-07-23 Thread webmamoffice
You can try to create ModelForm: class YouModelForm(ModelForm) class Meta: model = YouModel fields = ['featured_image', 'other_fields'] in views.py: def youfunc(request) Youform = YouModelForm() in template.html: https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jq

Re: Django selected value

2016-07-23 Thread James Schneider
On Jul 23, 2016 10:46 AM, wrote: > > How to get value/name of currently selected drop box item? > Careful how you phrase that question. When it comes to forms, the name and value are two different things. > my models.py : > > class Model2(models.Model): >

Re: Django selected value

2016-07-23 Thread webmamoffice
I signed value/name as variants. Problem is i can`t get any of these- value of selected item and name of selected item. I was try: Model2.objects.order_by('choice_field') Model2.objects.values('choice_field') Model2.objects.values_list('choice_field') Model2.objects.all() I can`t get - as value o

GeoDjango does not change field type in PostGis to geography if geographic=True - possible bug

2016-07-23 Thread Piotr Kowenzowski
Hi, I had problem with the query: JobOffer.objects.filter( location__distance_lte=( current_location, D(km=radius)) ) because it returned everything. when I looked into SQL: SELECT "joboffers_joboffer"."id", "joboffers_joboffer"."owner_name", "joboffers_joboffer"."title", "joboffers_jobof