Re: How to save multiple model form in one template?

2018-09-11 Thread Devender Kumar
Hi, I made it more simple and I implemented this also This is a solution is a little different from other solution you have three model form, one view which is rendering all the form. If this is the case or somewhat similar then. simply give *name *attribute to each submit button like: ** and in th

Re: Views & Template issue

2018-09-11 Thread Mikko Meronen
Hi, I still have a small issue here and couldn't figure it out. I want to divide my items based on the time created. The division point is 5 minutes and I want that point to be seen in my webpage. However when I made the division point, Django doesn't update it (the items that become older than 5

Generic method that can take any Django Model and provide information about manytomany field.

2018-09-11 Thread Akshay Gaur
Also posted here : https://stackoverflow.com/questions/52280584/any-way-to-fetch-the-through-fields-for-an-object-linked-via-many2many-field-wit I am trying to write a generic method that can take any Django Model and returns it in a dictionary form. So for example, if my models are defined thu

Re: Django Nested Query with Aggregate.Sum()

2018-09-11 Thread mab . mobile . 01
FINAL SOLUTION / SOLVED A bit of a more complex single query... VIEW def winery_events_view(request): events = WineryEvents.objects.filter(publish='Y').filter(event_date__gte=datetime.now()).order_by('event_date').annotate(seats_remaining = F('seating')-Sum('reservations__seats_reserved')

Re: Different results of running pure SQL query from Django and from PGAdmin

2018-09-11 Thread Bill-Torcaso-Oxfam
I'd be interested to see a printout of 'columns' and 'cursor.description'. One explanation would be that your for-loop is not actually accessing the data that you think it is, or that your query is not actually fetching the data that you think it is. No criticism of your query implied - just

RE: How to get multi form initial data?

2018-09-11 Thread Matthew Pava
You are using a dictionary as your form_class. It should only be one form, as far as I know. I am quite interested to learn how you got the form working by specifying a dictionary. Please review documentation: https://docs.djangoproject.com/en/2.1/topics/class-based-views/generic-editing/ And

Is this URL pattern possible in Django??

2018-09-11 Thread Przemek Kot
Hi I want to make an app and also learn django. Thing is, that I want an url patterns in my application that I don't know are possible, but for sure they are not mentioned in any example I have found. I want something like this: URLs: /APP_NAME/ - open root url of the app (or default) /po

Re: How to publish Django 2 Application using WHM/Cpanel?

2018-09-11 Thread m1chael
use postgresql/nginx/gunicorn/supervisord for django and leave WHM/Wordpress/Cpanel/Apache/MySQL alone On Tue, Sep 11, 2018 at 3:07 AM Sunil Kothiyal wrote: > I think you not understand what i asked. I want to install only one > project for one user. not multiple. > > On Tue, Sep 11, 2018 at 12:

How to get multi form initial data?

2018-09-11 Thread Django Lover
I have the view like this- The form is working good but i issue is not able to get from initial data. PLEASE HELP **formview.py** class AddProfile(LoginRequiredMixin, CreateView): template_name = 'users/add_user_details.html' form_class = { 'contactInformation': ContactInformati

Re: How to publish Django 2 Application using WHM/Cpanel?

2018-09-11 Thread Sunil Kothiyal
I think you not understand what i asked. I want to install only one project for one user. not multiple. On Tue, Sep 11, 2018 at 12:22 PM TimT Vogt wrote: > This Might give Some guidance > https://easyaspython.com/how-to-consolidate-multiple-django-projects-b7c9bb940a59 > > Verstuurd vanaf mijn i