Hi. I have changed views.py last line to this:
return render(request, 'assumptions.html', {'formset':
formset,'model_names': model_names,'name': name})
As a result, it outputted more forms, however they do not save to model
forms to database and raise
Validation Error ['ManagementForm data is
if there is any vacancy in your companies please let me know
--
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
Hi!
Close code 1006 means that the connection was closed abruptly by the other
end (basically, the socket just got chopped off without an actual close
frame being sent).
This is what happens when you close during the handshake, which is what
closing during connect() does - at that point, the
Can anyone please check this link, and let me know the solution please?
https://stackoverflow.com/questions/51002890/why-am-i-not-able-send-through-async-to-sync-asgiref-2-3-2
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe
I'm not sure why that would happen - the code that chooses what application
instance to use is here:
https://github.com/django/asgiref/blob/master/asgiref/server.py (under
get_or_create_application_instance).
If you're always using a single channel name, which gets passed as scope_id
(see here:
Thank you for your reply. I removes all the migrations and dropped the
database. Now when I try to make migrations i get the following error in my
terminal.
Thanks and regards,
Saloni
*Error:*
accounts.User.user_ptr: (fields.E301) Field defines a relation with the
model 'auth.User', which has
I'm trying to show my ValidationError from clean_MY_VALUE in the template.
*template*
{% csrf_token %}
{{form.as_p}}
Submit
{{ form.errors }}
{{ form.non_field_errors }}
*views.py*
def MY_VIEW_CLASS(request, MY_ARG):
MY_ARG = "query to check for silly conditions"
if
I am trying to build a feedback application for the teachers by the
students. I have a proxy User that will the student. But I am not able to
assign the user to the feedback model. I am a newbie. Please help.
Thanks and regards,
Saloni
*models.py:*
class User(auth.models.User,
On zaterdag 23 juni 2018 10:52:09 CEST Saloni Kalra wrote:
> https://github.com/salonikalra/feedback
> This is a feedback application for teachers by the students. I have been
> constntly getting the following error:
> ValueError at /feedback/by/feedback/new
> Cannot assign "": "Feedback.user"
am having below error now can anyone help me with this
[23/Jun/2018 05:59:32] "GET /contact/ HTTP/1.1" 200 11440
Not Found: /contact/contactform/contactform.js
[23/Jun/2018 05:59:34] "GET /contact/contactform/contactform.js HTTP/1.1"
404 16
637
Not Found: /contact/contactform/contactform.js
This is likely not the answer you're looking for, but my two cents...
I've never been successful in writing the templates for formsets on my own,
as they tend to end up looking rather clunky. I've been using this
SOLVED.
https://stackoverflow.com/questions/50997267/django-pass-value-from-view-to-non-model-form/51002442#51002442
thank you for pointing me in the right direction
On Friday, June 22, 2018 at 9:37:26 PM UTC-4, HashRocketSyntax wrote:
>
> When I call my form in my view, I am trying to pass
Looks like I was missing an `initial` inside init... 0_o
https://stackoverflow.com/questions/1993014/passing-kwargs-to-django-form
On Friday, June 22, 2018 at 9:37:26 PM UTC-4, HashRocketSyntax wrote:
>
> When I call my form in my view, I am trying to pass MY_VALUE to the form
> as an
It seems to like that! `(arg1, OTHER_VAL=OTHER_VAL)
Now I'm trying to access that other_value:
def __init__(self, *args, **kwargs):
OTHER_VAL = kwargs.get('OTHER_VAL') #tried these: #kwargs['OTHER_VAL']
#kwargs.pop('OTHER_VAL')
super(MY_FORM, self).__init__(*args, **kwargs)
Keep
Indeed! I have actually used the admin site to do it before I posted this
it's just something I didn't know was by design. After numerous searches I
came here but I may have been asking the wrong questions in google :).
The shell would be good if I have quite a few I need to delete. Thankfully
https://github.com/salonikalra/feedback
This is a feedback application for teachers by the students. I have been
constntly getting the following error:
ValueError at /feedback/by/feedback/new
Cannot assign "": "Feedback.user" must be a "User" instance.
Please help.
Thanks.
--
You received this
You get that error because you use kwargs.pop (presumably that's why)
and you pass OTHER_VALUE as a positional argument.
E.g.
MY_FORM(request.POST, OTHER_VALUE=OTHER_VALUE)
would pass it as a keyword argument and then you can
use kwargs.pop('OTHER_VALUE') in the form's init.
On Fri, 2018-06-22
What does the method session.keys() do or particularly that keys() method
--
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
If you search about it on the Internet many sources claim that Django
does not set those constraints on the database level.
If you look at the code of the base code for database backends, you'll
notice that they don't mention on_delete at all. - https://github.com/d
well, nothing stopping you from doing the same in the django shell and
doing `Group.objects.get(pk = some_pk).delete`. that would be an
alternative for going straight to the db.
I can see some issues with this coming up, especially if you're doing
deletes with django's raw sql capability.
OK. So it's by design.
So during development I can't go straight to the database and delete a
"Group" quickly due to an error I made. I'd have to set up tests to deal
with it at an application level.
No probs though. I'm just happy I know it can't be done and not that it's a
bug I'd have to
On zaterdag 23 juni 2018 14:40:30 CEST Jason wrote:
> Not quite. If you run python manage.py sqlmigrate
> , you can see the SQL generated for that migration.
>
> https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-sqlmigr
> ate
>
> Because Django emulates Cascade, its done
On zaterdag 23 juni 2018 14:30:08 CEST Mikkel Kromann wrote:
> In models.py:
> def GetItemPaths():paths = [ ]
> for i in [ 'Model1', 'Model2', 'Model3' ]:
> p = path( i + '/list/', ItemListView.as_view(model=i), name=i +
> '_list' )
> paths.append(p)
>
> return paths
Not quite. If you run python manage.py sqlmigrate
, you can see the SQL generated for that migration.
https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-sqlmigrate
Because Django emulates Cascade, its done outside of the db, and therefore
shouldn't be a db-level constraint.
So, I think I have a neat idea for solving my problem, simply make a
function which returns a list of path() returns.
In urls.py
urlpatterns = GetItemPaths() + [
# other paths
]
In models.py:
def GetItemPaths():paths = [ ]
for i in [ 'Model1', 'Model2', 'Model3' ]:
p = path( i +
OK, understood. However, If you set up CASCADE on the model surely when it
creates the table on the database level it surely should set ON DELETE
CASCADE not ON DELETE NO ACTION on the CONSTRAINT?
On Saturday, 23 June 2018 10:54:44 UTC+1, Melvyn Sopacua wrote:
>
> On zaterdag 23 juni 2018
On zaterdag 23 juni 2018 00:56:36 CEST James Bellaby wrote:
> However when looking are the SQL in Postgresql it's created the Membership
> table constraint for the Group id with "ON DELETE NO ACTION"
>
> CONSTRAINT groups_membership_group_id_d4404a8c_fk_groups_group_id FOREIGN
> KEY (group_id)
>
On zaterdag 23 juni 2018 02:01:06 CEST Mike Dewhirst wrote:
> Is there a python singleton pattern which might work?
No, cause the startup is done in 2 different processes which do not share
state. So both processes will have a "new singleton".
This is why you need an IPC mechanism, such as file
Makes sense - thank you Eric
M
On 23/06/2018 5:10 PM, PASCUAL Eric wrote:
IMHO, some of (a lot of ?) the "classical" GOF patterns do not really
apply to Python (or at least are not necessary, when not making things
more confuse). They are often a consequence of constraints and
limitations
IMHO, some of (a lot of ?) the "classical" GOF patterns do not really apply to
Python (or at least are not necessary, when not making things more confuse).
They are often a consequence of constraints and limitations of statically
compiled languages such as C++, Java and alike used at the time
30 matches
Mail list logo