Anonymous
Or use different dbms if you're so flexible
Karthik
Karthik
I'm doing a project for my college.
Like full college management system
Karthik
Can I use mongodb as a database for that project
Mirco
Try using PostgresSQL if u are free to choose one
Karthik
Karthik
Mirco
Anonymous
Anonymous
Then do it
Anonymous
Afaik there aren't much concepts in mongodb like the there in a relational database
Chris
Who has ever used Djongo with Django for MongoDB?
Chris
No matter what I do, the admin page tells me to input the required field 😢
Hesen Nivas
Manish
i am getting emptypage error in page=2 in paginator
Manish
https://del.dog/ajanoyozut this is my views.py
Manish
path('', views.article_home, name='article_home'),
urls.py
Manish
however my website works with page=1 fine
Manish
and i have more than 10 article in db
Manish
with published tag
Mirco
What about your template ?
Manish
{% if articles.has_other_pages %}
{% include "blog/article/pagination.html" with articles=articles %}
{% endif %}
Mirco
Mmm strange, it looks good
Manish
yeah
Manish
i tried all over in web for this issue
Manish
but no luck
Mirco
Try to use Paginator in a Django shell by passing the same qs
Mirco
And check if next page or previous page look good
Manish
i get <page 2 of 2>
Mirco
Strange
Manish
all strange things happens to me😭😭😭
Mirco
In your template u have a typo mistake
article instead of articles on line 7
Mirco
<span class="current"> Page {{ articles.number }} of {{ articles.paginator.num_pages }}.
</span>
why that for loop ?
U can do as docs suggests
Manish
Manish
Manish
Mirco
I think it will be something stupid that we cannot see 😂
Mirco
Maybe I'm going wrong but try to use the if statement into template to check if has_next or has_previous outside class attribute , enclosing your anchor tag
Mirco
Try to put the if outside class attribute into template
Mirco
Then refactor as you need
Mirco
Just to see if it will work
Manish
whoopee it worked
Mirco
😂😂
Manish
https://del.dog/ufogonayol but i changed something different
Manish
see that
Manish
crazy nahh!😁😁
Manish
thanks alot man
Mirco
Yup what I said before but like this you have to repeat two if statement that are equals
Manish
if you refuse to help me then i am dead
Manish
Manish
complex is better than complicated
Mirco
Simply use two a tags one when has_previous and one not
Mirco
So if has previous , the a tag will have that button enabled with href to previous page
Otherwise a tag with disabled
Anders (izzno / gooood) ๐ณ๐ด
If i set name = something(unique=True) is this automatically the PK ?
Anders (izzno / gooood) ๐ณ๐ด
In my model
Rajjix
No
Anders (izzno / gooood) ๐ณ๐ด
hm.
Maz
Rajjix
If you have made an sql database before
Anders (izzno / gooood) ๐ณ๐ด
I am making an api but the "id" does not show up
Rajjix
You should know that there is a primary key attribute you can assignto a field
Django autoassigns it to id
Anders (izzno / gooood) ๐ณ๐ด
Anders (izzno / gooood) ๐ณ๐ด
yes i thought i knew that to, thats why i am windering why its not visible in the api.
Anders (izzno / gooood) ๐ณ๐ด
maybe i have to assign a detailview before the restapi bothers with IDs ?
Rajjix
be more specific, what do you mean not showing up
Anders (izzno / gooood) ๐ณ๐ด
Sure give me a sec
Mirco
Your serializer ?
Anders (izzno / gooood) ๐ณ๐ด
the serializer is Modelserializer
Mirco
Yep, but you can use fields attribute
Anders (izzno / gooood) ๐ณ๐ด
Oh...
Anders (izzno / gooood) ๐ณ๐ด
im an idiot...
Anders (izzno / gooood) ๐ณ๐ด
;)
Mirco
Rajjix
😂😂
Anders (izzno / gooood) ๐ณ๐ด
Thanks ;)
Mirco
Yw 😀