Jimmies San
and thing like that
Jimmies San
or in time
Anonymous
Where can I read something
Jimmies San
and again: one ip but tor.... issues
Jimmies San
you can try to do more check on: browser, header, and so on ... but if you want give privacy to your users that not a good way
Jimmies San
Where can I read something
are you using django rest framework or django alone?
Jimmies San
if you search django anti flood or rate limiting or throttling you find a lot of docs/packages and so on, i think can help you
Anonymous
Yes. All I can that’s check user signups from one ip in some period of time to avoid spam registration
Wang
hello everyone good afternoon
Wang
hello everyone , good afternoon
Wang
i have a litter question
Wang
how to optimize many foreign key in django admin
Komang
+1
Wang
the company models is Foreign Key, but is too many. i have to look up by my eye
Wang
i want to add searbox or other method
Wang
i want to add search box or other method
Wang
who has a good idea
Rohan
icontains
Wang
how to optimize foreign key item too many ?
Wang
icontains
what is that means?
Wang
can i add search box ? if i can how to do?
Rohan
Example > search_param = self.request.GET.get('search') to_be_found=<model>.objects.filter(somequery__icontains=search_param).all()
Komang
who has a good idea
maybe i recommend you make a api service and use js library select2 or other
Rohan
It's a django feature
Rohan
Called icontains and yes, you can perform it on foreign key lookups
inchidi
can you share this employee model admin?
Wang
yup ok
Wang
wait a minut
Wang
https://github.com/jingwangnet/jingwang-data-django/blob/master/data/models.py
Wang
https://github.com/jingwangnet/jingwang-data-django/blob/master/data/admin.py
Wang
i am wrong
Wang
that is right
inchidi
try add raw_id_fields = ("company",) there
Wang
i try
Wang
am i right?
Wang
it's added search box . but it dont able search item
Wang
i got it, but it dont enough me , it only input models' id . i need pattern company name
Wang
i got it, but it dont enough me , it only input models' id . i need it alble search the company name
Django Bot
>> Blogs - Data Filtering in a Django Website using Elasticsearch >> Links - Django Tips & Tricks #10 - Log SQL Queries To Console - Test Driven Development With Python
Django Bot
>> Links - How to reset migrations in Django 1.7 - Stack Overflow - How to Reset Migrations
Klim
Hey
Klim
Can somebody help me? Can Django realize CRUD user with GraphQL? I found a lot examples with CreateUser, but could not make Delete and Update
Mirco
Can somebody help me? Can Django realize CRUD user with GraphQL? I found a lot examples with CreateUser, but could not make Delete and Update
I don't know so much about django-graphene , but can't you use mutation to delete/update user ?
Klim
I don't know so much about django-graphene , but can't you use mutation to delete/update user ?
I tried to do it similar with Create. I used user = User.objects.get(email=email) user.delete() but something went wrong
Klim
my CreateUser class CreateUser(graphene.Mutation): user = graphene.Field(UserType) class Arguments: email = graphene.String(required=True) password = graphene.String(required=True) def mutate(self, info, email, password): user = models.User( email=email, ) user.set_password(password) try: validate_email(email) except ValidationError: raise GraphQLError("Enter a valid email") user.save() return CreateUser(user=user)
Klim
Do you know how to delete it by email?
Mirco
It should be like updating view, something like what you've posted above
Mirco
Graphene-Python http://docs.graphene-python.org/projects/django/en/latest/tutorial-plain/#creating-graphql-and-graphiql-views
Mirco
Look at the Getting single objects I think something like that but deleting the item as you've posted above
Klim
class DeleteUser(graphene.Mutation): user = graphene.Field(UserType) class Arguments: email = graphene.String(required=True) @classmethod def mutate(cls, email): user = models.User.objects.get(email=email) user.delete()
Jimmies San
sorry
no problem :) chan-rules are pinned btw. and with snippets shared in a right way is more easy for us to search online your errors [instead re-copy them] and so on :) or try your code in our app and so on
Mirco
https://stackoverflow.com/questions/46111514/field-me-of-type-user-must-have-a-selection-of-subfields
Mirco
The answer can clarify your issue
Mirco
Try to put user into your query
Mirco
After deleteUser(...) Something like mutation{ deleteUser(...){ user } } Sorry if I cannot use pastebin at the moment
Anonymous
What do i need to learn before i can create apis on djang
Jimmies San
What do i need to learn before i can create apis on djang
it depends what kind of API . but django and django rest framework, and for sure how http protocol works and its standard are a good start.
Jimmies San
please Elucidate further
API can be RESTful or SOAP, for example, or GraphQL - or none of those [you can write an API and if is well documentend it's ok maybe for your use case] http protocol [how it works, method like post or get and so on, status like 200 404 and so on] and the rfc about web too :)
Jimmies San
Odoo for example use a SOAP api [it's a python openerp]
Anonymous
Ok thanks
Jimmies San
you're welcome
Robert
Hey all. What are the drawbacks of using select_related and prefetch_related?
who is
hi guys. I am in the midst study django apps in existing production server (centos). I am looking for guideline for me to view django app sourcecode in existing system. any one can guide me how to do so?
who is
the existing system located remotely and i do have access right to access centos
ʚɞÇherry Łoveʚɞ
who is
yeah.. django apps has been setup by another company