bruar 2019 kl. 15.47.10 UTC+1 skrev Mikkel Kromann:
>
> Hi.
>
> I have a collection of apps where I find repeating myself when rendering
> tables in the templates.
> In the stylised example below I have three types of tables, foo, bar and
> baz.
> Each app is supposed to ren
Hi.
I have a collection of apps where I find repeating myself when rendering
tables in the templates.
In the stylised example below I have three types of tables, foo, bar and
baz.
Each app is supposed to render various combinations of tables from its own
models, but also from other models'
, but not from the parent class.
Mikkel
torsdag den 27. december 2018 kl. 20.59.43 UTC+1 skrev Mikkel Kromann:
>
>
> Hello.
>
> I have a parent Meta class and some child classes.
> I would like to read the decimal_places attribute from DecimalField of my
> child instances using a
Hello.
I have a parent Meta class and some child classes.
I would like to read the decimal_places attribute from DecimalField of my
child instances using a function in my parent class.
I am able to read the attribute from inside my child classes, but I cant
crack how to read from a function in
Dear Django users.
I am looking into the so-called Point-In-Time architecture for databases
with version history. See e.g.
https://www.red-gate.com/simple-talk/sql/database-administration/database-design-a-point-in-time-architecture/
One reason I like PTA is that a version history for my
the columns you specify.
>
>
>
> I suggest reviewing the annotation and values docs here:
>
>
> https://docs.djangoproject.com/en/2.1/topics/db/aggregation/#order-of-annotate-and-values-clauses
>
>
>
>
>
> *From:* django...@googlegroups.com [mailto:
&g
_row is a dictionary, so you need
> to access it as if it were a dictionary.
>
> contract_sum = contract_row['contracted']
>
>
>
> *From:* django...@googlegroups.com [mailto:
> django...@googlegroups.com ] *On Behalf Of *Mikkel Kromann
> *Sent:* Monday, August 13, 2018 11:51 PM
t; *From:* django...@googlegroups.com [mailto:
> django...@googlegroups.com ] *On Behalf Of *Mikkel Kromann
> *Sent:* Monday, August 13, 2018 11:51 PM
> *To:* Django users
> *Subject:* Re: GROUP BY
>
>
>
>
>
> Thanks. But strange - exactly same error:
>
>
t;
>
>
>
>
> *From:* django...@googlegroups.com [mailto:
> django...@googlegroups.com ] *On Behalf Of *Mikkel Kromann
> *Sent:* Monday, August 13, 2018 3:22 PM
> *To:* Django users
> *Subject:* GROUP BY
>
>
>
> I'm trying to sum the field "
I'm trying to sum the field "ownProduction", grouping it by the foreign key
"market" (using the market's human readable name, __name from the Market
table) and the week number (which is built-in function __year of the date
field "dateContract").
However, when I try to read the results of the
')
.annotate(contract_sum=Sum('contractSum'))
.annotate(expected_own_production_sum=Sum(
'id', field='contractSum * probability'))
)
cheers, Mikkel
lørdag den 4. august 2018 kl. 14.11.27 UTC+2 skrev Mikkel Kromann:
>
> Dear
Dear Django users.
I'm trying to do the sums of the product of two columns ('contract_sum' and
'probability', decimal fields), grouping by a third column, 'stage' (a
choice variable).
I'm also reporting the grouped sums of one of the single columns
('contract_sum')
The single column works just
urn paths
>From urls.py:
from . models import GetItemPaths
urlpatterns = GetItemPaths() + [
path('/to/some/other/views/'otherview.asView(), name='other_name'),
]
lørdag den 23. juni 2018 kl. 15.08.04 UTC+2 skrev Melvyn Sopacua:
>
> On zaterdag 23 juni 2018 14:30:08 CEST Mikkel K
no attribute '_default_manager'
So it certainly seems that using model=i will not pass the model name.
Is this because the argument for model= expects not a string but an object?
thanks, Mikkel
torsdag den 21. juni 2018 kl. 10.19.08 UTC+2 skrev Mikkel Kromann:
>
> I have a lot of model
I have a lot of models (say 30 or 40) which are so similar, that I have
handled them using slightly modified class based views.
In urls.py:
urlpatterns = [
path('list//',ItemListView.as_view()),
path('create//', ItemCreateView.as_view()),
path('update//',
me':
>> 'region_list' },
>>
>> {'name': 'location', 'readable': 'Location', 'urlname':
>> 'location_list' }
>>
>> ]
>>
>> }
>>
>>
>>
>> Then in the template:
>>
>> {% for item in Items %}
>> {{ite
t
> is the way you are creating the dictionary in your context processor.
>
> Best regards,
>
> Andréas
>
> 2018-06-18 21:16 GMT+02:00 Mikkel Kromann >:
>
>> Hi.
>>
>> Once again thanks for all your invaluable advice to me so far. Now, I'm
>> battling
Hi.
Once again thanks for all your invaluable advice to me so far. Now, I'm
battling context_processors.
I really struggle to find a good example that can help me understand how to
use them.
They seem quite helpful to a lot of stuff I plan to do.
I think I got the configuration in settings.py
ngo-template?utm_medium=organic_source=google_rich_qa_campaign=google_rich_qa
>
>
>
>
>
> *From:* django...@googlegroups.com [mailto:
> django...@googlegroups.com ] *On Behalf Of *Mikkel Kromann
> *Sent:* Wednesday, June 13, 2018 3:54 PM
> *To:* Django users
> *Subje
a list of the
> values in the order that they should appear
>
> On Wed, Jun 13, 2018 at 4:54 PM Mikkel Kromann > wrote:
>
>> Dear Django users.
>>
>> Thanks to the good advice of many people on this list, I've managed to
>> create some nice generic class
Dear Django users.
Thanks to the good advice of many people on this list, I've managed to
create some nice generic class based views that work simultaneously with
many models.
The models may differ from each other with regards to the number of columns
in their data tables as well as the naming
our code try to do something weird.
>
> Anyway, good luck on your project!
>
> On Wed, Jun 6, 2018, 14:51 Mikkel Kromann > wrote:
>
>> Thanks Daniel.
>>
>> Both your proposed solutions worked very well.
>> For now, I don't have other information stuffed i
elds to display to the user based on which model the
> user is updating, so you could just specify the form_class attribute on the
> path (just as you did with the model).
>
> Hope it helps!
>
>
> On Wed, Jun 6, 2018, 10:36 Mikkel Kromann > wrote:
>
>> Hello Daniel.
>&
es of the Model, you used to be able to call a
> .get_field_names() or something like that but that is depreciated since
> 1.10. Now to do that you should use the Model._meta to get_fields(). Check
> the documentation for the Model._meta to check its full potential.
>
> Hope it helps!
>
> O
>
> Regards,
>
> Andréas
>
> 2018-06-05 21:56 GMT+02:00 Mikkel Kromann >:
>
>> Dear Django-users.
>>
>> I'm slowly working towards a Django "data-warehouse" framework, where I
>> can easily add a lot of models (each containing a t
Dear Django-users.
I'm slowly working towards a Django "data-warehouse" framework, where I can
easily add a lot of models (each containing a table with data), while
sticking to only few reusable views.
I've realised that in urls.py, it is possible to specify the model on which
the UpdateView
skrev Mikkel Kromann:
>
> Dear Django users.
>
> I'm testing whether Django is a good choice for a web based application
> that I need to handle (create, read, update, delete) a lot of data tables.
> I've discovered the built-in Class Based View, which are going to save me
> fro
Dear Django users.
I'm testing whether Django is a good choice for a web based application
that I need to handle (create, read, update, delete) a lot of data tables.
I've discovered the built-in Class Based View, which are going to save me
from a lot of repetitive code lines - yay!
Now, I've
.
cheers, Mikkel
lørdag den 14. april 2018 kl. 16.10.27 UTC+2 skrev Mikkel Kromann:
>
> Hi.
>
> I'm new to Django, and I'm working my way into Django by going through the
> nice Djangoproject.com turorial.
> I'm trying to find out whether Django is the right tool for my task,
Hi.
I'm new to Django, and I'm working my way into Django by going through the
nice Djangoproject.com turorial.
I'm trying to find out whether Django is the right tool for my task, which
is maybe a bit unusual for Django.
My task is to build a web interface to a database for an calculation
30 matches
Mail list logo