When to use Admin model_delete/model_save and Model delete/save?

2019-11-25 Thread Mark Phillips
Just curious as to the best practices for using save/delete in Model versus delete_model/save_model in ModelAdmin. Is one preferred over the other? In my particular case, I have a Document model with a JSON field that holds a bunch of metadata (name:value pairs) for Documents (photos, pdfs, etc).

Re: When to create a new app

2018-03-10 Thread ansh srivastav
Most amazing part about django is every stuff related to a new app! Suppose you may want to create a game and in that first the user have to intimate the move, so for that an app is created ! On 10 Mar 2018 21:40, "Cictani" wrote: > > Hi Andréas, > > thank you. Currently I am working on a db ap

Re: When to create a new app

2018-03-10 Thread Cictani
Hi Andréas, thank you. Currently I am working on a db app for ant species (https://github.com/Cictani/antkeeping_info). Each ant species can be native to several countries and other regions (states for example). I created a separate regions up which contains the models for Country and Region

Re: When to create a new app

2018-03-10 Thread Andréas Kühne
Hi Andreas, I would say that this depends on your use case. I try to group functionality or domains in my apps. So for example I have all of the invoicing views and models in one app, all of the user models and views in another app. There are some models that have relationships to other models in

When to create a new app

2018-03-09 Thread Cictani
Hello, I have problem to figure out when I should create a new app in my Django project. Can you give me some Tipps? Best regards Andreas -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving email

Re: When to use get_user_model()

2018-02-20 Thread Scot Hacker
It's good future-proofing, in case you ever change the User model in your project. In real life, that's highly unlikely, but where it's *really important* to use get_user_model() is when you are writing reusable apps for distribution. If your app is intended to be dropped into any existing Djan

Re: When to use get_user_model()

2018-02-19 Thread tango ward
orms.py, does it mean it will use the RegUser class from >> the models.py? Sorry, I am confuse. >> >> On Sun, Feb 18, 2018 at 9:41 PM, Mukul Agrawal wrote: >> >>> The answer on this link can also help you in why and when to use >>> get_user_model(). >

Re: When to use get_user_model()

2018-02-18 Thread Xavier Paniello
: > > @Mukul Agrawal, > > thanks, i'll read this. > > > @Xavier, > > the model in forms.py, does it mean it will use the RegUser class from the > models.py? Sorry, I am confuse. > > On Sun, Feb 18, 2018 at 9:41 PM, Mukul Agrawal > wrote: > >> The ans

Re: When to use get_user_model()

2018-02-18 Thread tango ward
@Mukul Agrawal, thanks, i'll read this. @Xavier, the model in forms.py, does it mean it will use the RegUser class from the models.py? Sorry, I am confuse. On Sun, Feb 18, 2018 at 9:41 PM, Mukul Agrawal wrote: > The answer on this link can also help you in why and whe

Re: When to use get_user_model()

2018-02-18 Thread Mukul Agrawal
The answer on this link can also help you in why and when to use get_user_model(). https://stackoverflow.com/questions/24629705/django-using-get-user-model-vs-settings-auth-user-model On Feb 18, 2018 4:11 AM, "tango ward" wrote: Hi, I am playing around with user registration. I cam

Re: When to use get_user_model()

2018-02-18 Thread Xavier Paniello
Hi tangoward15, The User model by default is auth.User, but you can define a custom one and reference it at settings: https://docs.djangoproject.com/en/2.0/ref/settings/#auth-user-model So, get_user_model() will return the model defined at AUTH_USER_MODEL setting. Salut! El dissabte, 17 febr

Re: When to use get_user_model()

2018-02-17 Thread tango ward
I also checked the documentation of it but I am confuse. It says "Instead of referring to User directly, you should reference the user model using django.contrib.auth.get_user_model(). This method will return

When to use get_user_model()

2018-02-17 Thread tango ward
Hi, I am playing around with user registration. I came across a code where the get_user_model() was assigned to a model in Meta class inside a form. I was just wondering, what is the benefit of using the get_user_model() as Model in a form instead of importing a class from models.py then use that

Command: remove_stale_contenttypes, what is considered stale? and when to use it?

2017-07-14 Thread sarvi
We had the "sphinxdoc" app in our app list, along with django.contrib.contenttypes Our database was migrated to it and django had the tables for sphinxdoc and 2 content types added to the contenttypes table. We wanted to remove isphinxdoc We did manage.py migrate sphinxdoc zero, which removed

Django - GCBV Instance vs object; when to use ?

2016-07-06 Thread sevenrrainbow
I have two generic class based views, CreateView and UpdateView. I have products and companies, where a company can have multiple products. A user has a company. When a product is added I need to send also the corresponding foreign key and when I edit/update I need to be sure that the prod

Re: New to Django / Web Development [ Confused About When to Store To Database For Static Content]

2012-12-22 Thread Gerald Klein
) > > I'm a complete beginner at webdev and had a question about when to store > to a database for content that seldom changes. I understand the need to > access and modify a database for dynamic content but what about static > content? For instance, lets say my website has

Re: New to Django / Web Development [ Confused About When to Store To Database For Static Content]

2012-12-22 Thread Russell Keith-Magee
On Sun, Dec 23, 2012 at 7:43 AM, Django Son < i.ask.django.questi...@gmail.com> wrote: > Hi there, :) > > I'm a complete beginner at webdev and had a question about when to store > to a database for content that seldom changes. I understand the need to > access and mod

New to Django / Web Development [ Confused About When to Store To Database For Static Content]

2012-12-22 Thread Django Son
Hi there, :) I'm a complete beginner at webdev and had a question about when to store to a database for content that seldom changes. I understand the need to access and modify a database for dynamic content but what about static content? For instance, lets say my website has a large numb

Re: When to use a model property vs. method?

2011-06-20 Thread Micky Hulse
Thanks to everyone (Bruno, Tom, Ethan and Masklinn) for the extremely informative and very helpful replies. I really appreciate all of the professional help. I have a lot to research and need to practice some of these newly learned techniques/concepts... I may be back with more (this time, Django

Re: When to use a model property vs. method?

2011-06-18 Thread Ethan Jucovy
On Sat, Jun 18, 2011 at 10:01 AM, Masklinn wrote: > On 2011-06-18, at 15:05 , Ethan Jucovy wrote: > > I tend to avoid @property -- it adds conceptual overhead for code > > readers (hiding the fact that a function call is taking place) for little > > gain. > You *do* realize that django model (and

Re: When to use a model property vs. method?

2011-06-18 Thread bruno desthuilliers
On 18 juin, 15:05, Ethan Jucovy wrote: > I tend to avoid @property -- it adds conceptual overhead for code > readers (hiding the fact that a function call is taking place) for little > gain. Would you say that the way the attribute lookup mechanism and descriptor protocol are used to turn functio

Re: When to use a model property vs. method?

2011-06-18 Thread Masklinn
On 2011-06-18, at 15:05 , Ethan Jucovy wrote: > I tend to avoid @property -- it adds conceptual overhead for code > readers (hiding the fact that a function call is taking place) for little > gain. You *do* realize that django model (and form) fields are descriptors, and any access to a model or f

Re: When to use a model property vs. method?

2011-06-18 Thread Ethan Jucovy
>return True >return False > > def get_separator(self): >return ' :: ' > > [/code] > > I feel like I have seen so many examples of methods and properties > that return the same type of stuff, I am just confused about when to > use one ove

Re: When to use a model property vs. method?

2011-06-18 Thread bruno desthuilliers
On 17 juin, 21:24, Micky Hulse wrote: > > I have never used the @classmethod decorator before. I will have to > read up on that one. A classmethod is a method that takes the class itself as first argument, and so can be called either on a class or instance. It's very handy for alternate constru

Re: When to use a model property vs. method?

2011-06-17 Thread Micky Hulse
Hi Tom and Bruno! Thank you so much for your pro help and assistance. I really appreciate it. :) Replying to both of you in this one e-mail... See inline replies below. On Fri, Jun 17, 2011 at 1:42 AM, Tom Evans wrote: > Access it with MyModel.SEPARATOR or my_model_instance.SEPARATOR Ahhh, I se

Re: When to use a model property vs. method?

2011-06-17 Thread bruno desthuilliers
On Jun 16, 11:35 pm, Micky Hulse wrote: > > >> def get_separator(self): > >>     return ' :: ' > > In this case (returning a constant), it would be much simpler to make > > it a class (or instance) attribute. > > Ah, I think I get it. > > Just to clarify things for me, does attribute equal a prope

Re: When to use a model property vs. method?

2011-06-17 Thread bruno desthuilliers
On Jun 16, 11:51 pm, Micky Hulse wrote: > How's this for a rule-of-thumb(?): > > 1. Use a property (class/instance attribute) when an argument(s) is not > needed. Well, a setter does need an argument ;) -- You received this message because you are subscribed to the Google Groups "Django users

Re: When to use a model property vs. method?

2011-06-17 Thread Tom Evans
On Thu, Jun 16, 2011 at 10:35 PM, Micky Hulse wrote: > Just to clarify things for me, does attribute equal a property or method? :D > > I am guessing that attribute = property, so you're saying that I > could/should do this: > > @property > def separator(self): >    return ' :: ' > No, he's sayin

Re: When to use a model property vs. method?

2011-06-16 Thread Micky Hulse
I am reading through Chapter5+ of Dive Into Python now... Seems like that should cover all of my questions! :D Sorry to bug the list with my ramblings. Thanks again Bruno! Have a great day all! Cheers, Micky -- You received this message because you are subscribed to the Google Groups "Django

Re: When to use a model property vs. method?

2011-06-16 Thread Micky Hulse
How's this for a rule-of-thumb(?): 1. Use a property (class/instance attribute) when an argument(s) is not needed. 2. If an argument(s) is needed (for runtime(?) calculations and/or class/instance attributes need to be sanitized/checked/other), then use a method (or getter/setter/descriptor). No

Re: When to use a model property vs. method?

2011-06-16 Thread Micky Hulse
Hi Bruno! Thank you so much for your help. I really appreciate the pro assistance. :) On Thu, Jun 16, 2011 at 1:42 PM, bruno desthuilliers wrote: > > This could be written much more simply as "return self.modified > > self.created" > Omg, thanks! That's way better. :D >> def get_separator(sel

Re: When to use a model property vs. method?

2011-06-16 Thread bruno desthuilliers
ttribute. > [/code] > > I feel like I have seen so many examples of methods and properties > that return the same type of stuff, I am just confused about when to > use one over the other. Properties are for computed attributes - that is, things that are the semantically (conceptually,

When to use a model property vs. method?

2011-06-16 Thread Micky Hulse
I feel like I have seen so many examples of methods and properties that return the same type of stuff, I am just confused about when to use one over the other. Just hoping some of the pro Django/Python users on this list could school me on this one. :D Thanks so much! Cheers, Micky -- You

Re: When to use a model property vs. method?

2011-06-16 Thread Micky Hulse
On Thu, Jun 16, 2011 at 11:07 AM, Micky Hulse wrote: > Just hoping some of the pro Django/Python users on this list could > school me on this one. :D Actually, here's an example that I am working on now. In my model, I have a CharField that holds the latitude/longitude with values that look like

Re: South - when to start?

2011-02-19 Thread Shawn Milochik
On Sat, Feb 19, 2011 at 8:28 PM, Rainy wrote: > I was going to say the exact same thing. I can just add that anything > is fairly > easy with South - starting from the beginning, starting just before > 2nd > dev joins in, or even starting after other devs join. Wiping out old > migrations > is al

Re: South - when to start?

2011-02-19 Thread Rainy
On Feb 18, 10:59 am, ShawnMilo wrote: > Just to add my tiny bit to this: > > I say start with South right away. But when you're ready to deploy for the > first time, wipe it all and to another --initial. > > The reason is that South is awesome for letting you upgrade a production app > that isn'

Re: South - when to start?

2011-02-18 Thread ShawnMilo
Just to add my tiny bit to this: I say start with South right away. But when you're ready to deploy for the first time, wipe it all and to another --initial. The reason is that South is awesome for letting you upgrade a production app that isn't allowed to stop working. So at first deployment,

Re: South - when to start?

2011-02-18 Thread Piotr Zalewa
I'm mostly looking for a solution which would work for front-end devs who start early in the process (some part of app is written and they may jump on the UI). I guess South before 2 is a must then. I heard it's dead simple, I guess a little practice in writing migrations will not kill me. Thanks

Re: South - when to start?

2011-02-18 Thread Grigoriy Petukhov
I have found nice way to do quick development on 1st and 2nd steps you have mentioned. I've put following instructions in reset.sh: * Drop database * Create new database * Run ./manage.py syncdb * Generate sample data When I change some model then I just run reset.sh. That works even for seve

Re: South - when to start?

2011-02-18 Thread gladys
dn't bother until either you have more than one > person developing the code base, or when to update a model means > updating more than one database schema. Until you are at that point, > the benefit is not huge, but the cost remains the same. > > Cheers > > Tom Here is a

Re: South - when to start?

2011-02-18 Thread dave b
On 18 February 2011 21:24, Piotr Zalewa wrote: > Where is the best moment to start with south? > > 1. The very beginning, as the first app added to the project? > 2. At the moment when more devs will be involved? > 3. When real data will start to show? > now! (just start using it!) -- You recei

Re: South - when to start?

2011-02-18 Thread Tom Evans
m building a new system, I think the current model progress is about > 20%, where 100% is the moment I will put the site on the server. I'm > very close to point 2. > > zalun Personally, I wouldn't bother until either you have more than one person developing the code base, or whe

South - when to start?

2011-02-18 Thread Piotr Zalewa
Where is the best moment to start with south? 1. The very beginning, as the first app added to the project? 2. At the moment when more devs will be involved? 3. When real data will start to show? I'm building a new system, I think the current model progress is about 20%, where 100% is the moment

Re: Opinions Sought on When To/Not To Use Django Static File Settings

2011-01-30 Thread Russell Keith-Magee
On Mon, Jan 31, 2011 at 12:59 AM, octopusgrabbus wrote: > I have written a web application in Django. At most, there will never > be more than five users logged in, if that. I chose this particular > application for Django implementation deliberately due to low use and > because it was a first-tim

Opinions Sought on When To/Not To Use Django Static File Settings

2011-01-30 Thread octopusgrabbus
I have written a web application in Django. At most, there will never be more than five users logged in, if that. I chose this particular application for Django implementation deliberately due to low use and because it was a first-time application. The application sits behind a firewall, and possi

Re: When to use Form API

2010-12-08 Thread ringemup
This. Form processing is one of those tedious things 90% of which is the same in every form: field definition, display, validation, and error handling/presentation. Django takes care of the repetitive parts, and if you need to customize the validation or display, allows you to do so while still a

Re: When to use Form API

2010-12-08 Thread Wayne Smith
It is important to distinguish between display and functionality with forms. What I mean is, using the forms does not mean you have to render (display) them the way Django has it set up by default. I always use the Form API, and if I need custom validation on a field or the entire form, I overrid

When to use Form API

2010-12-08 Thread christian.posta
Do django developers use the Form API any time form elements need to be displayed to users? Or do you just code the form yourself in the templates and manually process them for smaller forms? In general, is it always better to use the Form API for any form you display, regardless how simple, becau

Re: When to use admin, and when not to.

2009-05-27 Thread Sam Kuper
2009/5/27 Andy Mikhailenko > > User behaviour can be formalized as actions + objects. Some actions > span multiple objects. > Admin is a great tool that corresponds the *structure* of data. It > allows to view and edit all your base for great justice. Err, all your > database for zero cost. Out of

Re: When to use admin, and when not to.

2009-05-27 Thread Andy Mikhailenko
User behaviour can be formalized as actions + objects. Some actions span multiple objects. Admin is a great tool that corresponds the *structure* of data. It allows to view and edit all your base for great justice. Err, all your database for zero cost. Out of the box. Nice! However, "editing an ob

Re: When to use admin, and when not to.

2009-05-26 Thread Masklinn
On 26 May 2009, at 15:44 , Sieker Adi Jörg wrote: > On 26.05.2009, at 14:28, Sam Kuper wrote: > Also to actually get access to the > admin views, the user needs be flagged as a superuser (I as far as I > remember). > Staff, actually, superuser is another user class (one that gets all admin right

Re: When to use admin, and when not to.

2009-05-26 Thread Sam Kuper
Thanks so much for the comprehensive reply! All best, Sam 2009/5/26 Sieker Adi Jörg > > On 26.05.2009, at 14:28, Sam Kuper wrote: > > > 2009/5/26 Sieker Adi Jörg > > In my humble opinion. As soon as you mention users, the admin is the > > wrong tool. > > contrib.admin is for admin's and not f

Re: When to use admin, and when not to.

2009-05-26 Thread Sieker Adi Jörg
On 26.05.2009, at 14:28, Sam Kuper wrote: > 2009/5/26 Sieker Adi Jörg > In my humble opinion. As soon as you mention users, the admin is the > wrong tool. > contrib.admin is for admin's and not for users. > > Another take on it is: > - Anyone that creates an account on your site, doesn't get to

Re: When to use admin, and when not to.

2009-05-26 Thread Sam Kuper
2009/5/26 Sieker Adi Jörg > In my humble opinion. As soon as you mention users, the admin is the > wrong tool. > contrib.admin is for admin's and not for users. > > Another take on it is: > - Anyone that creates an account on your site, doesn't get to ses the > admin > - Anyone that you create an

Re: When to use admin, and when not to.

2009-05-26 Thread Sieker Adi Jörg
Hi, On 26.05.2009, at 12:17, Sam Kuper wrote: > 2009/5/26 Alex Gaynor >> It's not even an authorisation issue, it's that I'd be overiding >> nearly every method to make sure the behavior was what I wanted, >> and then I'd replace all the templates since I want everything the >> user sees

Re: When to use admin, and when not to.

2009-05-26 Thread Sam Kuper
2009/5/26 Alex Gaynor > It's not even an authorisation issue, it's that I'd be overiding nearly > every method to make sure the behavior was what I wanted, and then I'd > replace all the templates since I want everything the user sees to be > similarly themed, and at this point I've already rewri

Re: When to use admin, and when not to.

2009-05-25 Thread Alex Gaynor
On Mon, May 25, 2009 at 8:25 PM, Sam Kuper wrote: > 2009/5/26 Alex Gaynor > >> On Mon, May 25, 2009 at 7:51 PM, Sam Kuper >> wrote: >> >>> Suppose you were re-writing Facebook in Django. >>> >>> Would you handle the complex profile and privacy settings pages by: >>> >>> A) exposing the relevant

Re: When to use admin, and when not to.

2009-05-25 Thread Sam Kuper
2009/5/26 Alex Gaynor > On Mon, May 25, 2009 at 7:51 PM, Sam Kuper > wrote: > >> Suppose you were re-writing Facebook in Django. >> >> Would you handle the complex profile and privacy settings pages by: >> >> A) exposing the relevant admin pages to users, with careful auth to stop >> users from

Re: When to use admin, and when not to.

2009-05-25 Thread Alex Gaynor
On Mon, May 25, 2009 at 7:51 PM, Sam Kuper wrote: > Suppose you were re-writing Facebook in Django. > > Would you handle the complex profile and privacy settings pages by: > > A) exposing the relevant admin pages to users, with careful auth to stop > users from being able to access admin pages the

When to use admin, and when not to.

2009-05-25 Thread Sam Kuper
Suppose you were re-writing Facebook in Django. Would you handle the complex profile and privacy settings pages by: A) exposing the relevant admin pages to users, with careful auth to stop users from being able to access admin pages they shouldn't be able to. Obviously this would require much cus

Re: When to use each of these approaches ?

2009-01-04 Thread Malcolm Tredinnick
On Sun, 2009-01-04 at 01:01 -0800, HB wrote: > Hey, > What is the difference between: > query = request.GET.get('q', '') > and > (r'^time/plus/(\d{1,2})/$', hours_ahead) > And when to use each approach? > Thanks guys. > #I'm new to Django

When to use each of these approaches ?

2009-01-04 Thread HB
Hey, What is the difference between: query = request.GET.get('q', '') and (r'^time/plus/(\d{1,2})/$', hours_ahead) And when to use each approach? Thanks guys. #I'm new to Django, forgive my simple questions :) --~--~-~--~~~---~--~

Re: When to start an app?

2008-09-13 Thread barbara shaurette
is another separate app, but both import the User object. And then your survey mechanism would be yet another app, and so on and so on. On Sep 13, 10:39 am, mickeyckm <[EMAIL PROTECTED]> wrote: > I'm a little confuse as to when to create an app. > > I'm trying to create a surv

When to start an app?

2008-09-13 Thread mickeyckm
I'm a little confuse as to when to create an app. I'm trying to create a survey project. Is user registration an app on its own, the part where the person login/register? --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: When to use templatetags and how to use views.py

2008-01-11 Thread Darthmahon
Hi Malcolm, Thanks for the great writeup, it has certainly made things clearer. Like you say, don't sweat the small stuff - I'll try not to :) Thanks, Chris On Jan 11, 8:53 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-01-10 at 23:18 -0800, Darthmahon wrote: > > Thanks for th

Re: When to use templatetags and how to use views.py

2008-01-11 Thread Malcolm Tredinnick
On Thu, 2008-01-10 at 23:18 -0800, Darthmahon wrote: > Thanks for the reply, I've also just found out about context > processors, which to me sound extremely similar to templatetags. The > only problem I can see with both of these options is that I can't see > how you pass extra options into them

Re: When to use templatetags and how to use views.py

2008-01-10 Thread Darthmahon
Thanks for the reply, I've also just found out about context processors, which to me sound extremely similar to templatetags. The only problem I can see with both of these options is that I can't see how you pass extra options into them, whereas you can if the logic is contained within views.py I

Re: When to use templatetags and how to use views.py

2008-01-10 Thread Kenneth Gonsalves
On 10-Jan-08, at 8:54 PM, Darthmahon wrote: > Is there any real difference between passing the data from a views.py > file into a template compared with asking for the data using a > templatetag? if you are only using it in one template - do it in the view. If you are doing it in several or a

When to use templatetags and how to use views.py

2008-01-10 Thread Darthmahon
Hey, I've recently stumbled on templatetags as a great way of pulling in data you need within a specific template file. Previously I would have done all of the logic to pull in data from within a views.py file and then just pass that data into a specified template. Is there any real difference b

Re: When to use Admin Forms and/or Generic Views and/or New Forms ?

2007-07-03 Thread Russell Keith-Magee
On 7/4/07, Vizcayno <[EMAIL PROTECTED]> wrote: > > Hello: > I know that Django provides 3 ways in using Web forms: Admin Forms, > Generic views and New Forms where Admin forms is the easiest one to > use. > What I would like to know is: > 1) Which determinant aspects should force me to use Generic

When to use Admin Forms and/or Generic Views and/or New Forms ?

2007-07-03 Thread Vizcayno
Hello: I know that Django provides 3 ways in using Web forms: Admin Forms, Generic views and New Forms where Admin forms is the easiest one to use. What I would like to know is: 1) Which determinant aspects should force me to use Generic Views instead of Admin Forms? And 2) Which determinant aspec

Re: When to restart Apache?

2007-02-12 Thread Nebojša Đorđević
* Rob Slotboom wrote, On 12.02.2007 10:25: > When running Django using mod_python you have to restart Apache > whenever you make changes to your code. Some changes don't require a > restart so I wonder which changes trigger mod_python to reload and > which don't. Basically any change to the pytho

When to restart Apache?

2007-02-12 Thread Rob Slotboom
When running Django using mod_python you have to restart Apache whenever you make changes to your code. Some changes don't require a restart so I wonder which changes trigger mod_python to reload and which don't. --~--~-~--~~~---~--~~ You received this message bec

Re: When to

2006-10-15 Thread Frankie Robertson
On 13/10/06, MerMer <[EMAIL PROTECTED]> wrote: > > I can see that I could use inclusion tags or template tags. I've read > the documentation however, I'm still unclear when you would use one > over the other. > > What would be the appropriate use case for a template tag versus an > inclusion tag

Re: When to

2006-10-13 Thread MerMer
I can see that I could use inclusion tags or template tags. I've read the documentation however, I'm still unclear when you would use one over the other. What would be the appropriate use case for a template tag versus an inclusion tag? MerMer --~--~-~--~~~---~--~

Re: When to

2006-10-12 Thread MerMer
Frankie, Thanks for this... I'll take a look. MerMer --~--~-~--~~~---~--~~ 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 thi

Re: When to

2006-10-12 Thread Frankie Robertson
On 12/10/06, MerMer <[EMAIL PROTECTED]> wrote: > > As a follow on. Can I:- > > Combine all three templates by using inheritance between the templates. > > Unfortunately, I haven't been able to test this yet - because I can't > get the "extend tag" to work (see other post).I am assuming that i

Re: When to

2006-10-12 Thread MerMer
As a follow on. Can I:- Combine all three templates by using inheritance between the templates. Unfortunately, I haven't been able to test this yet - because I can't get the "extend tag" to work (see other post).I am assuming that it won't work because of the following. Could someone confir

When to

2006-10-12 Thread MerMer
Slowly trying to see the light... can anybody put me straight on the following:- I have three different templates. Each template gives a simple list of a model (table in the database).I now want to create a single template that displays all three lists. Can I:- a) Combine all three templa

Re: When to use django.db.models.LazyDate() and when datetime.now()?

2006-06-10 Thread Rudolph
Thanks Luke, very nicely explained! Rudolph --~--~-~--~~~---~--~~ 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, s

Re: When to use django.db.models.LazyDate() and when datetime.now()?

2006-06-10 Thread Luke Plant
On Friday 09 June 2006 13:35, Rudolph wrote: > Hi, > > I understand why we have the django.db.models.LazyDate(): it's to > make sure we get the datetime value at execution time and not at > "compile" time. The docs tell you to use it for "limit_choices_to", > but should I also use it when I want t

When to use django.db.models.LazyDate() and when datetime.now()?

2006-06-09 Thread Rudolph
Hi, I understand why we have the django.db.models.LazyDate(): it's to make sure we get the datetime value at execution time and not at "compile" time. The docs tell you to use it for "limit_choices_to", but should I also use it when I want the default value of a DateTimeField to be "now". And how

When to cache

2005-10-18 Thread Andreas Stuhlmüller
At http://code.djangoproject.com/ticket/603 Jacob wrote: "Yes, actually -- turns out that the cost of a cache miss is *more* than the cost of compiling a template (we profiled this about a year ago, so it may have changed in the meantime). So it turns out it's easier to just parse the template wh