Re: Django rest framework cannot deal with multple objects in model viewset

2017-04-20 Thread Xavier Ordoquy
> Le 21 avr. 2017 à 04:17, Robin Lery a écrit : > > I have a very simple model and its related serializer and views: > > class Page(models.Model): > user = models.ForeignKey(User) > title = models.CharField(max_length=255) > pub_date =

Re: it says there is no module django when im trying to configure urls. please help

2017-04-20 Thread pradam programmer
Hi Anusha, Make sure django is package is installed. On Fri, Apr 21, 2017 at 3:15 AM, sri anusha wrote: > C:\Users\srian\AppData\Local\Programs\Python\Python36\python.exe > C:/Users/srian/internship/polls/urls.py > Traceback (most recent call last): > File

Django rest framework cannot deal with multple objects in model viewset

2017-04-20 Thread Robin Lery
I have a very simple model and its related serializer and views: class Page(models.Model): user = models.ForeignKey(User) title = models.CharField(max_length=255) pub_date = models.DateTimeField(default=timezone.now) class PageSerializer(serializers.ModelSerializer): class Meta:

it says there is no module django when im trying to configure urls. please help

2017-04-20 Thread sri anusha
C:\Users\srian\AppData\Local\Programs\Python\Python36\python.exe C:/Users/srian/internship/polls/urls.py Traceback (most recent call last): File "C:/Users/srian/internship/polls/urls.py", line 1, in from django.conf.urls import url ModuleNotFoundError: No module named 'django' Process

Re: First models.py needs tuning

2017-04-20 Thread Mike Dewhirst
Rich I've run out of time this week. Maybe someone else can help. Mike On 21/04/2017 11:45 AM, Rich Shepard wrote: On Fri, 21 Apr 2017, Mike Dewhirst wrote: In the more usual scenario you specify your models using Python and let the Django ORM framework do the SQL. If that is your case ...

Re: First models.py needs tuning

2017-04-20 Thread Rich Shepard
On Fri, 21 Apr 2017, Mike Dewhirst wrote: In the more usual scenario you specify your models using Python and let the Django ORM framework do the SQL. If that is your case ... Mike, I wrote the schema for postgres but had not created the database. So I renamed the file models.py and

Re: First models.py needs tuning

2017-04-20 Thread Mike Dewhirst
On 21/04/2017 7:48 AM, Rich Shepard wrote: On Wed, 19 Apr 2017, Mike Dewhirst wrote: You probably need a single FK plus a meta option of unique_together https://docs.djangoproject.com/en/1.8/ref/models/options/#unique-together Mike, Okay. What would be the correct syntax for PRIMARY KEY

Re: First models.py needs tuning

2017-04-20 Thread Rich Shepard
On Wed, 19 Apr 2017, Mike Dewhirst wrote: You probably need a single FK plus a meta option of unique_together https://docs.djangoproject.com/en/1.8/ref/models/options/#unique-together Mike, Okay. What would be the correct syntax for PRIMARY KEY unique_together=('company', 'person',

How can i add one point to user after to press the button?

2017-04-20 Thread Mike Ru
I have Model. class UserProfile(models.Model): user = models.OneToOneField(User, related_name='userprofile') points = models.IntegerField(default=0) city = models.CharField(max_length=30, blank=True) about = models.TextField(blank=True) avatar =

Reporting issue with MultiWidget

2017-04-20 Thread Anaël Megna
Hello! I think I have found out a issue in Django's source code. I am trying to build a "Select or New" form field & widget, used by a ModelForm. The goal of this field is the following: - I have a model ProductType, "defined by" a label only; - I have a model Product with a Foreign Key to

Using Django with groupby

2017-04-20 Thread Will Holmes
Hi guys, I am using django to develop a calendar web app where users can create events that are then displayed on a month by month view. I have written a custom template tag that takes Python's HTMLCalendar formatmonth function and overlays events that are on that day. It is currently

Re: Django forks

2017-04-20 Thread Jamesie Pic
Thank you my friend ! Best Jamesie <3 -- 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

RE: Django forks

2017-04-20 Thread Matthew Pava
Hi Jamesie, I understand what you want, and I agree, in essence, that the fields should just be useable out of the box. I was just providing an alternative suggestion to creating a whole new fork of Django and if not that, at least some inspiration for what you want to include in that fork.

Re: Django forks

2017-04-20 Thread Jamesie Pic
Hi all, Those of you who use some of my apps know that I don't put inline javascript code ever in fields, for the reason that it's known to slow page rendering. Also, it isn't known to help maintainability nor re-usability. That Django provides this as the only way does not invalidates that.

Re: send email with django

2017-04-20 Thread Christian Ledermann
try https://www.mailgun.com if you don't want to host your own smtp server On 20 April 2017 at 09:57, Antonis Christofides wrote: > You might also want to read this article of mine, which might give you lots > of ideas about what could be wrong: Why does Django not

Re: Alternative to celery

2017-04-20 Thread Avraham Serour
try googling 'python task queue' see https://www.fullstackpython.com/task-queues.html On Thu, Apr 20, 2017 at 12:25 PM, Andréas Kühne wrote: > I don't know anything about the python-rq stuff - however redis can be > configured to save to disk (see

Re: Dynamic Selector with Django/Jquery

2017-04-20 Thread Melvyn Sopacua
On Saturday 15 April 2017 17:31:50 Anonymous Coder wrote: > I need to filter lists of items to be displayed upon user selection in > my list view. > For instance if user selects 12 it should show only 12 products per > page and so on. For this specific issue:

Re: I can't understand this NoReverseMatch

2017-04-20 Thread Melvyn Sopacua
Hi, On Thursday 20 April 2017 13:49:48 phep wrote: > 8< > NoReverseMatch at /saule/taiga/import/1/display > > Reverse for 'display_taiga_report' with arguments '()' and keyword > arguments > > '{'report_id': '1', 'option': 'error_view'}' because underscore > >

Re: I can't understand this NoReverseMatch

2017-04-20 Thread phep
Sorry for the noise, guys, always the same song... Why this stupid errors never show up before you hit "send" Le 20/04/2017 à 13:49, phep a écrit : Hi all, I just got this (slightly reformated for readability) exception I really can't explain: 8< NoReverseMatch at

Re: Django forks

2017-04-20 Thread Melvyn Sopacua
On Monday 17 April 2017 16:37:19 Matthew Pava wrote: > Django 1.11 made a major change to widget rendering. I am wondering > if this would help you significantly in your quest. The widget is > rendered with a template. It would seem you could include the > JavaScript in that template. You

I can't understand this NoReverseMatch

2017-04-20 Thread phep
Hi all, I just got this (slightly reformated for readability) exception I really can't explain: 8< NoReverseMatch at /saule/taiga/import/1/display Reverse for 'display_taiga_report' with arguments '()' and keyword arguments '{'report_id': '1', 'option': 'error_view'}' not

Re: Alternative to celery

2017-04-20 Thread Andréas Kühne
I don't know anything about the python-rq stuff - however redis can be configured to save to disk (see https://redis.io/topics/persistence) - so you wouldn't loose anything on a power-failure (if configured correctly). Redis is so much more than a cache nowadays. Regards, Andréas 2017-04-20

Alternative to celery

2017-04-20 Thread guettli
Some years ago I used celery for a project. Today I face roughly the same use case again. The last time I used it, celery felt to heavy weighted, too complicated. I found this alternative: http://python-rq.org/ There are two things which speak agains python-rq: - redis is a cache. I need a

Re: send email with django

2017-04-20 Thread Antonis Christofides
You might also want to read this article of mine, which might give you lots of ideas about what could be wrong: Why does Django not email me the 500 internal server error? Regards, A. Antonis