Pavel
«dirty fields» means fields which were updated the last time
Pavel
Ok, I’ve shortened the code snippet to the link: http://paste.org.ru/?c067jx
Pavel
I need some equivalent in Django world for this
Pavel
Oh, it seems like I found something: https://pypi.org/project/django-observer/
Randy
https://github.com/alechries/MyHouse24Django/blob/master/MyHome24/apps/_db/models.py#L87 I make migrations and have exception: django.db.utils.OperationalError: no such table: _db_user _db - app user - custom user model
Randy
you modified db externally?
I'm doing the first migration
Randy
you modified db externally?
Have only - migrations - - __init__.py
Tukhtamurod
I'm doing the first migration
how did you create custom user model?
Tukhtamurod
I'm doing the first migration
if you are doing first migration, try deleting migration folders in every app, delete dbsqlite3 file, and run: python manage.py makemigrations python manage.py migrate let me know if it doesnt help
Tukhtamurod
I do this. I return old default user and there is still this exception Its problem with User only
how did you return to default user? if you defined custom user, after deleting all migration files and db file, first run python manage.py makemigrations <app_name> Here the app is the one where you defined custom user model, first makemigrations on this this app, and then do other migrations
Tukhtamurod
if it again shows error, i dont know in this case, you should have done smth wrong, because this should always work
Anonymous
hello can someone help me?
Anonymous
i want to to give permission to users for seeing my webpages
Anonymous
but i cant
Anonymous
who know this?
Tukhtamurod
but i cant
have you tried?😅
Anonymous
i have models permission
Tukhtamurod
yeah
what did you do?
shashikant
i want to to give permission to users for seeing my webpages
Create a super user and then go to admin page then you can give permission to any user you want to.
Anonymous
they shouldnt use admin page
Anonymous
what did you do?
in my permission i have code and name
Tukhtamurod
they shouldnt use admin page
any user that is not a super user, cant use admin page
Tukhtamurod
if you mean different admin page, then there is a field is_stuff to use
Anonymous
any user that is not a super user, cant use admin page
for example i have two user first should show index
Anonymous
second have to show shop
Anonymous
like this i have to do
Tukhtamurod
i cant explain fully😔
for a particular url user visiting, you want to return different templates according to whether the user is admin or not, right?
Tukhtamurod
for a particular url user visiting, you want to return different templates according to whether the user is admin or not, right?
if this is the case, in your view function just do: if request.user.is_stuff: return render(request, "shop.html", context) return render(request, "index.html", context)
Anonymous
for example when a user visits a website they should see what I allow and not what I do not allow
Anonymous
can u understand me?
Tukhtamurod
for example when a user visits a website they should see what I allow and not what I do not allow
🤦‍♂️🤦‍♂️🤦‍♂️it depends on what type of users you have, for example admin or not admin
Tukhtamurod
for admin or not admin case, django's built in User model is enough
Anonymous
i will create users and i want to add type of users
Bekhruz
i will create users and i want to add type of users
https://youtu.be/eBsc65jTKvw Watch this
🏁 🏁 🏁
is it possible to hide what is displayed via Django in the source code (view-source)?
Anonymous
for example stuff should see only shop and cashier should see only cash page and admin can see all pages
Anonymous
but i dont want like that
Anonymous
class Permission(models.Model): kod = models.IntegerField() name = models.CharField(max_length=255)
Anonymous
i have this
Anonymous
class Daraja(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) chois = ( ('Kassir', 'Kassir'), ("Sotuvchi", "Sotuvchi"), ("Omborchi", "Omborchi"), ("Admin", "Admin"), ("Call center", "Call center"), ) status = models.CharField(choices=chois, max_length=255, default="") permission = models.ManyToManyField(Permission)
Anonymous
and i cant do in views
Anonymous
how to send
Tukhtamurod
what does permission do here?
Tukhtamurod
you need to study database concepts first, it is in complete mess
Anonymous
do u have videocourse?
Tukhtamurod
alright, try to understand I will tell you one way: 1. create UserType table, add all the types you have class UserType: name = models.CharField(choices=choices, ......) 2. create Relational model UserOfType: class UserOfType: user = models.OneToOneField(User, ......, related_name="type") type = models.ManyToOneField(UserType, .......) then in your view function you can identify user type using user.type.type.name
Anonymous
thanks i'll try
190032029
i ma unable to install django in my pycharm could you guys please help me out in doing it ??
190032029
thank you
Roman
Can someone explain me how do we deal with migrations when a few people work on the project ?
Jay
I am not getting a URL from django server
Jay
Yes it is happening
Vinay
Which framework is Best and Beneficial for making API :- Django vs Django Rest Framework
Sujit
django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. anyone know about this (using vs code)?????
Vinay
Plz reply
Vinay
Which framework is Best and Beneficial for making API :- Django vs Django Rest Framework
Devu
Django Rest Framework
Maset
Is there any way to use our GitHub repo itself as a simple S3 bucket?
Maset
S3 is different from github
Any modules for that?
Rohan
Any modules for that?
For what exactly?
Rohan
Why’d you use “github” to replace S3?
Rohan
That’s actually not a smart thing to do
Maset
I have a simple project and I need a S3 bucket and I don't have enough credit for purchasing one so
Rohan
Object level encryption, object level public private access? There are n number of issues that will come forth