Sopan
>>> generate_activationcode(size=13, chars=string.ascii_uppercase)
'CGGTOEEWFCFLS'
Mirco
sarth
how make drop down choices dynamic directly from database table without using foreign key in model form in django... please help me
Anonymous
Sopan
?
Sopan
Exactly - what's your exepcted output?
Anonymous
?
Like I want the digits to have 62 prefix..like start with 62
Anonymous
>>> import string
>>> import random
>>> def generate_activationcode (size=8, chars=string.digits):
... return ''.join(random.choice(chars) for x in range(size))
...
>>> generate_activationcode(size=13)
'622322362793234'
>>>
Devo
'62'+str(output)
Sopan
>>> def generate_activationcode (startwith = '62', size=8, chars=string.digits):
... return startwith + ''.join(random.choice(chars) for x in range(size))
...
>>> generate_activationcode(size=13)
'624559601622556'
>>>
>>> generate_activationcode(size=13)
'621689269700276'
>>>
Anonymous
Ow, thanks
Ganesh
why am i getting error of AttributeError at /admin/main/consultation/ 'NoneType' object has no attribute 'lastname' in my admin page when i click on consultation
https://dpaste.org/B5sz
shashikant
i have account models and function here
shashikant
https://del.dog/isitulyvam
shashikant
i am currently getting this error:
shashikant
ValueError: Cannot assign "<Account: Account object (9)>": "Token.user" must be a "User" instance.
shashikant
https://del.dog/ijyneriniv\
shashikant
even this does not work
Inuk
shashikant
it will return the last object
shashikant
i have replaced with instance,but still the same error
Mo
Hi if we have a python model and want to request for receiving information from user and sending back the model output into that link based on the inputs and the model, what is the best structure and way for this? (in django rest framwork api)
Saikat
Does anyone have good idea about how to write django test cases with pytest
__init__
can install php to my computer and be able to run php script inside a python container ???
Mirco
__init__
it simple in php
odin
I need to add a ML model in my django project. How can i create endpoints using django rest framework?
Anonymous
Есбол
hi
how to change UserCreationForm error message (to other language)
Adnan
Any one Setup XMPP in django
Anoop Pratap
Which one would be better to integrate with angular or react?
Doragonsureiyā
Any one Setup XMPP in django
Step 1: Open a browser
Step 2: Write down https://google.com or https://duck.com and press Enter
Step 3: In the search box, write down the same words you asked here
Step 4: Read the first results
Doragonsureiyā
Please provide a full explanation including all the details that you consider relevant. Your statement is too broad and there is no clear way to answer you, you have to explain:
- what you're doing
- what you're expecting
- what you're using
- where you're running the script
- what Python version you're using
- what packages and their versions you're using
- and the most important thing: show the code YOU wrote (read rule 5️⃣ for that)
and more details, that way your chances to get help will increase
Armin Habibi
Anonymous
why is this not saving cveid ? https://dpaste.org/EVDf#L82,86,87,88
Harish
class TempModel(models.Model):
x = models.IntegerField(...)
def __init__(self, *args, **kwargs):
if self.x < 0:
self.y = "Negative"
elif self.x == 0:
self.y = "Zero"
else:
self.y = "Positive"
I would like to initialise a new variable y for every object of the Django model TempModel without creating a field in the database.
Adding a variable y to a normal python class on init is possible, does this extend to Django as well? If it does, how does one go about doing that?
Michael ✨
Hi, sorry for the trouble, does anyone know why I'm getting this error?
Michael ✨
https://pastebin.com/vixjLHWg
Michael ✨
I'm trying to upload my project to GitHub but it gives me that error, I already tried to increase the buffer to 54 ..., but it won't let me upload it
Michael ✨
I am trying to upload my Django project to github but I get that error
Zey
if i am creating my form i html then how i can do form validation?
Anoop Pratap
If u want to show the error to the user then u need to do validation both on client (js) and server side
Zey
Zey
normally we use is_valid function but I cant use that bcz i am creating my form in html so I am askinh is there any way to use is_valid function
Agent Q
Zey
it is inbuild function for form validation
Anonymous
hello can i filter foreign keyed product status?
Sai
Sai
Anonymous
thanks! it worked
Mayur
https://dpaste.org/p3JP
Mayur
could anyone help me..?
Ankit
I need a Web app developer
Anonymous
Ankit
Is there anyone who can develop e-learning web app in 30$ .
Ankit
I really need professional developer
Anonymous
Ankit
Yes cos most of the features are already completed
Mousiol
Ankit
Just need to improve design and learning experience
Ankit
Anonymous
Does any one have django related work.
Anonymous
For experience I need some work
Anoop Pratap
DD
How can I implement real time database update in django
Right now I am working on a web application which displays live stock market data from api
I want to fetch data and store in db every 1 minute so the data should be refreshed in real time manner
.
Hi there. I have a question, why we need Profile model, why we can't put all information in User, I mean custom user .
Abdalwhab
i need add (phone, code-phone, password) to login > how i can do that....
Crack
Hello everyone i need help in django+ajax
Anonymous
Please I can I solve this import problem on window
File "C:\Users\HP\Desktop\biblepod\Biblepod\people\urls.py", line 3, in <module>
from . import views
File "C:\Users\HP\Desktop\biblepod\Biblepod\people\views.py", line 5, in <module>
from .serializers import PersonSerializer
File "C:\Users\HP\Desktop\biblepod\Biblepod\people\serializers.py", line 4, in <module>
class PersonSerializer(serializers.Modelserializer):
AttributeError: module 'rest_framework.serializers' has no attribute 'Modelserializer'
Anonymous