Re: List Field in Django Model while using SQLite

2022-06-17 Thread Mukul Verma
Thanks but it would not work for me if you have any example code please 
share i need to use that


On Friday, 17 June 2022 at 14:30:00 UTC+5:30 juw...@gmail.com wrote:

> This could be helpful: 
> https://forum.djangoproject.com/t/use-an-array-of-fields-with-sqlite/2320
>
> On Fri, 17 Jun 2022 at 15:00, Mukul Verma  wrote:
>
>> Hii Everyone,
>> Thanks for all the advice and suggestions.
>> currently i got stuck with a problem i have to store list of some data in 
>> a specific field of the model may you please suggest me or if possible 
>> share code snippet.
>>
>> How can i store the list in the model field while using SQLite please.
>>
>> -- 
>> 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/b77e7ebc-7efc-4d40-9f48-fe21a457cf88n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/b77e7ebc-7efc-4d40-9f48-fe21a457cf88n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/c80ef170-eb97-4a00-8875-e24ea7dbd3b0n%40googlegroups.com.


List Field in Django Model while using SQLite

2022-06-17 Thread Mukul Verma
Hii Everyone,
Thanks for all the advice and suggestions.
currently i got stuck with a problem i have to store list of some data in a 
specific field of the model may you please suggest me or if possible share 
code snippet.

How can i store the list in the model field while using SQLite please.

-- 
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/b77e7ebc-7efc-4d40-9f48-fe21a457cf88n%40googlegroups.com.


Json Object type field in Model in Django

2022-06-09 Thread Mukul Verma
Hii Community,

can we add a field in model that stores json and we can access it's keys to 
get there respective values, if yes please let me know and how we can use 
that this thing too.

Thanks and Regards
Mukul Verma

-- 
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/82b3719b-cb25-4a63-973a-744d44cb7e9an%40googlegroups.com.


Session in Python for Login and Logout

2022-06-06 Thread Mukul Verma
Hii,

Help me out in this stuff please, some steps for solve this out

-- 
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/0b5522ff-2a71-4a51-b1db-847169d2d104n%40googlegroups.com.


Re: Best approach for audit logging in Django.

2022-06-05 Thread Mukul Verma
i also have the question regarding this, is that i have to create auditing 
log file for all the activities performing in the project smallest or 
biggest may you please tell how to initiate this task from beginning.

*Thanks*
*Mukul Verma*

On Friday, 3 June 2022 at 23:32:04 UTC+5:30 sutharl...@gmail.com wrote:

> Hi Sencer, signals will be helpful only if you are auditing on certain 
> models 
> but if you are trying to audit a set of views then middleware will be a 
> better choice since that will be more manageable
>
> On Fri, 3 Jun 2022 at 18:29, Jason  wrote:
>
>> one good source when you have a question "is there anything in django 
>> that does X?" is to go to djangopackages.org.
>>
>> https://djangopackages.org/grids/g/model-audit/, for example, is a list 
>> of packages for model auditing and history
>>
>> On Friday, June 3, 2022 at 6:33:37 AM UTC-4 sencer...@gmail.com wrote:
>>
>>> Hi,
>>>
>>> I've been planning to add audit logging to the project.
>>>
>>> But, I can not decide which approach is the best;
>>> Using signals or creating middleware?
>>>
>>> Project needs to being log events on change of model object with these 
>>> informations below:
>>>
>>> - If a record is inserted, updated and deleted:
>>>- who is taking this action (ForeignKey)
>>>- what is the action (Choice)
>>>- which applications model object affected (ContentType)
>>>- affected object (Generic relation)
>>>- current data in json format
>>>- previous data in json format
>>>
>>>
>>> Kind regards,
>>> Sencer HAMARAT
>>>
>>> -- 
>> 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/f5586723-4e6a-4ce6-93d9-b74cd277dc91n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/f5586723-4e6a-4ce6-93d9-b74cd277dc91n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/415a6eee-74b2-4cbf-b708-2ff15091aeecn%40googlegroups.com.


django.db.utils.IntegrityError: NOT NULL constraint failed: app_users.key_value_id

2022-06-03 Thread Mukul Verma
StackOverflow URL Please Give Response

https://stackoverflow.com/questions/72485685/django-db-utils-integrityerror-not-null-constraint-failed-app-users-key-value

-- 
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/8cf8f427-268a-49fc-bb1e-6e9e5d528af6n%40googlegroups.com.


Re: beginner

2022-06-03 Thread Mukul Verma
Check Out Django Docs No Worries it will take time but that's so simple 


On Thursday, 2 June 2022 at 23:01:29 UTC+5:30 bod...@gmail.com wrote:

> Greetings
>
> please i am a beginner on django, i need material like video and soft copy 
> reading materials
>
> 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b6bcafa3-a595-4efe-8097-06bafd9d7f3dn%40googlegroups.com.


Facing issue in queryset while creating CRUD API in Django for User Model inherit with AbstractBaseUser

2022-06-01 Thread Mukul Verma
I am creating CRUD APIs so in this question i am asking about the Get all 
data of user using below code in view.py file where i am using 
user.objects.all() but it is showing me error(mentioned below): i need 
suggestions or help to solve this i have also created a Manager file for 
this user [ all files are added in this question ]. how can i fetch all the 
user data from data base using query set.

*Error of the Code:*
Internal Server Error: /wijungleapp/user/ Traceback (most recent call 
last): File "C:\Users\Mukul 
Verma\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\handlers\exception.py",
 
line 55, in inner response = get_response(request) File "C:\Users\Mukul 
Verma\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\handlers\base.py",
 
line 197, in _get_response response = wrapped_callback(request, 
*callback_args, **callback_kwargs) File "C:\Users\Mukul 
Verma\AppData\Local\Programs\Python\Python310\lib\site-packages\django\views\decorators\csrf.py",
 
line 54, in wrapped_view return view_func(*args, **kwargs) File 
"C:\Users\Mukul 
Verma\AppData\Local\Programs\Python\Python310\lib\site-packages\django\views\generic\base.py",
 
line 84, in view return self.dispatch(request, *args, **kwargs) File 
"C:\Users\Mukul 
Verma\AppData\Local\Programs\Python\Python310\lib\site-packages\rest_framework\views.py",
 
line 509, in dispatch response = self.handle_exception(exc) File 
"C:\Users\Mukul 
Verma\AppData\Local\Programs\Python\Python310\lib\site-packages\rest_framework\views.py",
 
line 469, in handle_exception self.raise_uncaught_exception(exc) File 
"C:\Users\Mukul 
Verma\AppData\Local\Programs\Python\Python310\lib\site-packages\rest_framework\views.py",
 
line 480, in raise_uncaught_exception raise exc File "C:\Users\Mukul 
Verma\AppData\Local\Programs\Python\Python310\lib\site-packages\rest_framework\views.py",
 
line 506, in dispatch response = handler(request, *args, **kwargs) File 
"C:\WiJungleEps\wijungleapp\views.py", line 60, in get queryset = 
User.object.all() AttributeError: type object 'User' has no attribute 
'object'

*view.py*
class User(APIView): 
  def get(self, request): 
queryset = User.objects.all() 
serializer = UserDetails(queryset, many=True) 
return Response(serializer.data)

*serializer.py*
class UserDetails(serializers.ModelSerializer): 
   class Meta: 
model = User 
fields = ['username', 'password', 'hardware_id', 
'created_by'] 

*User Model:*
from django.db import models 
from django.contrib.auth.models import AbstractBaseUser 
from wijungleapp.Manager import UserManager 

class User(AbstractBaseUser): 
username = models.CharField(max_length=100, verbose_name="username", 
unique=True) 
password = models.CharField(max_length=100) 
hardware_id = models.CharField(max_length=150, null=True) 
created_by = models.DateField(verbose_name="created_by", auto_now_add=True) 
USERNAME_FIELD = "username" 
REQUIRED_FIELDS = ['password', 'hardware_id'] is_active = 
models.BooleanField(default=True) 
is_admin = models.BooleanField(default=False) 
is_role_vendor = models.BooleanField(default=False) 
is_role_customer = models.BooleanField(default=True) 
 
def __str__(self): 
  return self.username 

def has_perm(self, perm, obj=None): "Does the user have a specific 
permission?" 
  # Simplest possible answer: Yes, always 
  return True 
 
def has_module_perms(self, app_label): 
  "Does the user have permissions to view the app `app_label`?" # Simplest 
possible   answer: Yes, always 
  return True 

def is_staff(self): "Is the user a member of staff?" # Simplest possible 
answer: All admins are staff 
  return self.is_admin 

object = UserManager()

*manager.py*
from django.contrib.auth.models import BaseUserManager 

class UserManager(BaseUserManager): 

def create_user(self, username, password=None, password2=None, 
hardware_id=None):   
 if not username: 
 raise ValueError("UserName is Required !!!") user = 
self.model( username=username, ) user.set_password(password) 
user.save(using=self._db) 
   return user 

# Create Super User Here 
def create_superuser(self, username, password, hardware_id): 
   user = self.create_user( username=username, 
password=password, hardware_id=hardware_id, ) 
   user.is_admin = True user.save(using=self._db) 

   return user


Link of Stack Overflow i had mentioned here too:
https://stackoverflow.com/questions/72443954/facing-issue-in-queryset-while-creating-crud-api-in-django-for-user-model-inheri

-- 
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/96a1cc49-4301-4a16-a525-eae5e537d88cn%40googlegroups.com.


Re: Deploy Tailwind Template with Django

2022-06-01 Thread Mukul Verma
you can create API in Django and integrate in the Template

On Wednesday, 1 June 2022 at 05:22:12 UTC+5:30 Ry wrote:

> Hi I recently downloaded a template from cruip.com
>
> https://preview.cruip.com/mosaic/
>
> I'd like to integrate this template into my django site but admittedly I 
> am not sure where to begin. Does anyone have experience using templates 
> such as the dashboard above on django? In the end, I'd like to deploy to 
> heroku. Is this even possible?
>
>
>

-- 
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/0c384161-2d2b-4ed2-b0ea-ca67e37da860n%40googlegroups.com.