Doragonsureiyā
Thanks @pyflare
You're welcome! 😊
Sarthak
could 2 or more compute engines running Django apps use the same domain name and how?
Mirco
Thanks :)
I strongly suggest you to try django-q , it's one of the best atm Less headaches etc. etc. It has redis as broker by default
Ç
https://pastebin.com/7NSYdmqU
Why? You can modify field name of the model as you like.it is the simplest method.
Wang
Why? You can modify field name of the model as you like.it is the simplest method.
no why? because attrs can add attributes of input, i only want to test it
Ç
if you want to do so, you can build init(self,. ..) method for modelform.
Anonymous
I has posted a fix for you.
sir really thanks ❤️
Ç
Firstly, call. super().__init__(), then self.fields['text'].Widget.attrs(...)
Ç
But it is not good experience
Anonymous
I has posted a fix for you.
same errors not working
b
i am getting this error-
b
django.db.utils.OperationalError: no such column: todolist_items.time_created
Anonymous
Did you python manage.py migrate?
b
yes I did, multiple time
b
error still appears
b
actually, I added a field in models
b
then this happened
Muflone
joe did you made one of these things? 1) removed your migration files? 2) applied changes to your db (eg using sql)?
b
no
b
I added a new field in model
Muflone
do you have that field in your migrations files?
Muflone
in particular in the last file
b
yes
b
it's there
Muflone
is it in the latest migration file?
b
yes
b
it's there
Muflone
then you deleted the migration file before
Muflone
unapply it and apply it again
b
I never deleted the files
Muflone
paste your python migrate.py showmigrations (using a pastebin)
b
nevermind, code runs now
Muflone
...
b
no it doesn't
b
wait I'm
b
# Generated by Django 3.0.5 on 2020-05-01 15:04 import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('todolist', '0008_remove_items_time'), ] operations = [ migrations.AddField( model_name='items', name='time_created', field=models.DateTimeField(auto_now_add=True, default=datetime.datetime(2020, 5, 1, 15, 4, 27, 135609, tzinfo=utc)), preserve_default=False, ), ]
Muflone
what dbms are you using?
b
default
Muflone
echo 'select * from django_migrations ORDER BY id DESC limit 5' | sqlite3 default.db
b
what's this
Muflone
it will get the latest 5 migrations from your default.db
b
do I run this in prompt ?
Muflone
are you using linux?
b
no
b
windows
Salohiddin Yoqubov
class Question .... class Answer (models.Model): question = models.Foreignkey...... How can I get unanswered questions using Question.objects.annotate?
Muflone
windows hasn't the sqlite command line. open the db using a db explorer
Muflone
windows
as an alternative, unapply your migration and apply it again python manage.py YOUR_APP LATEST_NUMBER-1
Code
only api view, thsnk you for the suggestion
yes, that 'query' line would be used in the 'APIView/post'. good luck
George
😄
Муродали
hi guys how to know the object id number pair or odd that coming from database
Martin
hai guys
Martin
ho we can add a new button in admin panel in django
Muflone
ho we can add a new button in admin panel in django
it depends where you meant to add it
Gil
in home admin page
https://docs.djangoproject.com/en/3.0/ref/contrib/admin/#overriding-admin-templates
George
Муродали
for exmaple i used : {% if post.id%2==1 %} <div>odd number</div> {% else %} <div>pair number</div> {% endif %}
George
where is my mistake
probably signs are used differently on the templates , you should check how to do arithmetic in your engine. maybe its %% instead of % of there is a is_pair function.
George
i cant understand what do you takling
read the templating engine documentation lol
George
Let me 🦆 DuckDuckGo that for you: 🔎 djanjo template arithmetic
Муродали
class MyModel(models.Model): int_1 = models.IntegerField() int_2 = models.IntegerField() result = MyModel.objects.annotate( diff=F(int_1) + F(int_2) ).filter(diff__gte=5) @hyunlee1o consider it?
Муродали
do u know
George
ok how i use it in html
im telling you how to search for your information, i dont know