Re: Creating models from json url feed

2018-05-12 Thread Ryan Nowakowski
I'd use a single model for all products from any market then. On Sun, May 13, 2018 at 09:47:32AM +0800, Matt Snelgar wrote: > All of the products will share the same fields. > > I would filter on products, but my searches would only be restricted to one > market at a time. > > On Sun, May 13,

I canot upload files how can i fix it

2018-05-12 Thread carlos . davalos17
views def ArticuloFormA(request,Materiaid): Articulos = Articulo.objects.filter(Materia_id= Materiaid) Articulos = Articulos.order_by('-Fecha_Publicacion')[:5] Pregunta_Form = ArticuloForm() args = {'Pregunta_Form': Pregunta_Form} if request.method == 'POST':

Re: Creating models from json url feed

2018-05-12 Thread Matt Snelgar
All of the products will share the same fields. I would filter on products, but my searches would only be restricted to one market at a time. On Sun, May 13, 2018 at 1:51 AM, Ryan Nowakowski wrote: > > > On May 10, 2018 7:40:47 AM CDT, Matt Snelgar

SQL select statements to Django ORM

2018-05-12 Thread Gerald Brown
As I have said previously, I am new to Django ORM so I would like to know howto/find reference to Django ORM Query to the following SQL Select statements: 1. From Mariadb. SELECT name, date_of_birth, *TIMESTAMPDIFF(YEAR,date_of_birth,'2014-08-02'/or curdate())* AS age FROM some table. 2.

Re: How to make queries using Mysql JSON field and django 2

2018-05-12 Thread Jason
the default jsonfield field type for django is postgres only, but there's support for mysql 5.7 via a third party package https://github.com/adamchainz/django-mysql. specifically https://django-mysql.readthedocs.io/en/latest/model_fields/json_field.html On Friday, May 11, 2018 at 3:30:42 PM

Re: The path to my login template after registration is incorrect, but the path to the registration template in the same directory is correct, I don't understand why.

2018-05-12 Thread Jason
here is no templates folder in the gr_backend package. nor are there any template directories or files in that repository On Saturday, May 12, 2018 at 4:59:28 PM UTC-4, Anthony Orona wrote: > > > I set up user registration by subclassing generic.CreateView in an app > called Accounts. and I

The path to my login template after registration is incorrect, but the path to the registration template in the same directory is correct, I don't understand why.

2018-05-12 Thread Anthony Orona
I set up user registration by subclassing generic.CreateView in an app called Accounts. and I then set up my urls using django.contrib.auth.urls. I can register a user but when I try to redirect to the login page, I get this error:

How Can I Select Date Based on Monday Date?

2018-05-12 Thread Alexander Joseph
I'm building a timesheet app for employees and would like the employees to be able to select a day of the week date based on what the date was on Monday. ie. the user inputs the Monday date of the timesheet, then for each row they need to fill out they can select the Day/Date for each day that

Re: @mark_safe decorator and filters & tags

2018-05-12 Thread Tim Graham
Seems to be a regression: https://code.djangoproject.com/ticket/29400 On Tuesday, May 8, 2018 at 4:45:14 PM UTC-4, Torsten Bronger wrote: > > Hallöchen! > > Up to Django 1.11, I had the following pattern frequently in my > code: > > @register.filter > @mark_safe > def

Re: Creating models from json url feed

2018-05-12 Thread Ryan Nowakowski
On May 10, 2018 7:40:47 AM CDT, Matt Snelgar wrote: > > >I am making a django app to browse available products at different >markets. >I am getting data for my models from a JSON url feed, > >I am not sure on the best approach to turn this data into models as the > >feed

Re: Deploy on windows IIS

2018-05-12 Thread Majid Hojati
Which Mode_wsgi you used for python 3.6 x86 and apache2.4 Haus x64 for windows ? On Friday, May 11, 2018 at 11:07:19 PM UTC+4:30, Matthew Pava wrote: > > I just go straight to the source or Google around. > > https://httpd.apache.org/docs/2.4/platform/windows.html > > Apache has different

Re: Deploy on windows IIS

2018-05-12 Thread Majid Hojati
Hi, I faced a question, Do you unistalled iis and installed Apache?Also If I want to use Geoserver which runs on TomCat How can I use it beside django? On Friday, May 11, 2018 at 11:07:19 PM UTC+4:30, Matthew Pava wrote: > > I just go straight to the source or Google around. > >

Re: ValueError source code string cannot contain null bytes

2018-05-12 Thread Arif Arman
Hi I am having the same error. Did you manage to solve it? On Thursday, December 7, 2017 at 10:30:16 AM UTC+6, Rajeshwaran wrote: > > Hi All, > > I am facing this "ValueError: source code string cannot contain null > bytes" error when i create a sqlite3 database and run the application. > >

Re: Django Queries

2018-05-12 Thread Joseph Mutumi
Hello, You need to clearly understand Python objects because the ORM maps fields directly to that. Please check out: https://docs.djangoproject.com/en/2.0/topics/db/queries/ So if you print out the object as a string i.e. people = People.objects.al() print people OR person =

Re: Django Queries

2018-05-12 Thread Gerald Brown
I was getting the same as you are as I had just first_name & last_name set in the "def __str__(self)".  I added a couple of more fields to that statement but they are still not showing up even after running a makemigration which says "No Change" I tried "p.address" but it gave me an error