I am using 1.7
--
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 this group, send email to
I'm writing a rudimentary exercise app in django, with the following table
structure:
Routine Exercise Segment
= = =
routine_name exercise_name routine_id (fk)
routine_id exercise_id exercise_id (fk)
order
duration
* (fk) = foreign key
In practice, this looks as follows:
My bad. Put your add_view in views.py (cause it's a view :)
Then, you'll need to import your form into your view:
from oneidentry.forms import HardwareidForm
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and
On Tuesday, October 7, 2014 4:49:04 PM UTC-7, Collin Anderson wrote:
>
> > Am I correct in understanding that using ModelForm example you listed as
> a view does not need to be added to urls then? What is the user access page
> then?
> The add_view would need to be added to your urls.
>
> I
>
> But after that I don't understand how I can use the information in the
> user table (like the pages that the user is allowed to enter) in django
> and how to set it somewhere. And also since I should change the menu to
> reflect that the user can go or not to one page how can I send this
> Am I correct in understanding that using ModelForm example you listed as
a view does not need to be added to urls then? What is the user access page
then?
The add_view would need to be added to your urls.
> So is this two different ways to do the same thing?
The main difference is that it's a
I would personally just use plain python for this. It's totally possible to
group things together using dicts and setdefault(). (Or, since it doesn't
look like speed is an issue, just loop over the whole file every time you
need to get info.)
It may be though that you think a lot more in terms
Hello,
I'd like to emphasize that it is probably a newbie question but I
don't know what are the keyword I should use for googling. So any
information would be helpful.
I'm trying to add a userprofile to my django app. The idea is to use
a sign-in system so that the user depending on
The aim of this exercise is to combine the sample database, click tracking
information from a test website and application, and information from
user's social networks.
The sample database contains the following fields and is made up of 500
records.
first_name, last_name,
Hello,
I am looking for some feedback on a seemingly simple problem.
My advertisement board project have 10+ models, one model per item
category (Cars, Pets, Apartments and so on). The common fields (title,
seller, location etc.) is defined in "MyAbstractModel" and inherited by
all other category
Thanks for the help Collin...I need to read through more of the
documentation it seems! Going through the chapter am I correct in
understanding that using ModelForm example you listed as a view does not
need to be added to urls then? What is the user access page then? Sorry
this is all really
It work's! :)
Thank You!!
now I have:
def password_change_dom(request):
if request.method == 'POST':
form = FormularzPasswordChange(request.POST)
if form.is_valid():
request.user.set_password(form.cleaned_data['password2'])
are they already logged in? use request.user.set_password() and
request.user.save()
--
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
It was like You said, now I see form and when I write password and submit I
have
KeyError at /password_change/
'username'
Request
also, I highly recommend the render() shortcut:
def password_change_dom(request):
if request.method == 'POST':
form = FormularzPasswordChange(request.POST)
if form.is_valid():
user = authenticate(username=form.cleaned_data['username'])
unindent the last bit:
> if request.method == 'POST':
> form = FormularzPasswordChange(request.POST)
> if form.is_valid():
> user = authenticate(username=form.cleaned_data['username'
> ])
> #user =
It looks like it's supposed to only change the slug if the slug was blank
when the page loaded.
https://code.djangoproject.com/ticket/19082
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving
It's :
ef password_change_dom(request):
if request.method == 'POST':
form = FormularzPasswordChange(request.POST)
if form.is_valid():
user = authenticate(username=form.cleaned_data['username'])
#user =
What does your password_change_dom view look like?
--
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 this
I am interested in knowing how other developers implement chained dropdown
lists that are dependent on one another. As an example, I have a page/form
that has two dropdown lists. When I select a value from the first select, I
want the second dropdown to be populated by records related to the first
Hi all
Does anybody know the reason why in django1.7 prepopulated fields is not
changed only after user typed text there? Is that bug or what?
For example
class Post(models.Model):
title = models.CharField('Title', max_length=128)
url = models.SlugField('Url')
class
I have form to change password like below, and when I try to display it I
have an bug:
ValueError at /password_change/
The view dom.views.password_change_dom didn't return an HttpResponse object.
Could you somehow lazy initialize? Somehow auto-initialize things the first
time they are called for?
The other, kind of hacky place to do it is at the top of your urls.py,
which should run on the first request.
--
You received this message because you are subscribed to the Google Groups
Or raise an exception or use print statements.
It could also be that nginx is timing out, but usually it will say that.
You could open up the development tools (right click, inspect element) and
see what error code the network tab says.
--
You received this message because you are subscribed
Would something like this work?
class UserAdmin(admin.ModelAdmin):
list_display = ('email', 'first_name', 'last_name','is_staff',
'phone_no')
def phone_no(self, user):
return user.smsregistration.phone_no
--
You received this message because you are subscribed to the Google
I use this to fix that problem. Run it before you use your first model.
from django import models
models.get_models()
--
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
Using a plan ModelForm in a few to create objects is surprisingly not well
documented :)
https://docs.djangoproject.com/en/1.7/topics/forms/modelforms/
Basically you do something like this:
from django import forms
class MyForm(forms.ModelForm):
class Meta:
model = MyModel
Check this one.
http://stackoverflow.com/questions/23304821/django-ajax-populate-form-with-model-data
also could you please use English in this list ?
Many thanks,
Serge
+380 636150445
skype: skhohlov
2014-10-07 17:58 GMT+03:00 RSS :
> направьте, пожалуйста
> есть
направьте, пожалуйста
есть форма:
1. первый выпадающий список, одна запись которой равна одной модели
2. в зависимости от выбранной модели, остальные поля принадлежат одной
модели
если можно ссылки или примеры
--
You received this message because you are subscribed to the Google Groups
Hi,
I am using the sites framework and finding it very useful but I would
prefer the Site.__str__ method to return the site name instead of the
domain. What is the best way of going about that? Is it reasonable to
monkey patch it or do I need to make my own sites app with a copy of the
code?
Did you find a solution that worked with ModelAdmin.search_fields &
Postgres? I'm running into the same question.
thanx,
-- Ben
On Sat, Jun 28, 2014 at 11:15 PM, Bastian Kuberek
wrote:
> Hi,
>
> Just saw that django.contrib.admin.ModelAdmin.search_fields
>
hello, I wonder if anyone successfully uses the django-admin2[1] in the
production environment
If so, what are your thoughts on the pros and cons based on your experience
of use.
You have a site or blog which records the problems and solutions
encountered when using and customize django-admin2
Den 07/10/2014 kl. 12.57 skrev Helgi Örn Helgason :
> Hi!
> I am quite new when it comes to Django and Python. I am responsible for a
> rather disfunctional Django website package which is rather messy (I have
> this confirmed by an experienced Django/Pyton developer who
Hi!
I am quite new when it comes to Django and Python. I am responsible for a
rather disfunctional Django website package which is rather messy (I have
this confirmed by an experienced Django/Pyton developer who took a look at
it). The system is in use serving a school organisation.
My most
I'm in a situation where the get_defaults method on the RelatedField class
is called but self.rel.to as not been resolved yet and is still a string.
I'm using Django 1.6.6 and I cannot upgrade easily (big number of systems
in production).
Some important stuff :
- the problem appears when I
I have gone through the django tutorial but seem to be lost on how to
create a simple user view page that allows me to add/post/create data
directly to the connected mysql database. I have the models view working
and can access and add items in admin view but not sure how/what is the
best way
Hi!
I am quite new when it comes to Django and Python. I am now responsible for
a rather disfunctional Django website package which is quite messy, to say
the least (I have this confirmed by an experienced Django/Pyton developer).
The system is in use serving a school organisation.
My most
I think I've found the problem.
In my Django version I have in `contrib/admin/sites.py` line 371:
has_module_perms = user.has_module_perms(app_label)
Here it is instead:
https://github.com/django/django/blob/master/django/contrib/admin/sites.py
line 383:
has_module_perms =
I think it’s clear to me what you are trying to do. By overriding those methods
in BarAdmin you go down that line (bypass the django admin permission system),
but to get the app listed in the admin index page you would have to actually
rewrite the view function. This view function makes an
Dear Daniel,
I want to answer to an issue you raised in your previous message.
The Bar model doesn’t appear in the App index list page because the view
> function in charge first verifies whether the user has any of the
> add/change/delete permissions granted for such App, and given that your
>
Dear Daniel,
thank you for your answer.
I think I was not clear enough in explaining my problem. I will try to
rephrase the problem, please tell me if from the first message this point
was clear or seemed different.
I do want that the user is able to add or change some objects. My goal is
to
Hi Andrea,
I answer below in between lines.
On 07 Oct 2014, at 08:53, Andrea wrote:
> Let's suppose I have a Foo app with a Bar model with a owner field. I want a
> user to be able to edit all the instances for which obj.owner == request.user.
>
> The model appears
Hi,
I added an extra field phone number in existiing user model and now I
tyring to access that field by below method,
UserAdmin.list_display = ('email', 'first_name', 'last_name','is_staff',
SMSRegistration.phone_no)
type object 'SMSRegistration' has no attribute 'phone_no'
Please help.
Let's suppose I have a Foo app with a Bar model with a owner field. I want
a user to be able to edit all the instances for which obj.owner ==
request.user.
The model appears correctly in the admin panel for superusers and for users
for which I have explicitly assigned the permission change_bar or
44 matches
Mail list logo