Send the code
On Thu, 27 May 2021, 2:14 am sourav panja, wrote:
> object has no attribute 'is_valid'
>
> --
> 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 d
hi,
i think this can help you..
https://www.youtube.com/watch?v=nh1ynJGJuT8
*Best regards,Raghavendra AKCell: +91 7676 363642*
On Thu, Dec 3, 2020 at 3:15 PM Eugene TUYIZERE
wrote:
> Dear Kasper,
>
> Thank you very much for your reply. Actually I did not deploy anyweb app.
> The strong sec
Users must be able to…
1. signup. A Company should be created.
2. create other users in the same company.
3. see a list of users from the same company
4. Company can view all users data.
5. Company can create Department,
6. add new users, that users only related main company
7. add roles to user(
I'm training to implement keycloak with django using
https://github.com/jhuapl-boss/boss-oidc but getting error : *Could not
import 'path.to.function' for API setting 'LOAD_USER_ROLES'.
ModuleNotFoundError: No module named 'path'*
I really appreciate your help or any sample code
--
You receiv
Update your Python to version 3.8.
Met with the same issue and this worked for me.
On Wed, 8 Jan 2020, 21:43 Cristhiam Gabriel Fernández, <
cristhiang...@gmail.com> wrote:
> 3.8? 🤔
> Did you mean 2.2.8?
> Yes, 2.2.8 works fine.
>
> El miércoles, 8 de enero de 2020, 3:11:14 (UTC-5), Alfredo Silve
PyCharm is fantastic in terms of code completion, linting etc and if you're
a student, you might get their professional edition for free as well.
Please note that they have a community edition that is open source.
On Wed, 6 Nov 2019, 18:26 Kasper Laudrup, wrote:
> Hi Himanshu,
>
> On 06/11/2019
In my Django web app (running on Google App Engine), when a new user signs
up a User object is created and then that user is authenticated and logged
in. Every once in a while, the login function throws an exception
(DatabaseError: Save with update_fields did not affect any rows) and I'm
not
Please try to use the *traceback* option:
>>> python django-admin.py startproject mysite --traceback
Maybe we will get some additional info...
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emai
I am trying to use Valum's Ajax Upload to do file uploads on a Django-
based site I am making. Currently I am avoiding a form simply because
AU sends the upload as the entirety of the POST data in an ajax
request. Right now I have a very naive approach to doing this:
upload = SimpleUploadedFile(
t, required Django 1.3. They have added file-like
support for reading directly from HttpRequest so I took advantage of
that.
with BufferedWriter( FileIO( "/tmp/foo.bar", "wb" ) ) as
destination:
foo = request.read( 1024 )
while foo:
destination.write( f
I have not yet found a solution for this, the closest I've come
requires a bit of work based on James Bennett's response here:
http://markmail.org/message/irsln5d6m6wpxdiu
An alternative that looks slicker than the Django built-in is the
django-ajax-selects project: http://code.google.com/p/django
I really like the 'filter-horizontal' style widget used by Django
Admin for things like specifying permissions for users/groups. I
would like to create a form that uses this same widget to allow
someone to select a group and then edit which users are in the group
based on this widget. The catch f
I really like the 'filter-horizontal' style widget used by Django
Admin for things like specifying permissions for users/groups. I
would like to create a form that uses this same widget to allow
someone to select a group and then edit which users are in the group
based on this widget. The catch f
>From what I can tell in the documentation, a post_save signal only
passes sender, instance, created, and using. I would love to use this
signal to update information in the instance, such as the datetime of
when it was saved. This would be fine, except that I want to also
keep track of the user
I've been investigating the localflavor mod and I'm wondering how to
apply it to my situation, or at least learn *if* it can be applied.
A simplified example would be I need a user to enter an address. The
user could be from any number of countries so I want the form to to
able to validate, say,
Sorry, this:
On Jan 31, 3:24 pm, "ak" <[EMAIL PROTECTED]> wrote:
> FormClass.base_fields['foreign_key_field'].widget =
> forms.ChoiceField(choices=[(obj.id, obj.name) for obj in
must be:
FormClass.base_fields['foreign_key_field'] =
forms.ChoiceFi
You can create your own ChoiceField with your own set of choices and
replace default property to your own
For example:
FormClass = forms.models.form_for_model(MyModel)
FormClass.base_fields['foreign_key_field'].widget =
forms.ChoiceField(choices=[(obj.id, obj.name) for obj in
MyModel.objects.filt
Guys, take a look here: http://code.djangoproject.com/ticket/3370
it seems to be the solution, but needs to be tested in all environments
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Same thing with national characters ...
DEFAULT_CHARSET = 'utf-8'
I think this is a bug somewhere in newforms
On 25 Янв., 23:10, "Christian Schmidt" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've got a problem with putting non unicode signs into a mysql table.
>
> I get an UnicodeEncodeError when an
Umm please read "complex" as "complete" :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, sen
[EMAIL PROTECTED], either you don't understand me or I don't
understand you.
> I misspoke earlier. I said you could specify a Select widget for a
> CharField to get that output. I don't know if that will actually work
> (you could try it)
>
> field3 = CharField(widget=Select(choices=))
Yes BU
> field1 = CharField(max_length=10, widget=HiddenInput)
Thanks :)
I've also found another way, but it seems dirty:
MyForm.fields['some_field'].widget.input_type = 'hidden'
> As for the FloatField, I can't think of any way to get a float value
> out of the default clean() method, but you can over
P.S. I tried:
>>> MyForm.fields['some_field'].widget.is_hidden = True
but ...
>>> MyForm.fields['some_field'].widget.render('a', 'b')
u''
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To po
Sorry, could you provide me an example of how to make a field to be
displayed as hidden ?
I've looked through the code (i have the latest svn on my pc) but it
doesn't seem to be clean for me.
And please take a look here:
http://code.djangoproject.com/browser/django/trunk/django/newforms/fields.py
Well I've got success after applying a patch to django's code.
Actually there are 2 patches against django/db/backends/mysql/base.py:
1. it forces to run SET NAMES 'utf8' after connection. This is wrong,
and I replaced it with SET NAMES 'cp1251'. Ofcourse, it should be a
setting in settings.py but
Hello again
It seems like newforms library has a problem with non unicode charsets
yet.
For example, I use 'windows-1251' character set for my web apps and
MySQL 4.1 with 'cp1251' so actually all data is stored and shown in
cp1251.
And here's what I get when try to save any form with national (n
Hello everyone
I don't see FloatField and HiddenField field types in newforms. Is it
ok ?
How to implement then ?
And also: oldforms has a nice feature to convert
CharField(choices=(...)) to dropdown () with
predefined options, newforms displays it as , I
think this is not ok. Isn't it ?
--~-
Wow thanks, it really works as expected
I've started to write my own patch already :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegr
Adrian, is there any progress on correct handling of foreign key fields
in newforms ? Or could you please give any timeline when this might be
expected to be done ? Even up-to-date svn gives the same error when
trying to save a form with foreign key field.
Also, whould it be possible to do someth
Well
I think the name FloatField was choosen wrong then. As for me - if it
sounds like "float", it must be compatible with python's float.
And the worst thing is that it can't compare itself to python's float
correctly. So may be just overload appropriate operators to make it
behave more int
Here it goes:
http://groups.google.com/group/django-users/browse_thread/thread/394701c83497e405/c1ccb16828a6bf8a?lnk=gst&q=php+django&rnum=36&hl=en#c1ccb16828a6bf8a
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "D
Sorry for typo - I meant "not very well for him"
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this gro
You can search through this mailing list, I remember one guy about a
few months ago that compared django development to his previous php
expirience and found that django is now very well for him.
Unfortunatelly I have no link and I don't remember what it exactly was
about but it definatelly happe
A bit more info:
print user.tariff.monthly_fee.__class__, user.balance.__class__,
user.tariff.monthly_fee, user.balance, user.tariff.monthly_fee/3 >
user.balance
displays:
180.00 1846.85 True
while 180/3 = 60 which is ofcourse less than 1846.85 so it should
display False in the last column
Ok gotcha :)
I ran the following:
print user.tariff.monthly_fee.__class__, user.balance.__class__
and got the output:
Then i did some more investigation and found that tariff.monthly_fee is
actually defined in mysql as `monthly_fee` decimal(10,2) NOT NULL
default '0.00', but Django's types
Malcolm Tredinnick wrote:
It's difficult to understand this without knowing more about the initial
problem. What are the types and values of the user.tariff.monthly_fee
and user.balance?
Well I thought it was clean from the subject line.
Both values are FloatField(max_digits=10, decimal_plac
Hello everyone and merry x-mas :)
I am not sure but it looks like I've found a bug. When one uses
FloatField instances in a math condition with python's float() it gets
unreasonable results.
For example I got the code:
if user.tariff.monthly_fee/3 > user.balance:
send_alert()
and in result t
John, app_label made it work. Thanks !!!
P.S. Is there a line in django docs about that ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@goog
Malcolm, my models are imported into application,models and do have
Admin inner class. Take a look:
1. Model:
$ cat subnet.py
# -*- coding: windows-1251 -*-
from django.db import models
class Subnet(models.Model):
address = models.IPAddressField()
mask = models.IPAddressField()
clas
Hello guys
Today I discovered a strange problem which may be caused by my
misunderstanding or by a bug in django and i would like to shed some
light on it with your help.
I have models package `mycompany.models` where are defined all the
models for all our apps. Same classes are used in a few ap
Sorry guys it was my stupidity :)
I should have written
{% load news_tags %}
instead of
{% load "news_tags" %}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send ema
Hi everyone
I wrote a small templatetags library (just one tag), put it into
existing app directory (into subdirectory templatetags), added
__init__.py there but after I added to my templates:
{% load "news_tags" %}
{% latest_news %}
django shows me an error:
'"news_tags"' is not a valid tag libr
Ok found the answer myself. I added at the bottom of content block:
{% if flatpage.enable_comments %}
{% load comments %}
{% free_comment_form for flatpages.flatpages flatpage.id %}
etc ...
--~--~-~--~~~---~--~~
You received this message because you are subscri
Hello guys !
Could anyone please tell me why I don't see comments bellow the page
when I click on "enable comments" in admin for a flat page ?
Should it be enabled by adding:
{% load comments %}
{% free_comment_form for . %}
to the flatpages/default template ?
--~--~-~--~~--
Yeah you're right :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROT
Thanks a lot but to be honest I already found the answer by looking
into django/conf/settings.py source code :)
I hope django guys will write the complete manual some day and noone
will need to look into their sources
--~--~-~--~~~---~--~~
You received this messag
Hello All
I found that I can set mime type for generated templates by simply
writing in my views:
return HttpResponse(t.render(c), mimetype='text/html;
charset=windows-1251')
This is for example if I want russian-only service without i18n. But I
can't find a similar option in render_to_response
Sure that's what I used to solve the problem :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group
Ohh thanks guys, my fault !
I've ran
python manage.py sqlall polls
and it has shown me that I missed some sql stuff that inserts records
into django admin tables
Thanks a lot!
p.s. really django rocks. I used to use my own python library to
develop sites that includes MVC stuff and OR-mapping f
Thans for your answer Jason but I think you are wrong. As far as I know
"python manage.py install polls" should create all tables in my DB. It
was done and I can sucessfully load entities from database, modify them
and save them back and I see all these tables and records in mysql.
Even things fro
Hello guys
I have a problem with walking through the second official django
tutorial (http://www.djangoproject.com/documentation/tutorial2/). The
problem is as follows.
I have sucessfully logged in to the admin area, then clicked to the
Polls and see my polls list. But if I click to edit a poll o
51 matches
Mail list logo