Re: table bank_app_bank has no column named DOB

2023-08-22 Thread meenu loranz

Yes i delete that 0001_initial.py page and rerun the migration codes and 
run the server. But it dosen't work for me..

On Tuesday, August 22, 2023 at 12:49:39 AM UTC+5:30 Mike Simkins wrote:

> Did you regenerate and rerun the migrations ??
>
>
> python manage.py makemigrations
> python manage.py migrate
>
>
>
> On 21 Aug 2023, at 09:46, meenu loranz  wrote:
>
> Thank you for your response...i changed DOB to dob...but still showing me 
> the error...
> OperationalError at /add/ table bank_app_bank has no column named dob 
> Request Method: 
> POST 
> Request URL: 
> http://127.0.0.1:8000/add/ 
> Django Version: 
> 4.2 
> Exception Type: 
> OperationalError 
> Exception Value: 
> table bank_app_bank has no column named dob 
> Exception Location: 
> C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\django\db\backends\sqlite3\base.py,
>  
> line 328, in execute 
> Raised during: 
> bank_app.views.add_form 
> Python Executable: 
> C:\Users\Admin\AppData\Local\Programs\Python\Python39\python.exe 
> Python Version: 
> 3.9.0 
> Python Path: 
> ['C:\\Users\\Admin\\myprojects\\banking_system\\bank_project', 
> 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\python39.zip', 
> 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\DLLs', 
> 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\lib', 
> 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39', 
> 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages']
>  
>
> Server time: 
> Mon, 21 Aug 2023 08:44:34 +
>
> On Saturday, August 19, 2023 at 10:49:13 PM UTC+5:30 RANGA BHARATH JINKA 
> wrote:
>
>> Hi,
>>
>> Try changing DOB to small letters dob and run the migrations again. 
>>
>> All the best 👍
>>
>> Thanks and Regards
>>
>> J. Ranga Bharath
>> Cell: 9110334114
>> 
>>
>> On Sat, 19 Aug 2023, 9:18 pm ivan harold,  wrote:
>>
>>>
>>> https://stackoverflow.com/questions/68269165/why-django-is-not-detecting-my-table-column
>>>
>>> Try reading this article, it may help you.
>>>
>>> On Saturday, August 19, 2023 at 3:05:57 AM UTC+8 meenu loranz wrote:
>>>
 from django.contrib.auth.models import User
 from django.db import models
 from django.urls import reverse
 # Create your models here.

 class bank(models.Model):
 name = models.CharField(max_length=255)
 DOB = models.DateField()
 age = models.IntegerField()
 gender = models.CharField(max_length=10)
 phone_no = models.CharField(max_length=10)
 mail_id = models.EmailField(max_length=25)
 address = models.CharField(max_length=255)
 district = models.CharField(max_length=100)
 branch = models.CharField(max_length=100)
 account_type = models.CharField(max_length=100)
 # materials_provided = models.CharField(max_length=100)


 def __str__(self):
 return self.name

 This is my model.py page. And i can see this table and all fields in my 
 database. But while running show me the operational error that no column 
 named DOB. How can i fix this?


>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/1aaf9e41-e11c-43bb-bda9-17b609814059n%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...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/3166bd2f-a556-49ce-9813-6794a3aac838n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/60be294e-a901-4b74-a30b-54f8154130e6n%40googlegroups.com.


ANYONE TO HELP ME ON HOW TO CREATE AN AUTOMATIC NOTIFICATION SYSTEM THAT SENDS A MESSAGE WHENEVER AN OBJECT IS CREATED OR MODIFIED

2023-08-22 Thread Byansi Samuel
My views
from django.shortcuts import render def auto_notification(request): return
render (request, "user/dashboard.html")

My models
from django.db import models from django.contrib.auth.models import User

#articles model

class Articles(models.Model):
title = models.CharField(max_length=300) date= models.DateField()
author=models.ForeignKey(User, on_delete=models.CASCADE)
body=models.TextField()

def __str__(self) -> str:
return self.title

#games model

GAME_TYPE=( ("action", "action"), ("adventure", "adventure"), ("racing",
"racing"), ("puzzle", "puzzle"), )

MOV_TYPE=( ("action", "action"), ("adventure", "adventure"), ("sci-fi",
"sci-fi"), ("horror", "horror"), ("drama", "drama"), )

GAME_OS=( ("Windows", "Windows"), ("Android", "Android"), )

class Games(models.Model): name=models.CharField(max_length=50)
type=models.CharField(max_length=40, choices=GAME_TYPE)
os=models.CharField(max_length=15, choices=GAME_OS) img=models.ImageField()
developer=models.CharField(max_length=50)
version=models.CharField(max_length=10)
ratings=models.CharField(max_length=10) description=models.TextField()

def __str__(self) -> str:
return self.name class

Movies(models.Model): name=models.CharField(max_length=50)
type=models.CharField(max_length=40, choices=MOV_TYPE)
description=models.TextField() released=models.DateField()

def __str__(self) -> str:
return self.name

I have three models below, but l like to create a Notification System to
send a message to a User whenever ;
1. An object is created in all those models
2. An object is modified in all those models

And l would like to add trick that it sends the Notification Message after
15 minutes of publiction or creation.

And I would like to pass the following data if available in the object ;
1. the Name of the Object,
2. the Image of the Object, and
3. the type of the Object.

Lastly I would like to add a :
1. Notification DELETE function, that gives User a way to delete that
Message , not to appear in his or notification section again.

2. Mark as Read function, that changes the Massage Div Color

3. A notification Barge that displays the UNREAD Messages.

Am requesting anyone to help me Because Am stuck , I have no where to Start
from. I will be on waiting your guidelines.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGQoQ3wRpg%2BcT69wqUbapHbK7KSEfwU%2BxfJ-EKRCcddY6KwtnA%40mail.gmail.com.


Re: Error while showing detailed post

2023-08-22 Thread Mvd Raghava
what issue are you facing. please send the error

On Sat, Aug 19, 2023 at 9:03 PM Dhiraj Kumar 
wrote:

> Hi new in Django,
>
> I want to display details post to the template but facing issue while
> trying to fetch post by id on the click of Continue Reading
> ,
> Views.py
>
> def show(request, id):
> print(id)
> try:
> showPost = post.objects.get(id=id)  # Assuming your model is
> named 'post'
> except post.DoesNotExist:
> # Handle the case where the post with the given ID doesn't exist
> raise Http404("Post does not exist")
>
> return render(request, 'show_post.html', {'showPost': showPost})
>
>
>
>
> Urls.py
> from django.urls import path
> from news import views
> from django.conf import settings
> from django.conf.urls.static import static
>
> urlpatterns = [
> path('',views.home, name='home' ),
> path('about', views.about, name="about"),
> path('contact', views.contact, name="contact"),
> path('News_post', views.News_post, name='News_post'),
> path('add_post',views.add_post,name='add_post'),
> path('show//', views.show, name='show')
>
> ]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>
>
>
>
>
>
>
>
>
>
> Thanks & Regard Dhiraj Kumar
> Mobile No. : 9643843355, EXT: 250
> Email Id: dhi...@nimbusitsolutions.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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAAdfw9TdfFir%2BiFUyGxAhzWLdpDCtfSZr2ZPhi7DJrUauJUn-w%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFfOSBnje%3DqkUBaa8ZFrLLZ7Fme7-DWE-px1LpbT06b3yvmHKg%40mail.gmail.com.