Does anyone know why in django models (and I don't know how it is in etc. python), you can define a function below, and use it above in the code, but a class can't reference a class defined later in the code, or it won't find it?That seems like beyond stupid to me.Michael--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2409c040-107d-40e3-a828-0013851d0d98n%40googlegroups.com.
Friday, March 3, 2023
Re: Ordering of code
Thursday, March 2, 2023
Re: "Django road map and resources"
You can search for Udemy courses. In some of them they build complete projects that you can follow along. There are books as well that guide you through projects, a quick google search or search in amazon books should give you some resources
Re: How to retrieve the latest object added (new one) in Django models and display it in the template?
Is it coming from a form? A Get parameter? A post parameter? Extract it appropriately before calling filter()
> On Mar 2, 2023, at 3:46 AM, Byansi Samuel <samuelbyansi87@gmail.com> wrote:
>
> def action (request):
> latest_action=ActionGame.objects.filter(published=published). latest()
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/A09FDF66-9845-4B93-854D-8BBFC4F5A03D%40showmethesource.org.
Wednesday, March 1, 2023
Re: django
https://docs.djangoproject.com/en/4.1/topics/auth/default/#groups
I just created a normal school name adding API and how do I add role based authentication In thatOn Mon, Feb 27, 2023, 8:24 PM OSP PRO <osp123ug@gmail.com> wrote:Yes, Django is much trustworthy admin dashboard, than other frameworks.--On Mon, Feb 27, 2023 at 5:29 PM Ikrombek <ikromdev25@gmail.com> wrote:HelloCan I create strongest dashboard with django--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f305c42f-915a-46d5-b535-559b18bb5040n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACng%3Deibg0sfVojeAVoZmFxHZyFGZtyLwgN%3D8%3DY3q6r0Bpc1KA%40mail.gmail.com.
invalit format for join_date when I ran a migration
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/19fa95b0-0e82-49d2-9007-b36bae8f770en%40googlegroups.com.
Tuesday, February 28, 2023
Re: How to retrieve the latest object added (new one) in Django models and display it in the template?
Hey everyone, l got a problem. Am trying to retrieve a single latest object added everytime, and display it in the template.
Below is my codes but;Help me figure it out the source of the problem in these different instances below 👇
_______________________ issue number 1_______
#Action/models.py
class ActionGame(models.Model):
name=models.Charfield()
published=models.DateTimeField()#Action/views.py
from Action.models import ActionGamedef action (request):
latest_action=ActionGame.objects.filter(published=published). latest()
Context={ 'latest_action': latest_action }
return....But it returns *error* :
name 'published' is not defined
latest_action=ActionGame.objects.latest("published") - that would give you the last published item. Another way would be:
latest_action=ActionGame.objects.order_by("published").last()
____________________ issue number 2________
#Action/models.py
class ActionGame(models.Model):
name=models.Charfield()
published=models.DateTimeField()
class Meta:
get_latest_by='published'#Action/views.py
........
latest_action=ActionGame.objects. latest()
.......#but it returns *error* :
'ActionGame' object is not iterableEven if I try this:
............
latest_action=ActionGame.objects. latest('published')
.......#it returns the Same error:
'ActionGame' object is not iterableBut this second issue, the error is referred in #action.html
{% for x in latest _action %}
<p>{{ x.game_name }}</p>
{% endfor %}
Please l need your assistance.
I'm Samuel,
--
Thanks
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGQoQ3wMUno6hLAO-1FtN0Nn7VtkCn4qf-O4U%3DpeJ4JzY%2B%3DcAQ%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK4qSCeBCST7o-5WZx%2BmhGO2yH-Msdse%3DKusk9UOyW8XZBXRBw%40mail.gmail.com.
Re: How can I serve an Angular app from root?
Hello,I have a prebuilt Angular app, which is basically just static files. How can I serve it from the root project? If I set STATIC_URL to "/", I get the following:django.core.exceptions.ImproperlyConfigured: runserver can't serve media if MEDIA_URL is within STATIC_URL.--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/60f7e50e-7900-46f1-a91e-67038ea91e30n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK4qSCdKVjmtThYiKdQnRTYe9PEP-5Smee2LWfqUq7_edLC81Q%40mail.gmail.com.