Hi,
I have a form that contains a question and a multiple choice answer field.
For example:
What is your favorite color?
- Blue
- Green
- Red
- Yellow
I render the page with a list of forms (or I guess formset?) and loop
through them. So something like this.
for form in formset:
class PollForm(forms.Form):
answer = forms.ChoiceField(
widget=forms.RadioSelect,
choices=cool_choices)
def __init__(self, poll, *args, **kwargs):
super(PollForm, self).__init__(*args, **kwargs)
b = poll.choice_set.all()
list_choice = []
fo
For example:
class AnswerInLine(admin.TabularInline):
model = Answers
class QuestionAdmin(admin.ModelAdmin):
inlines = [AnswerInLine]
I want to change the model in the AnswerInLine depending on what the
QuestionAdmin value is
--
You received this message because you are subscribed
M UTC-5, Matemática A3K wrote:
>
>
>
> On Wed, Nov 22, 2017 at 3:21 PM, test >
> wrote:
>
>> For example:
>>
>> class AnswerInLine(admin.TabularInline):
>> model = Answers
>>
>> class QuestionAdmin(admin.ModelAdmin):
>>
Let's say I have:
Calculator #1:
Expression: (True AND False) AND (True OR False)
This expression should be a child of some calculator.
class Calculator(models.Model):
name = ...
class Expression(models.Model):
parent = models.ForeignKey(Calculator)
boolean = AND or OR
sub_exp1 = models.Fore
to efficiently
> store
> such data.
>
> Cheers,
> Simon
>
> [0] https://djangopackages.org/grids/g/trees-and-graphs/
> [1] https://www.postgresql.org/docs/current/sql-createtype.html
>
> Le mardi 18 février 2020 18:13:39 UTC-5, test a écrit :
>>
>> Let's
Hello,
What is the best way to add class css for a label in Charfield form?
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...@googl
When I save my model, there is no effect in database.
What is the problem?
class Profil(models.Model):
user = models.OneToOneField(User)
in manage.py shell
>>> p = models.Profil.objects.get(user__username='testname')
>>> p.user.is_superuser
False
>>> p.user.is_superuser = True
>>> p.user.i
Le mardi 21 juillet 2015 10:55:19 UTC+3, Info Test a écrit :
>
> When I save my model, there is no effect in database.
> What is the problem?
>
> class Profil(models.Model):
> user = models.OneToOneField(User)
>
>
> in manage.py shell
>
> >>> p
Even with p.save(force_update = True) , it doesn't work
--
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 post to thi
Any error appear on console, is it possible that only superuser can do that?
--
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...@googlegroup
Thanks for all your answers.
Solution :
http://stackoverflow.com/questions/31534715/cant-update-extended-user-django-model
--
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
I can access to django-console app with:
127.0.0.1:8000/admin/console.
How to link this with href = "url " in template
--
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
Thanks everyone for the clearance of the problem. I will remove the unit
test's logic to check fir template, it seems a viable test case along with
the status code value.
On Fri, Mar 29, 2019, 2:24 AM Chetan Ganji wrote:
> There is one more way you could do it
>
>
> class
*
===
python superlists/manage.py test
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
.F.
Destroying test database for alias 'default'...
===
Sorry for the bother but I finally solved it by using Django's Test Client
and checking for status_code and template used to render the response in my
unit-test.
Regards,
Test Bot
On Sat, Mar 30, 2019 at 5:00 PM Test Bot wrote:
> I tried removing the {% csrf_token %} from my index.htm
+1
DoesNotMakesSenseError("Author of any comment should not be related to the
currently logged in user")
On Mon, Apr 1, 2019, 7:09 PM Joel Mathew wrote:
> This does not make sense to me. A model is not a dynamic entity. It is
> something that's created beforehand. Getting the current username in
The issue here is you have a web app and you expect a desktop application.
This should be asked on a GUI-Framework mailing list.
You can call your APIs from that desktop app instead of writing the same
code again(DRY).
On Tue, Apr 9, 2019, 8:42 PM Julio Cojom wrote:
> Django Is a web applicatio
The part you want to understand is same as ORDER BY clause in SQL. The
slicing will provide only the top 5 results. By default the order_by sorts
in ascending order only. But providing a "-" would make it to sort in
descending order.
On Fri, Apr 12, 2019, 6:56 PM Mayur Bagul wrote:
> Hello coder
That is because
Question.objects.order_by("-pub_date")
would give you a list of all records so you can simply apply slicing
without the use of . operator.
For understanding purpose, you can break down your code as
result = Question.objects.order_by("-pub_date")
> latest_question_list = result[:
It means your remote has some changes that are not there in your local so
when you are pushing, git is unable to merge those changes.
Try a git pull then local merge and then push. Feel free to ask in case of
any queries.
On Thu, Apr 18, 2019, 6:58 PM Mayur Bagul wrote:
> Hello Community,
>
> i
Okay so there is no need to go to different websites if you want to install
a Python module. You will find almost everything related to Python modules
in pypi.org, it includes everything like installation instructions, gut
repo for the packages etc
On Wed, May 15, 2019, 11:57 AM Balaji Shetty wro
Did you check your firewall settings?
On Thu, May 16, 2019, 6:37 PM Rob W wrote:
> First, you should not share your password to your server to anyone….thats
> very dangerous. Now anyone can log in to your server with nefarious
> intentions.
> Be more careful.
>
> But it sounds like something on
Try putting encrypt="multipart/form-data" in your form tag
On Thu, May 16, 2019, 6:05 PM Sipum wrote:
> Hi Friends,
>
> when retrieving file that is uploaded , I'm getting multiValueDictKeyError.
> Below are my codes. I have proided some codes where I m getting error.
> could anyone help me here
So one check would be to see all the connections that are allowed by your
firewall.
On Thu, May 16, 2019, 6:45 PM omar ahmed wrote:
> no but can it struggle it ?
> how can i check it
>
> On Thursday, May 16, 2019 at 3:09:55 PM UTC+2, OnlineJudge95 wrote:
>>
>> Did you check your firewall setting
Hi
In models you have to define your database tables as class and any response
to the user should be handled in views.py
You can introduce randomness via random module or for any customisation you
can write it as a different app altogether.
You can create your coin as a separate model and attach
[Just Curious] would it matter in any way what the position of field is in
the respective tables.
On Fri, May 17, 2019, 5:46 PM 'Akash Sinha' via Django users <
django-users@googlegroups.com> wrote:
> Hello
>
> This happens for 2 reasons
>
> 1st. Those fields might be Foreign key, Foreign key fie
Hi,
I have got multiple user types(around 4 to 5) in my Django project. Should
i make separate Django app for each user type? Each user type will have
different interface after they log into the website.
--
You received this message because you are subscribed to the Google Groups
"Django user
ntation in django for further
> details.
>
> I hope this helps.
>
>
>
> On Sun, Oct 13, 2019, 8:33 PM test user >
> wrote:
>
>> Hi,
>>
>> I have got multiple user types(around 4 to 5) in my Django project.
>> Should i make separate Django app
Hi,
I am new to django and am trying out the tutorial. Get the following error:
1. Create a virtual environment using anaconda
2. Activate the virtual environment
3. Create the project
4. Get the following error when trying to start the server:
Directory of C:\Users\bradl\Documents\web sites\poll
30 matches
Mail list logo