Re: Custom Template Tag

2016-09-01 Thread Constantine Covtushenko
Hi All, There is no valuable reason to do it in the template. And no matter how to ate using it, cause template should only present view model(s). But if you tell us your intention may be we can suggest a better place for such request? Regards, On Sep 2, 2016 6:03 AM, "Al Johri"

Re: Custom Template Tag

2016-09-01 Thread Al Johri
Ludovic, I'm using the templates for a different purpose, not in a web framework or view. Thanks, Al On Thursday, September 1, 2016 at 8:09:29 AM UTC-4, ludovic coues wrote: > > I wouldn't do it this way. > Personally, I would make the POST request in the view function, put > the return

[ANNOUNCE] Django bugfix release issued: 1.10.1

2016-09-01 Thread Tim Graham
Details are available on the Django project weblog: https://www.djangoproject.com/weblog/2016/sep/01/bugfix-release/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: How to Let a User add a Video not a image as a post?

2016-09-01 Thread Mike Dewhirst
On 2/09/2016 12:53 AM, djangorobert wrote: I have researched this issue with django for years now and seems that no body in the django community knows how to do this which is a suprise because there are many smart people but not one has been able to solve this mystery? What i'm aiming for

Re: Signal handling when deleting lots of objects?

2016-09-01 Thread Stodge
Thanks Erik. I forgot to say that the Group model has an "active" flag on it, so I'm seeing if I can use this. On Thursday, 1 September 2016 14:55:05 UTC-4, Erik Cederstrand wrote: > > > > Den 1. sep. 2016 kl. 20.14 skrev Stodge : > > > > > I have two models, Volume and

Re: Signal handling when deleting lots of objects?

2016-09-01 Thread Erik Cederstrand
> Den 1. sep. 2016 kl. 20.14 skrev Stodge : > > I have two models, Volume and Group. The Volume model has a foreign key to > Group. > > When a user deletes a Volume the post_delete signal handler sends an HTTP > DELETE request (/volume) to another server process. This works

Signal handling when deleting lots of objects?

2016-09-01 Thread Stodge
I have two models, Volume and Group. The Volume model has a foreign key to Group. When a user deletes a Volume the post_delete signal handler sends an HTTP DELETE request (/volume) to another server process. This works great. However, when the user deletes a Group, the cascading delete also

Project time and expense tracking

2016-09-01 Thread Rich Shepard
Before I re-invent the wheel, does anyone know of an existing django project time and expense application using sqlite3? Now and then a client needs to be invoiced by time and expense rather than a flat rate. My financial software is supposed to do this, but I've never been able to convert

Re: Filtering models by user or by items

2016-09-01 Thread Shamaila Moazzam
@ Mudassar .Thanx for your reply but this query is not working. On Thursday, September 1, 2016 at 8:58:53 PM UTC+5, M Hashmi wrote: > > What did you get with: > products = Product.objects.filter(account=user) > As it is inheriting user from get_shopaccount method. > > Regards, > Mudassar > > On

Re: Filtering models by user or by items

2016-09-01 Thread M Hashmi
What did you get with: products = Product.objects.filter(account=user) As it is inheriting user from get_shopaccount method. Regards, Mudassar On Thu, Sep 1, 2016 at 8:45 AM, Shamaila Moazzam wrote: > am making a shops dashboard view .in that view i have used a

Filtering models by user or by items

2016-09-01 Thread Shamaila Moazzam
am making a shops dashboard view .in that view i have used a mixin as mentioned belowmy issue is i want to get products related to a specific account or user . i have products m2m in shop model and also have user f.k in Shop model. In get_shopproducts() function in ShopAccountMixin()..i am

Reading an Uploaded File in a Django 1.9 Model

2016-09-01 Thread Lior Kofman
I am very new to Django, but have been using Python since the beginning of the year. I am having trouble opening and reading a text file, and when I use the shell to see what is going on, it prints: <_io.TextIOWrapper name='edt.txt' mode='r' encoding='UTF-8'> Here is my code: from

Re: How to create a database for my website in Django

2016-09-01 Thread djangorobert
a quick fix would be to just get an account with pythonanywhere.com its a cloud computing or a saas for python users lets you create your app and gives you a mysql database automatically On Tuesday, August 30, 2016 at 6:18:08 PM UTC-5, Jeff Goes wrote: > > I have little knowledge when it comes

How to Let a User add a Video not a image as a post?

2016-09-01 Thread djangorobert
I have researched this issue with django for years now and seems that no body in the django community knows how to do this which is a suprise because there are many smart people but not one has been able to solve this mystery? What i'm aiming for is to let a user upload a vido format and

Re: Disadvantages of using model name rather than model class for FK field?

2016-09-01 Thread James Beith
Yeah you're right about the development tools and being quicker for refactoring and alike. I believe typos will be caught when running `makemigrations` at least as it will complain about not being about to find the model. On Thursday, 1 September 2016 13:39:31 UTC+1, Javier Guerra wrote: > >

Re: Pygame

2016-09-01 Thread M Hashmi
Lets divide the answer in two different segments knowledge and information. 1. Information: No you cannot. 2.Knowledge: Every framework works with basic request based structure comprising on requests of GET and POST. When you are interacting with a website from browser all that is working at

Re: Disadvantages of using model name rather than model class for FK field?

2016-09-01 Thread ludovic coues
Class might be easier to use for beginner and is explicit. There is an import, you know what you are dealing with and you get clear error when you do things wrong. If you have circular depencencies, using model name can be the only solution. If you have model A with a foreign key on model B and

Re: Disadvantages of using model name rather than model class for FK field?

2016-09-01 Thread Javier Guerra Giraldez
On 1 September 2016 at 11:55, James Beith wrote: > By using a model name there are fewer imports at the top of the module and > fewer occurrences of circular import dependencies between Django > applications. What are the disadvantages to using a model name and why not > always

Re: Pygame

2016-09-01 Thread ludovic coues
As long as the product of pygame is a python program and not a set of HTML and JS file, django won't help you. The other way can work. You can make HTTP request from pygame to django, to get a list of high score for exemple or a set of instruction in a turn based game, like a move in a chess

Re: I am searching: How to make drop down list in django

2016-09-01 Thread Gergely Polonkai
This very much depends on what exactly want to do, but in general, it doesn’t really Django’s job. Can you produce the desired result in a plain HTML file? If not, you should visit an HTML/CSS tutorial; if yes, you should define your problem a bit better, otherwise we won’t be able to help you.

Pygame

2016-09-01 Thread DB32
Is Django able to support pygame? For example am I able to display somethings made in pygame onto a web page? The pygame will have a lot of different assets, images ect which are imported from my files -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Custom Template Tag

2016-09-01 Thread ludovic coues
I wouldn't do it this way. Personally, I would make the POST request in the view function, put the return value in the context. The template isn't a good place to have logic. It should only take data and format them. 2016-09-01 5:33 GMT+02:00 Al Johri : > Hi Django Users, > >

Re: I am searching: How to make drop down list in django

2016-09-01 Thread ludovic coues
Do you mind to share a bit more of what you are trying to do ? There is a few way to get a dropdown list out of a django form class. https://docs.djangoproject.com/en/1.10/ref/models/fields/#django.db.models.Field.choices is one way to do it, for a specific use case. 2016-09-01 9:26 GMT+02:00

Custom Template Tag

2016-09-01 Thread Al Johri
Hi Django Users, I want to make a custom template tag where the tag's renderer needs to make a POST request. https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/#writing-the-renderer https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/#thread-safety-considerations

I am searching: How to make drop down list in django

2016-09-01 Thread amandeep . tu2015
I trying for last 7 days to search this topic but could not find :( -- 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.

Disadvantages of using model name rather than model class for FK field?

2016-09-01 Thread James Beith
A ForeignKey field is often defined using the class to which the model is related, for example. from django.db import models from authors.models import Author class Post(models.Model): author = models.ForeignKey(Author) Alternatively the model name can be used, rather than the model

Re: Hi, i'm new to django i need some mini project which contain atleast 4 page for go through how it works

2016-09-01 Thread Rajesh Kumar
Thanks Jani Tiainen On Thu, Sep 1, 2016 at 11:30 AM, Jani Tiainen wrote: > There exists a bit more detailed tutorial for Django: > > http://www.marinamele.com/taskbuster-django-tutorial > > On 01.09.2016 08:58, rajeshkmr9583 wrote: > > Hi, > >I have completed the

Re: Hi, i'm new to django i need some mini project which contain atleast 4 page for go through how it works

2016-09-01 Thread Jani Tiainen
There exists a bit more detailed tutorial for Django: http://www.marinamele.com/taskbuster-django-tutorial On 01.09.2016 08:58, rajeshkmr9583 wrote: Hi, I have completed the tutorial my friend and by using the tutorial we are working with admin site only. I'm planning to work with my own