parent: [ 'Invalid pk "0" - object does not exist.' ]

2016-05-31 Thread L K Singh


class AccountTypeSerializer(serializers.ModelSerializer):
parent = 
serializers.PrimaryKeyRelatedField(queryset=AccountType.objects.all(), 
required=False)
class Meta:
model = AccountType
fields = ('id','parent','account_type_name')

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/2d852ff7-9932-4018-a15e-476b46ead394%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


missing feature, View permission for django admin

2016-05-31 Thread Ander Ustarroz
I am surprised this feature is not implemented yet, at the moment when we 
create a new model  three permissions are created automatically for the 
admin panel:

   - *add_permission*
   - *change_permission*
   - 
*delete_permission *

We really missing the *view_permission* here, when we want staff to be able 
to see the content but not being able to modify it. Searching a bit,  you 
can find many different implementations to achieve this, but all of them 
are extending django.contrib.*admin.**ModelAdmin*. Having so many people 
rewriting these methods in my opinion is a clear sign that this feature 
should be part of the core. 

Regards,

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d6016b31-4369-4962-90b6-736f1162395f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: missing feature, View permission for django admin

2016-05-31 Thread Tim Graham
This feature is tracked in https://code.djangoproject.com/ticket/8936. Feel 
free to review, contribute to, or test the patch if you want to help.

On Tuesday, May 31, 2016 at 8:26:41 AM UTC-4, Ander Ustarroz wrote:
>
> I am surprised this feature is not implemented yet, at the moment when we 
> create a new model  three permissions are created automatically for the 
> admin panel:
>
>- *add_permission*
>- *change_permission*
>- 
> *delete_permission *
>
> We really missing the *view_permission* here, when we want staff to be 
> able to see the content but not being able to modify it. Searching a bit, 
>  you can find many different implementations to achieve this, but all of 
> them are extending django.contrib.*admin.**ModelAdmin*. Having so many 
> people rewriting these methods in my opinion is a clear sign that this 
> feature should be part of the core. 
>
> Regards,
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/cfe9b399-2486-4dff-97e6-1c3f94b13f65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: parent: [ 'Invalid pk "0" - object does not exist.' ]

2016-05-31 Thread Tim Graham
Sorry, but this post without any explanation doesn't help much. 

For usage questions, please use the django-users mailing list. To report 
bugs, use https://code.djangoproject.com/.

On Tuesday, May 31, 2016 at 8:26:41 AM UTC-4, L K Singh wrote:
>
> class AccountTypeSerializer(serializers.ModelSerializer):
> parent = 
> serializers.PrimaryKeyRelatedField(queryset=AccountType.objects.all(), 
> required=False)
> class Meta:
> model = AccountType
> fields = ('id','parent','account_type_name')
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/0b4841b8-5302-479b-b3e7-48ad36ea12f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DjangoCon US 2016

2016-05-31 Thread Tim Allen
Just a reminder the today is the last day to register for DjangoCon at 
Early Bird rates. Tomorrow, prices will increase by $50 per ticket. To 
register, click here:

https://2016.djangocon.us/tickets/

Prices are affordable for the 5 days, starting at $195 for our diversity 
rate. The speakers lineup has been announced, and has something for 
everyone, whether you're a seasoned Django developer, just dipping your toe 
in the pool, or not a developer at all. There should be some familiar names 
on the list. :) I've included a full list of talks below. We sincerely hope 
you can make it. Feel free to email me off-list with any questions you may 
have.

Regards,

Tim

---

TALK LIST:

A new look into APIs - Graphene (Syrus Akbary)
It Is Darkest Before Dawn: Alcoholism and Addiction in Tech (Timothy Allen)
The impact of women learning to code in developing countries: benefits and 
challenges. (Aisha Bello & Ibrahim Diop)
Full Auto Django: scaling and HA with Docker, Kubernetes and Atomic (Josh 
Berkus)
Happy Asset Deployments with Webpack & Django (Scott Burns)
Git in Control, Version Control and How it Could Save Your Life (Rachell 
Calhoun)
The Fraud Police are Coming: Work, Leadership, and Imposter Syndrome 
(Amanda Clark & Briana Morgan)
Websockets: Intro to messaging. (Josue Balandrano Coronel)
High-Availability Django (Frankie Dintino)
Building Dynamic Dashboards with Django and D3 (Clinton Dreisbach)
Beyond PO: How to make Django work for right-to-left languages (Cho Garcia 
& Payam)
Solving problems with Django Forms. (Kirt Gittens)
I Didn’t Know QuerySets Could Do That (Charlie Guo)
Geospatial Analysis with GeoDjango (Don Holloway)
SSL all the things (Markus Holtermann)
An Intro To Web Accessibility In Django (Annalee Flower Horne)
Readability Counts (Trey Hunner)
People are coming to my beginning workshop, what now? (Nicholle James)
Frog and Toad Learn About Django Security (Philip James)
Things your mother didn’t teach you about sharing your toys (Russell 
Keith-Magee)
This Old Pony: Working with Legacy Django Apps (Ben Lopatin)
Walking Down the A11y Road - Lessons Learnt from Working on Accessibility 
of a Django Project (Radina Matic)
Django and React: Perfect Together (Jack McCloy)
Stress Testing your Code of Conduct in Production (Baptiste Mispelon & Ola 
Sendecka)
Django Supporting Virtual Reality Game Development (Rudy Mutter)
Django, Python, and Health Care Data (Becca Nock)
>From Developer to Manager (Sean O’Connor)
Dispelling the ‘Genius Programmer’ Myth Through Code Review (Ashwini 
Oruganti)
Design for Non-Designers (Tracy Osborn)
Rub-a-Dub Rubber Duck: Don’t Be Afraid to Debug! (Anna Ossowski)
The City as Cyborg: a history of Civic Tech in the first quarter of the 
21st Century (Mjumbe Poe)
The Full Stack of User Experience (Alicia C. Raciti)
Spicing up Django: An introduction to Mezzanine CMS (Ed Rivas)
MBaaS Framework: Built with Django & Django REST Framework (Kartikeya Rokde)
Healthy Minds in a Healthy Community (Erik Romijn)
Building JSON APIs with Django / Pinax (Brian Rosner)
How We Used NLP and Django to Build a Movie Suggestion Website & Twitterbot 
(Vince Salvino)
Django for IoT: From hackathon to production (Anna Schneider)
Angular 2 and You (Pam Selle)
Pushing the Pony’s boundaries — Django Admin Customization (Ola Sitarska)
Sign Me Up - Choosing & using a registration package for your Django 
project (Eleanor Stribling)
Just Enough Typography (Joni Trythall)
Under the Hood of Modern CSS Frameworks (Michael Trythall)
Atomic Wagtail (Kurt Wall)
Making the most Out of Code Reviews (Mariatta Wijaya)
Entomology 101: Effective Bug Hunting (Frank Wiles)

On Wednesday, March 23, 2016 at 11:58:25 AM UTC-4, Andrew Pinkham wrote:
>
> We are pleased to announce that DjangoCon US will be hosted by the Wharton 
> School at the University of Pennsylvania in Philadelphia from July 17-22!
>
> We are looking for suggestions about topics that you would like to see at 
> DjangoCon. If you have a suggestion, please add it to this gist document 
> .
>
> The call for proposals is open! 
>  We want 
> to hear about your experience with and around Django. However, talks: 
>
> - Don't need to be about Django specifically
> - Don't need to be 100% fleshed out.
> - Don't need to be about software directly
> - Don't need to be advanced
>
> Apply now! The deadline is April 18th. 
> 
>
> Never spoken before? Not a problem! There are speaker mentors that will 
> help you (see the link above).
>
> Is cost a concern? Not a problem! Apply for financial aid (deadline April 
> 25th). 
>
> You can follow all the latest on Twitter .
>
> Hope to see you in Philly!
>
> Andrew
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributi

ModelSignals with abstract senders

2016-05-31 Thread Alexander Hill
Hi all, currently when a model signal receiver is registered with an
abstract model as the sender, we allow it even though the receiver will
never be called. It would be nice if the signal registry wasn't polluted by
bogus entries that will never be used.

A few options:

a) Make passing an abstract model to a ModelSignal a no-op, and document
that behaviour. (And possibly: add a return value to ModelSignal.connect()
like we have for disconnect(), and return False when an abstract model is
passed as a sender)

b) Raise a warning, and make it the user's responsibility to check if a
model is abstract before registering it as a sender.

c) Allow it, and make ModelSignal respect inheritance, so that you can
specify a superclass as a sender and the receiver will be called for all
its subclasses, perhaps controlled by an argument to connect().

Perfectly reasonable code like that in django-model-utils [1] does this, so
I don't think it warrants a warning. My inclination is to go with (a).

Cheers,
Alex

[1]
https://github.com/carljm/django-model-utils/blob/c94b65d05f4acd0437a22ef498a80470922a438a/model_utils/fields.py#L106

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CA%2BKBOKzAbyejrwgNrU9r_H3M5B%3D5gJSkxbBr90BxtdUg-91sZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.