I have an admin with 1 row in the tabular inline. I have a custom queryset
in
class ExtensionTabularInlineFormSet(BaseInlineFormSet):
def get_queryset(self) -> QuerySet[Extension]:
qs = super().get_queryset()
This gets called 20 times to display that one row. When you have more
lib
On Sat, Jun 15, 2019 at 8:16 AM Simon Charette wrote:
> I meant Django 2.0 -> 2.1. As long as you are using Django 2.2 with SQLite
> 3.20+
> the slowdown I mentioned should be effective.
>
> Simon
>
> Le samedi 15 juin 2019 08:32:56 UTC-4, Mark Jones a écrit :
>>
&
tests
> against SQLite the 2.1 to 2.2 slowdown is likely caused by the fact
> database constraints are
> now checked of each TestCase[0].
>
> Cheers,
> Simon
>
> [0] https://docs.djangoproject.com/en/2.2/releases/2.2/#tests
>
>
> Le samedi 15 juin 2019 07:26:35 UTC-4, Mar
I was fixing up a Django app https://github.com/mark0978/django-softdelete and
setting up tox to make sure it worked with all the listed versions because
of issues opened on the original repo. While I was running tox locally I
noticed that with every version of Django, the tests ran slower,
Can't imagine why you would want to do this via CGI, it can't perform very
well. There is a TON of stuff that gets setup during initialization for
wsgi/runserver, etc..
Syntax wise your import is way off since your models do not live in the
Django folder, you can't import them like this.
I use WingIDE and one license covers all 3 platforms for a developer.
And the guys that make it are incredibly nice and helpful with
features and how to use.
I Highly recommend it. (30 day free trial too)
--
You received this message because you are subscribed to the Google Groups
"Django
I've created a manage.cmd and put it on my path so I can type less
while on windows
the command is just
@echo off
python manage.py %*
this makes it more like linux
The "@echo off" part is important because mange dumpdata >filename
doesn't want to see the command line echoed into the json file.
I was thinking I could pickle/unpickle the request then run it thru
with an extra flag of (send email) thru the same code that wsgi uses.
If I jsonify the data, how would I get that back into a python object?
Is it really as simple as str=json.dumps(request) and request =
json.loads(str)
I don't
When someone searches for something on the site and finds nothing, I
want to save that query for later reuse (so I can run it each night to
see if anything new matches their request, and email what is found to
the user).
What is the best way to go about this?
1. Save the SQL that is generated
{{ datevar|date: dateformat}}
won't parse.
You get the error:
Could not parse the remainder: ': dateformat' from 'datevar|date:
dateformat'
Turns out that unlike most other places, spaces ARE significant here.
It could be fixed by changing the filter_raw_string on line 448 of
Yea, I'm not wanting to use stuff.objects, but I'm wanting to pull
some of the same voodoo, probably not safe for a python novice like
myself :-)
On Jun 29, 5:24 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Mon, Jun 29, 2009 at 5:19 PM, Mark Jones <mark0...@gmail.com> wrote
I can't seem to reason out why/how this works.
I have a class Named Stuff
I can say Stuff.objects.filter(.) and that will return valid set
of data.
What I can't understand is what exactly is objects, and why is it I
can call it with Stuff.objects, but I can't call it with stuff.objects
(an
It seems like maybe I don't understand the question but it will extend
an infinite number of templates
Just add {% extends "base.html" %} into every template you want to
extend.
You can even do {% extends "derived.html" %} which extends base.html
On Feb 24, 8:41 am, lzhshen
How about integrating with something like OpenID? Not sure if it
would do the trick, but it might be a step in the right direction,
assuming the sites you are interoperating with are 'friendly'
On Feb 24, 5:49 am, LaundroMat wrote:
> Hi -
>
> I'm working on a small django
The first 2 saves are overly complex:
def save(self):
if self.unit_price and not self.price_discount == '0':
adjust = float(self.price_discount / 100.0)
val_result = str(adjust)
discount = Decimal(self.unit_price - (Decimal(val_result) *
self.unit_price))
I occurred to me last night right before sleep that I can patch this
in my code by deriving all my forms from my MyForm, fixing it in one
place and remaining DRY.
Nice to see I'm not the only one that found this to be a bit strange.
--~--~-~--~~~---~--~~
You
That is exactly the kind of WET I was talking about. as_p() with
appropriate CSS styling will render really nice forms as is, with the
exception of the help_text. I even think that could be fixed without
any major rework, just a change in the as_p() string
from
def as_p(self):
When a model field has help_text, that text will be show in the form.
I'm a little bothered by this because effectively the model is doing
something that really belongs in the view, but I understand the point
is to make it easy to create forms based on a model and I can just
live with it.
What
Kind of sucks that you are worried about your server, but not worried
about the people that might use your site.
I'd answer your question regarding JS except for the fact I think the
server and the clients should be safe for the general public, and I
don't want to make it that easy on you.
t; On Thu, Feb 19, 2009 at 11:56 AM, Mark Jones <mark0...@gmail.com> wrote:
>
> > forms.IntegerField(widget=forms.CheckboxInput(attrs={'value':1}),
> > required=False)
>
> > won't work because
>
> > def value_from_datadict(self, data, files, name):
> >
forms.IntegerField(widget=forms.CheckboxInput(attrs={'value':1}),
required=False)
won't work because
def value_from_datadict(self, data, files, name):
if name not in data:
# A missing value means False because HTML form submission
does not
# send results for
and you do that like so:
answer0 = forms.IntegerField(label='', widget=forms.CheckboxInput
(attrs={'value':0}))
for the next bloke that doesn't want to have to figure it out.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
to clearsent:
self.data._mutable=True # this doesn't seem right, but what
the heck its 1am
On Feb 3, 1:21 am, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
> On Mon, 2009-02-02 at 23:05 -0800, Mark Jones wrote:
> > I have a form that is working well. However I wan
I have a form that is working well. However I want to allow them to
reuse the form multiple times. Each time they submit the form, I will
send up to 6 emails. Then, if an email is sent successfully, I want
to remove that email address from the form that I present to them. If
the email isn't
This is where Rails rocks and DJango doesn't. I haven't been able to
find any kind of DB Migrations in Django like those in Rails. Sad
too, because other than that, Python is a lot nicer than Ruby (Syntax
wise for an old C++ programmer)
On Jan 28, 3:29 pm, Oleg Oltar
That almost sounds like you will have to write the renderer for that
class. I don't think this will be easy to do in the template, but if
you override django.forms.widgets.Select.render. you can probably make
it work.
On Jan 26, 11:51 am, mattsouth wrote:
> I wish to
I guess I was just too tired when I wrote it, I just forgot the * and
** on the 2 arguments.
I have some initialization that I'm doing in __init__ but had removed
that to make the example shorter and was still seeing the problem.
Thanks for the help, those 3 *'s fixed the whole problem
On Jan
Sample.py includes the following:
==
from django.db import models
class Good(models.Model):
code = models.CharField(max_length=64)
quizid = models.IntegerField(null=False, blank=False)
published_on = models.DateTimeField(auto_now_add=True)
class
ssentially go away.
>
> http://docs.djangoproject.com/en/dev/topics/forms/#topics-forms-indexhttp://docs.djangoproject.com/en/dev/topics/forms/formsets/
>
> -Jeff
>
> On Jan 12, 12:46 am, Mark Jones <mark0...@gmail.com> wrote:
>
> > I have some fields on my page that
I have some fields on my page that have more than one attribute for
simplification, lets say two attributes
answer = {'txt':'something', 'allowblank':0}
laid out on the page as:
{% for answer in quiz_question.answers %}
{% endfor %}
the first is pulled from an input field, and if
Thanks for the pointer, I had read all around that.
The short version is:
maker.auto_set.all()
There was was Dry(er) more elegant method to be found.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
Ok, here is some simple code:
class Maker(models.Model):
name = CharField(max_length=20)
class Auto(models.Model):
name = CharField(max_length)
maker = ForeignKey(Maker)
maker = Maker.objects.get(pk=1)
How do I get all the Autos made by this maker
I don't see a maker.autos
Are you closing the file after you write to it and before you try to
send it? Why do you have to write it to a file to deliver it as a
static file, why not just render it to a response directly?
On Jan 5, 4:13 am, Alan wrote:
> Hi List,
> Because I couldn't find any idea
Well, I think we can all see where you get your nickname.
On Jan 4, 12:03 am, Friendless wrote:
> On Jan 4, 2:42 pm, "Karen Tracey" wrote:
>
> > I'll admit your tone here is starting to make me lose interest in your
> > problem report.
>
>
Are you trying to get your source code off a server, and instead find
it being executed by the webserver?
If you have shell access, tar the files up and download that, create a
folder where the files aren't executable and download them that
way.
If it is your source, I would assume you have
You need a process running outside the bounds of the webserver that
reads the database every so often, and then sleeps with a wakeup every
so often, and a list of when things "expire". It updates the
database, the webpage reflects the update.
You could of course do this via a wget driven by
are you redirecting to the same port? I think redirection to a
different domain OR port would keep the cookie from getting back to
the server, thus killing your session.
On Jan 3, 10:33 am, Berco Beute wrote:
> My page shows a (logged in) user an iFrame but when the iframe
>
For the discussion below, ALL the code is in .../intomec/tenq
I wrote some code in tests.py like so:
from tenq.models import *
self.expectedValue = Answers((1,2,3,4))
within the to_python() method of AnswersField in models.py:
def to_python(self, _value):
print
38 matches
Mail list logo