Re: Invalid pk \"1\" - object does not exist.

2019-02-25 Thread Phako Perez
I guess you need to define first the id in models.CASCADE, When you try to insert as per your table definition it looks for the key on that table > manager = models.ForeignKey('self', null=True, > related_name='employee',on_delete=models.CASCADE) Hope this can be helpful Happy coding!!! Sent

Re: Tag block and endblock

2019-02-25 Thread Phako Perez
If you see at the beginning of your template it loads/import another file which actually contains the part of code which goes in there, this block has same name like myBlock. Hope this is helpful Happy coding! Sent from my iPhone > On Feb 25, 2019, at 4:06 PM, Nexx wrote: > > Wht is the pu

Re: ValueError: attempted relative import beyond top-level package

2019-03-02 Thread Phako Perez
I guess you miss the __init__.py file in project1 directory Sent from my iPhone > On Mar 2, 2019, at 3:25 PM, Bulgarian seller wrote: > > from ..appTwo import views > urlpatterns = [ > path('',views.index), > path('admin/', admin.site.urls), > ] > > > ValueError: attempted relative

Re: test if model object fits into QuerySet without executing SQL?

2019-03-15 Thread Phako Perez
You can create query as def get_query(value=None): if value: query = “select all records from table where color = ‘" + value + “‘ query = “select all records from table” return query Sent from my iPhone > On Mar 15, 2019, at 6:20 AM, jgib...@caktusgroup.com wrote: >

Re: 1054, "Unknown column 'userprofile_user.phone' in 'field list'"

2019-03-27 Thread Phako Perez
Review your model, seems you missed add phone into your model or some misspelling Sent from my iPhone > On Mar 27, 2019, at 12:05 AM, Pinkesh Narad > wrote: > > hello all, > I am new to this, and i am getting this error and unable to run my admin > as of I did makemigration app-name also de

Re: why i need to download pycharm , why python ide is not sufficient to write code .

2019-03-27 Thread Phako Perez
Isn’t required, it depends on you as PyCharm has more functionalities Sent from my iPhone > On Mar 27, 2019, at 12:49 PM, goodresults wrote: > > -- > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe fr

Re: Ayuda con el error: UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position 7: ordinal not in range(128)

2019-05-07 Thread Phako Perez
Al parecer estás usando un carácter como ñ o ç, el cual es de los extendidos, supongo intentas settear el password o el nombre de usuario, intenta con puro carácter sin acentos o tilde ni ninguna otra forma rara. Sent from my iPhone > On May 7, 2019, at 16:21, noel moreira wrote: > > Hola ami

Re: Need urgent help on Django project

2019-05-10 Thread Phako Perez
You could use a dictionary with cities as keys and in first drop down get keys and an if condition for second where it checks first for city if nothing selected then make second disable Sent from my iPhone > On May 10, 2019, at 07:35, avdesh sharma wrote: > > Hi Django Users, > > > I have a

Re: Running tests creates many unnecessary files

2019-06-28 Thread Phako Perez
As per my understanding all test runs in a virtual environment and all data(files, variables databases) are deleted once test clmpletes, how are you running these test, are you using a specific library from python or using own tests in a personal file? Sent from my iPhone > On Jun 28, 2019, at

Re: Problem

2020-03-16 Thread Phako Perez
What’s the problem??? Using python 3 you can create an environment as python3 -m venv my_env Kindly send an error or what is the issue you face while trying to create the env, so will be more easy to help, otherwise this question you can search on google for a beginner tutorial Regards Sent

Re: Problem

2020-03-16 Thread Phako Perez
libraries installed, now you can simple install as usual pip install Regards Sent from my iPhone > On 16 Mar 2020, at 13:59, Daniel Chiemelu > wrote: > >  > So after creating the virtual environment what is next on installing django > > Sent from Mail for Windows 10 &g

Re: Django framework on Windows OS

2020-03-17 Thread Phako Perez
May I suggest use an IDE as pycharm, there is a terminal available inside IDE, where all the environment is setup already and you don’t need to modify anything else but the interpreter to use Regards Sent from my iPhone > On 17 Mar 2020, at 19:35, chucks ogwo wrote: > >  > Does anyone here

Re: What is the difference between virtual environment and normal code in pycharm

2020-03-19 Thread Phako Perez
Hi Ravi, There is no difference, both works same, however when you use the virtual environment, all the package you install will be available only in that venv, so you can create an environment per project and each project will have their own package list, each with their own version. On the o

Re: Looking for Django developers to work on a new and an existing project with our team

2020-03-29 Thread Phako Perez
Hi, I’m also interested to join your team, have 3+ years working with python Currently I’m teaching python to a group in order them to improve theirs career Thanks in advance Sent from my iPhone > On 29 Mar 2020, at 20:48, chinna wrote: > >  > Hi, > > I am Premkumar having 3 years of exp

Re: In pycharm errror

2020-04-09 Thread Phako Perez
Check the ‘ls’ command to verify is on directory you are running the manage.py And not sure about how you ran the command, but you should run as python manage.py runserver Regards Sent from my iPhone > On 9 Apr 2020, at 9:25, tejasri mamidi wrote: > > While executing py manage.py runserver

Re: AttributeError

2020-04-27 Thread Phako Perez
I think issue is how you are trying to access the attribute This is a form and must be accessed through a post call. Can you share your html form??? Sent from my iPhone > On 27 Apr 2020, at 10:29, DimGo wrote: > >  > from django import forms > from django.core.exceptions import ValidationErro

Re: AttributeError with forms

2020-04-27 Thread Phako Perez
In addition, you must define your model in models.py And to get this attributes on your views.py from a post request, you could use like {{ form.attribute }} Regards Sent from my iPhone > On 27 Apr 2020, at 10:29, DimGo wrote: > >  > Why is this this strange error? > -- > You received thi

Re: Create a function which fill automatically a field in my models

2020-05-07 Thread Phako Perez
You can use default option while creating model Sent from my iPhone > On 7 May 2020, at 8:53, Derek wrote: > >  > Its unclear what you mean by "last ID" - and I cannot see the value of > storing such as they are available in the database... > > But have a look at > https://stackoverflow.com

Re: I can't see my models in MySQL db

2018-07-06 Thread Phako Perez
Hi Azimzadeh, I’m also new in Django but I notice you referred to app as django-sb-admin and you added in settings as django_sb_admin Just want to point the mismatch in name, your app is with ‘-‘ whereas installed apps has ‘_’, issue could be this mismatch? As python itself is key sensitive R

Re: from django.contrib.auth.views import login

2018-07-07 Thread Phako Perez
hi, instead of from django.contrib.auth.views import login you need to use from django.contrib.auth import login regards. On Sat, Jul 7, 2018 at 6:41 AM, Ahmad wrote: > hello everyone, > > when i import this line it's not working. > from django.contrib.auth.views import login > > My Django

Re: I want to remove username unique and its validation from django i tried but not working

2018-07-29 Thread Phako Perez
You want to update an unique field as null which is wrong, you aren’t able to insert update a field marked as unique instead you can remove the entire row, if you wanted to track all users on your table you can add 2 fields to the table, 1 for the update date and other for a flag which can tell

Re: problems with order by month

2018-08-22 Thread Phako Perez
I think you miss the column to order cardio = Alumno.objects.filter ( fechanacimiento __month = now.month).order_by(‘fechanacimiento’) Should be cardio = Alumno.objects.filter ( fechanacimiento __month = now.month).order_by(‘fechanacimiento_day’) Sent from my iPhone > On Aug 21, 2018, at 6:

Excel formula values

2018-08-24 Thread Phako Perez
Hi everyone, I’m trying to get data from an excel file. Every thing goes fine till cell contains an excel formula, such cases is getting null values Here I open the book ———- report_book = openpyxl.load_workbook(filename, data_only=True) sheet_list = report_book.sheetnames worksheet = repo

Re: Excel formula values

2018-08-24 Thread Phako Perez
Actually what I need is to print the values from an excel on a table, but everything looks good, table formatted in html using CSS style for coloring However when a cel in excel is a formula, the value is not showing, as well when cel value is 0 Sent from my iPhone > On Aug 24, 2018, at 8:39

Re: Creating seperate unique ids within the same table

2018-10-17 Thread Phako Perez
I suggest to use another table for visit so you can add which doctor, schedule time, and comments or so as a patient may have 1 visit or n... Sent from my iPhone > On Oct 17, 2018, at 9:59 PM, Joel Mathew wrote: > > A hospital id needs to be assigned to a patient and printed on their id card.

API Django

2018-10-21 Thread Phako Perez
Hi all, i'm really new on Django, trying to create an RESTful API, and getting this error: curl -i -U Elly:Elly -H "Content-Type: application/json" -X GET http://192.168.100.22:8000/schedule/3/ HTTP/1.1 403 Forbidden Date: Mon, 22 Oct 2018 05:44:40 GMT Server: WSGIServer/0.2 CPython/3.6.3 Co

Re: API Django

2018-10-21 Thread Phako Perez
27; via Django users < django-users@googlegroups.com> wrote: > Remove Isauthenticated from rest_framework in settings.py > > On Mon, Oct 22, 2018, 11:22 AM Phako Perez <13.phak...@gmail.com> wrote: > >> Hi all, >> >> i'm really new on Django, trying to

Re: Oracle database

2018-11-03 Thread Phako Perez
You need to define your db connection details , server schema user password within file settings.py inside your project directory :) Sent from my iPhone > On Nov 3, 2018, at 1:26 PM, fatoubinetou...@gmail.com wrote: > > Hi!!! Do you know how to use oracle database with django? > -- > You rece

Re: Cannot get Django test migrations to detect test models.py

2018-11-03 Thread Phako Perez
I can suggest to use different name for your test app, as directory test is used by Django for actual test your application, maybe is that the reason your app is failing Sent from my iPhone > On Nov 3, 2018, at 12:40 PM, ch...@routh.io wrote: > > Hi folks, I'm trying to build a test suite for

Re: Using forms for bulk records

2018-11-03 Thread Phako Perez
You could add your mode into admin.py field so you can modify and all those stuff from admin page Sent from my iPhone > On Nov 3, 2018, at 7:48 AM, Elias Coutinho wrote: > > Good morning people. > > As always my problem is conceptual. I have improved a lot, but still in the > fight. > 1 - I

Re: Setting up admin in visual studio

2018-11-06 Thread Phako Perez
I can recommend py charm Sent from my iPhone > On Nov 6, 2018, at 3:32 PM, Matthew Pava wrote: > > PyCharm > > From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On > Behalf Of Saeed Pooladzadeh > Sent: Tuesday, November 6, 2018 3:31 PM > To: Django users > Subject:

Re: Django Admin Redesign

2018-11-12 Thread Phako Perez
If I remember correctly you can define your own templates under the template directory Regards Sent from my iPhone > On Nov 12, 2018, at 4:49 PM, Zakriya Bilal wrote: > > I am starting a project in which one of the requirements is to have a custom > designed Admin panel. > > So my question

Re: Recommend Tutorials

2018-11-26 Thread Phako Perez
What I can recommend to you for this, is to use same versions for each module on the tutorial so your code will works You can create a virtual environment for each tutorial using viertualenv and as a good practice you can list all module requirements on requirements.txt file Regards Sent from

Re: Python Django Training

2020-02-03 Thread Phako Perez
I would like to be included in this training WhatsApp +523323120735 Email: joshue...@gmail.com Sent from my iPhone > On 2 Feb 2020, at 10:35, V S V Narsimha Murthy wrote: > >  > Hi > > I am interested to attend the python and Django online training. Please add > me as well for the training