Questions tagged as 'python'

1
answer

Creation of a class in Django that has a key to itself

I'm getting into the world of Django and I was trying to generate different types of models. Now I am creating a model with a class 'Tags' which has a key that calls another object of the class (To create objects linked by relationship)....
asked by 25.04.2016 / 08:59
2
answers

'PostListView' object has no attribute 'views'

What I want to do is that an entry has a visit counter but I can not implement it correctly. models.py class Post(models.Model): title = models.CharField(max_length=50) content = models.TextField() author = models.ForeignKey(U...
asked by 11.12.2018 / 23:02
1
answer

Problem with menu in python

[EDITED QUESTION] Hi, how are you? I hope they look good. I have a problem with the menu and sub-menu in Python. I'll explain to what I want to get, I want to make a main menu which will have its sub-menu and that sub-menu will have another sub-...
asked by 28.12.2018 / 01:54
1
answer

Error importing a model Unhandled exception - can not import name

I have the following structure of my application in relation to the following apps project userprofile models.py rbsessions models.py In userprofile / models.py I have the following from __future__ import unicode_l...
asked by 20.01.2016 / 14:58
2
answers

Check for repeated tweets in MongoDB

I have a method that, thanks to Twython, saves the tweets in MongoDB as it is in my question Maintaining a mongodb with tweets that match a given tag def getSearchTagTwitter(hashtag): db = connexMongoDB() t = loginTwython() searc...
asked by 17.02.2016 / 17:09
1
answer

Edit form fields in Django to modify the input object

I need to validate a form, but Foundation Abide PlugIn works by selecting the input fields that have the required tag added: <input type="text" placeholder="1234" aria-describedby="exampleHelpText" required pattern="number">...
asked by 15.02.2016 / 01:11
1
answer

Error with the Django runserver command

Trying to run the local Django server I get the following error in the terminal when running using runserver . This is the code: Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_comman...
asked by 11.02.2016 / 03:27
1
answer

Pylint - Too many boolean expressions in if statement

Good afternoon I have the following code snippet: content_view = cleaned_data.get('content_view') show_content = cleaned_data.get('show_content') show_children = cleaned_data.get('show_children') footer_title_1 = cleaned_data.get('footer_titl...
asked by 02.05.2016 / 22:13
1
answer

Restart .exe .bat processes in python or django

I wonder: is it possible to restart .exe .bat processes in python or django language? Basically they are running processes in production on remote servers. What is needed is to automate the process by avoiding entering each of them and restar...
asked by 04.04.2016 / 16:52
1
answer

Python - ModuleNotFoundError: No module named 'babel.numbers'

I have made an application in python3.7, with tkinter, when coding is all correct, it works perfectly, but when doing it executable with cx_freeze, in a section of my application where I open a calendar, the error jumps. I think you have t...
asked by 19.12.2018 / 05:39