Re: Selenium Functional Tests against Heroku-hosted Django Site

2016-10-14 Thread ludovic coues
Have you tried to do it yet ?
Have you found any specific problem you need help solving ?

2016-10-14 3:52 GMT+02:00 A Wall :
> Hello,
>
> I'm looking to run functional tests using Django 1.10.2 and Selenium 3.0.0
> against a staging Django site hosted on Heroku.  To be clear, I want to do
> something like entering the command $ python manage.py test my_functional
> tests --liveserver=[ip address of remote server here], as is recommended in
> Harry Percival's book TDD With Python.  Has anyone been able to do this
> successfully?  Thank you a million!
>
> --
> 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.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/326a578a-0ab5-4a29-8865-4c97e8bee3fd%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEuG%2BTYTqzDhU752hjAQ9ms18oRym7%2BPYuMY7NQUGh5E5SXcHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mypy-django: Enable static type checking in your django projects

2016-10-14 Thread Jari Pennanen
Hello!

This is awesome, I stopped using Django ~4 years ago, because type safety 
is something I think is necessity in bigger projects.

Why is this a separate repo? Shouldn't this be the project for Django devs? 
I cannot consider Django again until type-safety (in API / models level at 
least) is part of the ethos of main developers.

Sad fact is that right now my frontend stack is more durable (TypeScript + 
React which type checks even templates) than backend if I were to use 
Django without types.

Thanks.

On Thursday, October 6, 2016 at 7:51:12 PM UTC+3, Elías Andrawos wrote:
>
>
> Hi all, 
> We’re happy to make a release of mypy-django 0.1.1, the first of many!
> It’s a collection of type stubs for using with the mypy static type 
> checking tool (and also with other PEP-484 compliant tools). 
>
> more info;
> http://www.machinalis.com/blog/first-release-of-mypy-django/ 
> 
> https://github.com/machinalis/mypy-django
>
> Feedback is welcome, thanks in advance
>
> Elías
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20da19d8-208a-4dc2-94f6-7d84e19d074c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


New Record vs Updating Existing

2016-10-14 Thread Frank Semaganga
Hello Team,

I am having challenge with my views/dB.

I am receiving http data and successfully save to the models but the 
problem is sometimes the data get into new dB row and sometimes is updating 
the existing dB row.

I want it to insert new row every time data is received.


What could have been a problem!! any experience!!

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1560dd92-5263-4985-84cc-e0fccc46bcd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Dynamic choice option for select filed in Multivaluefield

2016-10-14 Thread saranya k


I want to set choices for ChoiceField in MultiValueField in form init. But its 
not getting updated.
class TestField(forms.MultiValueField):

def __init__(self,*args, **kwargs):

  

error_messages = {

'incomplete': 'incomplete',

}

a = forms.ChoiceField(choices=((1,'a'),),required=True)

b =forms.ChoiceField(choices=((2,'b'),),required=True)

c = forms.ChoiceField(choices=((3,'c'),),required=True )   

fields = (a,b,c )

widget = TestWidget(mywidgets=[fields[0].widget, fields[1].widget, 
fields[2].widget])

super(TestField, self).__init__(

error_messages=error_messages, fields=fields,widget=widget,

require_all_fields=True, *args, **kwargs

)

def compress(self, data_list):

if data_list:  

return 
{'academic':data_list[0],'ugs':data_list[1],'stu_sec':data_list[2]}

  

class TestWidget(widgets.MultiWidget):

def __init__(self, mywidgets,attrs=None):

_widgets = (

widgets.Select(attrs=attrs, choices=mywidgets[0].choices),

widgets.Select(attrs=attrs,choices=mywidgets[1].choices),

widgets.Select(attrs=attrs,choices=mywidgets[2].choices),

)

super(TestWidget, self).__init__(_widgets, attrs)

  

  

def decompress(self, value):

if value:

return [value['academic'], value['ugs'], value['stu_sec']]

return [None, None, None]  

 

 

class TestForm(forms.Form): 

  t=TestField()

   def __init__(self, *args, **kwargs):

   super(TestForm, self).__init__(*args, **kwargs)

   self.fields['t'].fields[1].choices = ((1,1),)

 

Help me to achieve this…

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/518fa1e4-e3de-47fc-8051-22cf19df3de6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: New Record vs Updating Existing

2016-10-14 Thread Jani Tiainen

Hi,

When you save your data, you can say .save(force_insert).

Django usually makes decision based on primary key value, if it's None 
Django tries to insert, otherwise Django tries update and then insert if 
update fails.



On 14.10.2016 10:50, Frank Semaganga wrote:

Hello Team,

I am having challenge with my views/dB.

I am receiving http data and successfully save to the models but the 
problem is sometimes the data get into new dB row and sometimes is 
updating the existing dB row.


I want it to insert new row every time data is received.


What could have been a problem!! any experience!!
--
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.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1560dd92-5263-4985-84cc-e0fccc46bcd1%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Jani Tiainen

--
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/da62a6e1-46d6-4222-4f6b-f2172b11f3d3%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: admin popup + button help

2016-10-14 Thread David
Hi Giuseppe,
I was upgrading to a later version of django and ran into the same issue. 
Did you find a work-around?

On Wednesday, April 27, 2016 at 11:37:19 AM UTC-7, Giuseppe wrote:
>
> I managed to get this working, sort of. I learned that I need to include 
> jquery.init.js to my parent form. otherwise It wont open in a new window. 
> Now the only issue I am encountering is after I submit my child form, the 
> window goes white, but does not close. I think the code that gets called 
> when I submit the form is this 
> return HttpResponse(' type="text/javascript">opener.dismissAddRelatedObjectPopup(window, "%s", 
> "%s");' % \
> (escape(newObject._get_pk_val()), escape(newObject)))
> I cant figure out if its being called at all or if its being called on the 
> child or if its being called on the parent and thats why its not closing. 
> "window" is being staticaly typed so its not in the view code other than 
> that one spot. 
>
> Here is the Django code for the dismiss function (this was pulled directly 
> from  
> https://github.com/django/django/blob/master/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js
> function dismissAddRelatedObjectPopup(win, newId, newRepr) {
>var name = windowname_to_id(win.name);
>var elem = document.getElementById(name);
>if (elem) {
>var elemName = elem.nodeName.toUpperCase();
>if (elemName === 'SELECT') {
>elem.options[elem.options.length] = new Option(newRepr, 
> newId, true, true);
>} else if (elemName === 'INPUT') {
>if (elem.className.indexOf('vManyToManyRawIdAdminField') 
> !== -1 && elem.value) {
>elem.value += ',' + newId;
>} else {
>elem.value = newId;
>}
>}
>// Trigger a change event to update related links if required.
>$(elem).trigger('change');
>} else {
>var toId = name + "_to";
>var o = new Option(newRepr, newId);
>SelectBox.add_to_cache(toId, o);
>SelectBox.redisplay(toId);
>}
>win.close();
>}
>
> I can see that after I submit my new object gets selected in the dropdown 
> inside the parent form, but the popup window from the child form does not 
> close. Any ideas how to get the child form to close, the dismiss function 
> should be doing that correct?
>
>
> On Wednesday, April 20, 2016 at 5:06:22 PM UTC-4, Giuseppe wrote:
>>
>> I am trying to get a pop up that will let me create a new object to 
>> associate to a many to many relationship on a form/model. In the same way 
>> that it works in django-admin.
>>
>> I have been followed the instructions from here 
>> , and its 
>> not working for me. 
>>
>> whenever I click the plus button it opens the related object creating 
>> form in the same tab instead of a new pop up. When I try to submit the new 
>> object I get a cert error and I included the cert tag in the template.
>>
>> Let me know what code you want to see and I can post it. Also if you know 
>> of a different resource, or library or way of doing this that would be 
>> amazing.
>>
>> By the way I think the link provided was for django 1.1 and im using 
>> django 1.9.1
>>
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b4138f74-172e-490c-8989-503afbab74ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to replace content_type and object_id fields by a field with actual object in admin inline?

2016-10-14 Thread Anton Ponomarenko


I have inline, which shows data of contenttype model, so instead of real 
objects, I see content_type and object_id fields. I can exclude these 
fields - this is not a problem, but also I want to get real current object 
as selected with other Places in a dropdown list. Could anyone tell me, how 
can I do this?


Model:

class Criterias(models.Model):
name = ...
class Places(models.Model):
name = ...
class PlacesToCriterias(models.Model):
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey()

criteria_group = models.ForeignKey(Criterias)

Admin:

class CriteriaPlacesInlineAdmin(admin.TabularInline):
model = PlacesToCriterias
class CriteriasAdmin(admin.ModelAdmin):
inlines = [CriteriaPlacesInlineAdmin]

admin.site.register(Criterias, CriteriasAdmin)

I can add to CriteriaPlacesInlineAdmin a form, something like:

class CriteriaPlacesChoicesFieldForm(forms.ModelForm):
places = forms.ModelChoiceField(PlaceTypesGroups.objects.all(), 
label='place')

but how can I pass\add object_id to this form\query in order to get 
'selected' place in the dropdown list?

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/240fdcdb-8083-4d5a-b116-a52144dded17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to replace content_type and object_id fields by a field with actual object in admin inline?

2016-10-14 Thread Tim Graham
Something like https://pypi.python.org/pypi/django-genericforeignkey? 
Search "django admin generic foreign key widget" for other possibilities.

On Friday, October 14, 2016 at 10:42:40 AM UTC-4, Anton Ponomarenko wrote:
>
> I have inline, which shows data of contenttype model, so instead of real 
> objects, I see content_type and object_id fields. I can exclude these 
> fields - this is not a problem, but also I want to get real current object 
> as selected with other Places in a dropdown list. Could anyone tell me, 
> how can I do this?
>
>
> Model:
>
> class Criterias(models.Model):
> name = ...
> class Places(models.Model):
> name = ...
> class PlacesToCriterias(models.Model):
> content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
> object_id = models.PositiveIntegerField()
> content_object = GenericForeignKey()
>
> criteria_group = models.ForeignKey(Criterias)
>
> Admin:
>
> class CriteriaPlacesInlineAdmin(admin.TabularInline):
> model = PlacesToCriterias
> class CriteriasAdmin(admin.ModelAdmin):
> inlines = [CriteriaPlacesInlineAdmin]
>
> admin.site.register(Criterias, CriteriasAdmin)
>
> I can add to CriteriaPlacesInlineAdmin a form, something like:
>
> class CriteriaPlacesChoicesFieldForm(forms.ModelForm):
> places = forms.ModelChoiceField(PlaceTypesGroups.objects.all(), 
> label='place')
>
> but how can I pass\add object_id to this form\query in order to get 
> 'selected' place in the dropdown list?
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b326e345-9682-45bb-bdd5-63c4c1699900%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Importing contacts from email/social

2016-10-14 Thread M Hashmi
Hi,

Is there a library available to import user contact's list?

If you have some piece of code as reference or a lib please guide.

Regards,
Mudassar

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANoUts7_1BTRcDOTFy1oHUYod2rU_sOZc9fOnin5uDi9RBLSig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


HELP - Writing your first Django app, part 1

2016-10-14 Thread 'Nick Bansal' via Django users
Hi, 

I'm struggling to figure out how to do the following command:

"To create a URLconf in the polls directory, create a file called urls.py. 
Your app directory should now look like:"

How do I create a file called urls.py in the app directory? am I missing 
something completely obvious?

Any help would be appreciated

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4ca2fd83-cf96-45d6-9fd1-5721de06247c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: HELP - Writing your first Django app, part 1

2016-10-14 Thread Asad Jibran Ahmed
Just create a new file in whatever text editor you're using (I suggest
Sublime Text if you're looking for options) and save the file as urls.py
inside the polls directory.

Asad Jibran Ahmed 
http://blog.asadjb.com

On Fri, Oct 14, 2016 at 8:00 PM, 'Nick Bansal' via Django users <
django-users@googlegroups.com> wrote:

> Hi,
>
> I'm struggling to figure out how to do the following command:
>
> "To create a URLconf in the polls directory, create a file called urls.py.
> Your app directory should now look like:"
>
> How do I create a file called urls.py in the app directory? am I missing
> something completely obvious?
>
> Any help would be appreciated
>
> --
> 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.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/4ca2fd83-cf96-45d6-9fd1-5721de06247c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BYYaWf%3DCLDViVZMHH_YEWH89jZ%3DyvnWpYQhp07AkXdHr5ChSA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Importing contacts from email/social

2016-10-14 Thread Asad Jibran Ahmed
That would depend on the source of the contacts. Do you want contacts from
the users phone? I think those are in the vCard format, so you'll need a
library to read that. If you're looking for something like importing
contacts from Gmail, LinkedIn, etc, there are libraries for each of those
sources as well.

What's your source?

Asad Jibran Ahmed 
http://blog.asadjb.com

On Fri, Oct 14, 2016 at 7:41 PM, M Hashmi  wrote:

> Hi,
>
> Is there a library available to import user contact's list?
>
> If you have some piece of code as reference or a lib please guide.
>
> Regards,
> Mudassar
>
> --
> 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.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CANoUts7_1BTRcDOTFy1oHUYod2rU_
> sOZc9fOnin5uDi9RBLSig%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BYYaWet3gb3SZHGz0uJxm7tD4RmH%2BqA0LCUywKf3-0a1pHJYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: HELP - Writing your first Django app, part 1

2016-10-14 Thread Vineet Kothari
Inside your app create a file name filename.py you can create any file so
on .as you will proceed further you get the idea .
On Oct 14, 2016 10:11 PM, "Asad Jibran Ahmed"  wrote:
>
> Just create a new file in whatever text editor you're using (I suggest
Sublime Text if you're looking for options) and save the file as urls.py
inside the polls directory.
>
> Asad Jibran Ahmed 
> http://blog.asadjb.com
>
> On Fri, Oct 14, 2016 at 8:00 PM, 'Nick Bansal' via Django users <
django-users@googlegroups.com> wrote:
>>
>> Hi,
>>
>> I'm struggling to figure out how to do the following command:
>>
>> "To create a URLconf in the polls directory, create a file
called urls.py. Your app directory should now look like:"
>>
>> How do I create a file called urls.py in the app directory? am I missing
something completely obvious?
>>
>> Any help would be appreciated
>>
>> --
>> 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.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/4ca2fd83-cf96-45d6-9fd1-5721de06247c%40googlegroups.com
.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CA%2BYYaWf%3DCLDViVZMHH_YEWH89jZ%3DyvnWpYQhp07AkXdHr5ChSA%40mail.gmail.com
.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAAcansuahL51S8O_23cJ1aT1WfO7UsyTpuemVaaub9WB8Yp-bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: HELP - Writing your first Django app, part 1

2016-10-14 Thread 'Nick Bansal' via Django users
I tried to create a new file (im using sublime text) but it just gave me a 
new tab...

How do I create a new file in an app?

On Friday, 14 October 2016 17:41:43 UTC+1, Asad Jibran Ahmed wrote:
>
> Just create a new file in whatever text editor you're using (I suggest 
> Sublime Text if you're looking for options) and save the file as urls.py 
> inside the polls directory.
>
> Asad Jibran Ahmed >
> http://blog.asadjb.com
>
> On Fri, Oct 14, 2016 at 8:00 PM, 'Nick Bansal' via Django users <
> django...@googlegroups.com > wrote:
>
>> Hi, 
>>
>> I'm struggling to figure out how to do the following command:
>>
>> "To create a URLconf in the polls directory, create a file called urls.py. 
>> Your app directory should now look like:"
>>
>> How do I create a file called urls.py in the app directory? am I missing 
>> something completely obvious?
>>
>> Any help would be appreciated
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/4ca2fd83-cf96-45d6-9fd1-5721de06247c%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/512287a4-e411-4438-b131-38ab9ffad239%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to replace content_type and object_id fields by a field with actual object in admin inline?

2016-10-14 Thread Anton Ponomarenko


Found solution.


Add form to admin.TabularInline:

class CriteriaPlacesInlineAdmin(admin.TabularInline):
model = PlacesToCriterias
form = CriteriaPlacesChoicesFieldForm  # <- ADDED FORM
class CriteriasAdmin(admin.ModelAdmin):
inlines = [CriteriaPlacesInlineAdmin]

admin.site.register(Criterias, CriteriasAdmin)


Form:

class CriteriaPlacesChoicesFieldForm(forms.ModelForm):
ct_place_type = ContentType.objects.get_for_model(PlaceTypesGroups)

object_id = forms.ModelChoiceField(PlaceTypesGroups.objects.all(), 
label='places')
content_type = forms.ModelChoiceField(ContentType.objects.all(), 
initial=ct_place_type, widget=forms.HiddenInput())

def clean_object_id(self):
return self.cleaned_data['object_id'].pk

def clean_content_type(self):
return self.ct_place_type

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6dd8a54-07f2-45b6-89bc-e92b1c56%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add\get data in admin via reversed relation using GenericTabularInline?

2016-10-14 Thread Anton Ponomarenko
If anyone needs to get dropdown list with selected object, instead of 
content_type and object_id fields, the solution is here 
.

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/37a2b4a9-1092-4df6-85c8-d086e08df7d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Forbidden fix

2016-10-14 Thread Ricardo Prado
Hi Mike!

Are you using SSL certificate?
What's your SO? Ubuntu, Debian, Win?
Please get apache log, you can found this in typing:

cat /etc/var/log/apache2/error.log (if ubuntu or debian)

and type this an copy and past the permission:

stat -c "%n %a" /substance/wsds/7291

check in octal permissions,

I'm waiting you reply



Em quinta-feira, 13 de outubro de 2016 04:47:58 UTC-3, Mike Dewhirst 
escreveu:
>
> I have two similar servers behaving differently. This is the staging 
> server ... 
>
> You don't have permission to access /substance/wsds/7291/ on this server. 
>
> The production server is fine running Ubuntu 14.04 and Apache 2.2. The 
> difference is that I have just upgraded staging to Ubuntu 16.04 and 
> Apache 2.4. 
>
> The new problem resulting from the upgrade was that the Apache redirect 
> from http on port 80 to https on port 443 was failing occasionally. 
>
> That occasion was in the Django Admin when clicking (View on site) 
>
> The fix is to adjust get_absolute_url() so it always specifies https 
>
> Hope this helps someone. 
>
> Cheers 
>
> Mike 
>
>
>
>
>
>
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4a0c878d-adc2-4f2b-9401-9de04f868217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Anyone using settings.TIME_ZONE=None? (considering remove support for it)

2016-10-14 Thread Tim Graham
I'm not sure if there's a compelling use case for settings.TIME_ZONE=None 
these days. If you're using it, could you please describe your use case on 
the django-developers 
thread: 
https://groups.google.com/d/topic/django-developers/OAV3FChfuPM/discussion 
Thanks!

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/646c7d2c-6835-4a28-ad58-306a45431a7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: HELP - Writing your first Django app, part 1

2016-10-14 Thread Asad Jibran Ahmed
Just save the file inside the *poll *folder. That creates the file.

Asad Jibran Ahmed 
http://blog.asadjb.com

On Fri, Oct 14, 2016 at 9:55 PM, 'Nick Bansal' via Django users <
django-users@googlegroups.com> wrote:

> I tried to create a new file (im using sublime text) but it just gave me a
> new tab...
>
> How do I create a new file in an app?
>
> On Friday, 14 October 2016 17:41:43 UTC+1, Asad Jibran Ahmed wrote:
>>
>> Just create a new file in whatever text editor you're using (I suggest
>> Sublime Text if you're looking for options) and save the file as urls.py
>> inside the polls directory.
>>
>> Asad Jibran Ahmed 
>> http://blog.asadjb.com
>>
>> On Fri, Oct 14, 2016 at 8:00 PM, 'Nick Bansal' via Django users <
>> django...@googlegroups.com> wrote:
>>
>>> Hi,
>>>
>>> I'm struggling to figure out how to do the following command:
>>>
>>> "To create a URLconf in the polls directory, create a file called
>>> urls.py. Your app directory should now look like:"
>>>
>>> How do I create a file called urls.py in the app directory? am I missing
>>> something completely obvious?
>>>
>>> Any help would be appreciated
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/4ca2fd83-cf96-45d6-9fd1-5721de06247c%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/512287a4-e411-4438-b131-38ab9ffad239%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BYYaWeg__%3DN2az--7iSYMSwJfYPuwSEjS8k_A2KpKGBKX3zTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


NoReverseMatch Error using Django + Haystack + Elasticsearch

2016-10-14 Thread Aline C. R. Souza
Hello everybody,

I am having a issue using Django + Haystack + Elasticsearch to perform a 
website search.

I made a question on StackOverflow, but I had no satisfatory answer.

The problem is in this line:

by {{ post.author 
}}

post.author.pk works well when called by several views, but it is not 
resolved when called by the search.

There is another way to get the pk of the author of the post?

The link of the StackOverflow question: 
http://stackoverflow.com/questions/40033039/noreversematch-error-using-haystack-elasticsearch

Can someone help me? Please explain in details, because I am new in Django, 
and in haystack, elasticsearch...


-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fb151afb-35a8-4ac4-a9e4-69f4419568c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Importing contacts from email/social

2016-10-14 Thread M Hashmi
I was hoping to find a combine platform where at least variables are same
for POP/IMAP mail servers such as hotmail, yahoo, gmail and few others.
Idea is to let user import their contacts.

*Between congrats on success for your new book "Django Project Blueprints"
as it is been part of curriculum by two IT institutes known to me those
teach Django. I am reading it and its nice. *

If there is combine platform I would use that lib due to timing constraints
coz stuck in work.

Thanks,
Regards,
Mudassar

On Fri, Oct 14, 2016 at 9:42 AM, Asad Jibran Ahmed 
wrote:

> That would depend on the source of the contacts. Do you want contacts from
> the users phone? I think those are in the vCard format, so you'll need a
> library to read that. If you're looking for something like importing
> contacts from Gmail, LinkedIn, etc, there are libraries for each of those
> sources as well.
>
> What's your source?
>
> Asad Jibran Ahmed 
> http://blog.asadjb.com
>
> On Fri, Oct 14, 2016 at 7:41 PM, M Hashmi  wrote:
>
>> Hi,
>>
>> Is there a library available to import user contact's list?
>>
>> If you have some piece of code as reference or a lib please guide.
>>
>> Regards,
>> Mudassar
>>
>> --
>> 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.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CANoUts7_1BTRcDOTFy1oHUYod2rU_sOZc9fOnin5uD
>> i9RBLSig%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CA%2BYYaWet3gb3SZHGz0uJxm7tD4RmH%
> 2BqA0LCUywKf3-0a1pHJYA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANoUts5VVq357gQhVJQX6hPHeJA4CD61tFiASpasMCiBcFmkmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Importing contacts from email/social

2016-10-14 Thread Asad Jibran Ahmed
Thanks! It's nice to hear my book is useful to someone out there! :)

Back to your question, have you tried this:
https://github.com/mengu/django_contact_importer

Asad Jibran Ahmed 
http://blog.asadjb.com

On Sat, Oct 15, 2016 at 2:25 AM, M Hashmi  wrote:

>
> I was hoping to find a combine platform where at least variables are same
> for POP/IMAP mail servers such as hotmail, yahoo, gmail and few others.
> Idea is to let user import their contacts.
>
> *Between congrats on success for your new book "Django Project Blueprints"
> as it is been part of curriculum by two IT institutes known to me those
> teach Django. I am reading it and its nice. *
>
> If there is combine platform I would use that lib due to timing
> constraints coz stuck in work.
>
> Thanks,
> Regards,
> Mudassar
>
> On Fri, Oct 14, 2016 at 9:42 AM, Asad Jibran Ahmed 
> wrote:
>
>> That would depend on the source of the contacts. Do you want contacts
>> from the users phone? I think those are in the vCard format, so you'll need
>> a library to read that. If you're looking for something like importing
>> contacts from Gmail, LinkedIn, etc, there are libraries for each of those
>> sources as well.
>>
>> What's your source?
>>
>> Asad Jibran Ahmed 
>> http://blog.asadjb.com
>>
>> On Fri, Oct 14, 2016 at 7:41 PM, M Hashmi  wrote:
>>
>>> Hi,
>>>
>>> Is there a library available to import user contact's list?
>>>
>>> If you have some piece of code as reference or a lib please guide.
>>>
>>> Regards,
>>> Mudassar
>>>
>>> --
>>> 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.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/CANoUts7_1BTRcDOTFy1oHUYod2rU_sOZc9fOnin5uD
>>> i9RBLSig%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> 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.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CA%2BYYaWet3gb3SZHGz0uJxm7tD4RmH%2BqA0LCUyw
>> Kf3-0a1pHJYA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CANoUts5VVq357gQhVJQX6hPHeJA4C
> D61tFiASpasMCiBcFmkmA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BYYaWe9LJwskRc%3DZ85VtuHbgSiqDa%3DsMOb9mGq-HX8DqudLTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Importing contacts from email/social

2016-10-14 Thread M Hashmi
This is outdated but let me see if I can port it to upgraded version and
make it useful for others as well.

Thanks,

Regards,
Mudassar

On Fri, Oct 14, 2016 at 3:37 PM, Asad Jibran Ahmed 
wrote:

> Thanks! It's nice to hear my book is useful to someone out there! :)
>
> Back to your question, have you tried this: https://github.com/
> mengu/django_contact_importer
>
> Asad Jibran Ahmed 
> http://blog.asadjb.com
>
> On Sat, Oct 15, 2016 at 2:25 AM, M Hashmi  wrote:
>
>>
>> I was hoping to find a combine platform where at least variables are same
>> for POP/IMAP mail servers such as hotmail, yahoo, gmail and few others.
>> Idea is to let user import their contacts.
>>
>> *Between congrats on success for your new book "Django Project
>> Blueprints" as it is been part of curriculum by two IT institutes known to
>> me those teach Django. I am reading it and its nice. *
>>
>> If there is combine platform I would use that lib due to timing
>> constraints coz stuck in work.
>>
>> Thanks,
>> Regards,
>> Mudassar
>>
>> On Fri, Oct 14, 2016 at 9:42 AM, Asad Jibran Ahmed 
>> wrote:
>>
>>> That would depend on the source of the contacts. Do you want contacts
>>> from the users phone? I think those are in the vCard format, so you'll need
>>> a library to read that. If you're looking for something like importing
>>> contacts from Gmail, LinkedIn, etc, there are libraries for each of those
>>> sources as well.
>>>
>>> What's your source?
>>>
>>> Asad Jibran Ahmed 
>>> http://blog.asadjb.com
>>>
>>> On Fri, Oct 14, 2016 at 7:41 PM, M Hashmi  wrote:
>>>
 Hi,

 Is there a library available to import user contact's list?

 If you have some piece of code as reference or a lib please guide.

 Regards,
 Mudassar

 --
 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.com.
 To post to this group, send email to django-users@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit https://groups.google.com/d/ms
 gid/django-users/CANoUts7_1BTRcDOTFy1oHUYod2rU_sOZc9fOnin5uD
 i9RBLSig%40mail.gmail.com
 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> --
>>> 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.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/CA%2BYYaWet3gb3SZHGz0uJxm7tD4RmH%2BqA0LCUyw
>>> Kf3-0a1pHJYA%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> 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.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CANoUts5VVq357gQhVJQX6hPHeJA4CD61tFiASpasMC
>> iBcFmkmA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CA%2BYYaWe9LJwskRc%3DZ85VtuHbgSiqDa%3DsMOb9mGq-
> HX8DqudLTg%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Dj

Re: Django and Lynda.com

2016-10-14 Thread Paul Handley
I figured it out. For some reason the presenter did not add the name of the 
app at the end of the makemigrations command. I did exactly like he did and 
got the wrong result. When I added the name of the app at the end 
everything functioned normally. With Jayne.com you are flying blind. There 
is no one to help you understand if the presenter makes a mistake. I'm 
looking around fr another site that is more user-friendly. Thanks a lot for 
your help! 

On Thursday, October 13, 2016 at 9:37:52 PM UTC-4, Paul Handley wrote:
>
> I am taking the Django and Python course on Lynda.com I have been 
> following along, as the presenter shows me how to do it. I have downloaded 
> and installed Python and Django; created my first project and first app. 
> When I the presenter showed how to make a first "migration" by typing 
> "python manage.py makemigrations" his computer terminal showed success in 
> that a file called "initial.py was created. When I tried this at my 
> terminal all I got was "No changes detected" I looked in file explorer to 
> see if the file was created anyway, it wasn't.
>
> If I have done everything correctly( and I have) why is this not working?
>
> Thanks,
> Paul
>

-- 
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.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f235a99a-e47e-4ea4-8a93-2fb8b8712657%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.