I have a particular scenario that I can't seem to figure out how to
accomplish in Django.
I have the following models: -
class Process(models.Model):
name = models.CharField(max_length=50)
is_active = models.BooleanField(db_index=True)
class Phase(models.Model):
name = models.CharFi
chefsmart wrote:
> I have a particular scenario that I can't seem to figure out how to
> accomplish in Django.
>
> I have the following models: -
>
> class Process(models.Model):
> name = models.CharField(max_length=50)
> is_active = models.BooleanField(db_index=True)
>
> class Phase(model
Hi,
I have override 2 admin templates: index.html and base_site.html.
The first line of index.html is: {% extends "admin/base_site.html" %}
Everything works fine, but if I insert {{ MEDIA_URL }} in
base_site.html, I get the following error when going to my admin page:
TemplateSyntaxError at /adm
Yes, I overlooked the M2M relation in my rush. Thanks for pointing
that out.
I would use your model representations as is, except that the order
field in the intermediary model ProcessPhase would be
order = models.PositiveIntegerField(unique=True)
instead of
order = models.PositiveIntegerField
chefsmart wrote:
> Yes, I overlooked the M2M relation in my rush. Thanks for pointing
> that out.
>
> I would use your model representations as is, except that the order
> field in the intermediary model ProcessPhase would be
>
> order = models.PositiveIntegerField(unique=True)
>
> instead of
>
>
On 20 oct, 09:56, knight wrote:
> Hi,
>
> I have override 2 admin templates: index.html and base_site.html.
> The first line of index.html is: {% extends "admin/base_site.html" %}
> Everything works fine, but if I insert {{ MEDIA_URL }} in
> base_site.html, I get the following error when going to
I usually start with defining goals, actors and use cases, continue
with UML class diagrams and UI mockups on paper, and then transfer all
that to Python in this order: models, urls, views, templates. Then I
manually populate the DB with some data, dump a fixture and
periodically reset the app dat
Join .Net Community
This group represents the Microsoft .Net community. All .net
programmers all around the world are welcome here. In this group
you'll find the latest releases of .Net related products, frameworks,
Upgradation, technologies, IDEs etc. You also can share your
experiences and prob
No thanks
On Oct 20, 12:30 pm, Shawon_ wrote:
> Join .Net Community
>
> This group represents the Microsoft .Net community. All .net
> programmers all around the world are welcome here. In this group
> you'll find the latest releases of .Net related products, frameworks,
> Upgradation, technolog
wtf?
On Tue, Oct 20, 2009 at 12:30 PM, Shawon_ wrote:
>
> Join .Net Community
>
> This group represents the Microsoft .Net community. All .net
> programmers all around the world are welcome here. In this group
> you'll find the latest releases of .Net related products, frameworks,
> Upgradation,
No thanks
On Tue, Oct 20, 2009 at 1:43 PM, nostradamnit wrote:
>
> No thanks
>
> On Oct 20, 12:30 pm, Shawon_ wrote:
> > Join .Net Community
> >
> > This group represents the Microsoft .Net community. All .net
> > programmers all around the world are welcome here. In this group
> > you'll find th
Thank you! I use Ubuntu 9.04, can you recommend me any corresponding
Python versions?
On Oct 18, 1:50 pm, Tomasz Zieliński
wrote:
> I don't remember how I installed it (mysqldb or python-mysqldb),
> but assuming that this is the correct module, then it's possible
> that it's for different Python
On Tue, Oct 20, 2009 at 4:00 PM, Shawon_ wrote:
>
> Join .Net Community
>
> This group represents the Microsoft .Net community. All .net
> programmers all around the world are welcome here. In this group
> you'll find the latest releases of .Net related products, frameworks,
> Upgradation, techno
burn in hell
2009/10/20 Shawon_
>
> Join .Net Community
>
> This group represents the Microsoft .Net community. All .net
> programmers all around the world are welcome here. In this group
> you'll find the latest releases of .Net related products, frameworks,
> Upgradation, technologies, IDEs et
Use the filter 'safe'
{{ variable | safe }}
On Tue, Oct 20, 2009 at 8:31 AM, Alexey Moskvin wrote:
>
> Hi!
> I use django feed framework to organize rss feeds for my website.
> I need to put some hyperlinks to feed items, but al of them are
> autoescaped ( "<" is replaced with "<" and so on).
>
I think there is another way to do it -- use Exemaker.
http://effbot.org/zone/django.htm
On Tue, Oct 20, 2009 at 3:31 AM, Nick wrote:
>
> FYI,
>
> If anyone in general has trouble starting a new project in Windows xp,
> this might help you. When I first tried creating a project, I cd'd
> into th
There is three ways to select NULL records from table with Django ORM:
1. Model.objects.filter(field=None)
2. Model.objects.filter(field__exact=None)
3. Model.objects.filter(field__isnull=True)
They all seem to work.
Which is the best way and why?
--
regards,
Mihail
--~--~-~--~~---
I am trying to work out how to construct a queryset that contains
multiple records for a ManyToMany field.
The models are like this:
class products(models.Model)
name = models.CharField()
categories = models.ManyToManyField(Category)
class category(models.Model)
name = models.Charfie
Hi folks,
is there a way how use compilemessages with ignoring duplicity translations?
In my native language it's necessary to have more than one translation for
particular strings.
Thanks for help
Radovan
--
View this message in context:
http://www.nabble.com/Ignore-duplicty-in-compilemessa
On Tue, Oct 20, 2009 at 7:24 PM, Михаил Лукин
wrote:
> burn in hell
Ok - this may border on spam, but that sort of sentiment entirely
uncalled for. Please refrain from posting messages like this to Django
mailing lists in the future.
Yours,
Russ Magee %-)
--~--~-~--~~~-
Thanks for the reply.
It doesn't matter where I put {{ MEDIA_URL }}.
I get the error in any case
On Oct 20, 11:09 am, bruno desthuilliers
wrote:
> On 20 oct, 09:56, knight wrote:
>
> > Hi,
>
> > I have override 2 admin templates: index.html and base_site.html.
> > The first line of index.html i
As I know, each category has attribute product_set
2009/10/20 ausi1972
>
> I am trying to work out how to construct a queryset that contains
> multiple records for a ManyToMany field.
>
> The models are like this:
> class products(models.Model)
>name = models.CharField()
>categories = mo
On Tue, Oct 20, 2009 at 8:21 PM, Михаил Лукин
wrote:
> There is three ways to select NULL records from table with Django ORM:
>
> 1. Model.objects.filter(field=None)
> 2. Model.objects.filter(field__exact=None)
> 3. Model.objects.filter(field__isnull=True)
>
> They all seem to work.
> Which is th
For some reason, __exact and __isnull are described in documentation [1],
while =None is not. So which of them are historical?
[1]
http://docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries
2009/10/20 Russell Keith-Magee
>
> These three queries are all exactly the same, and if yo
I'm trying to use a mix between the http://wiki.dreamhost.com/Django#Setup
and http://webhostingreal.com/content/view/18/1/ (which looks slightly
more recent then the wiki) to setup django on a PS server with
Dreamhost. I'm stuck at the easy_install portion.
I realize dreamhost might not be the
I have the following models and I'd like to use them to generate a
contact form...now I know I'm suppossed to use inline formsets, but
I've never been able to make heads or tails of how to make this
work...I want to have the first name, last name, email, phone number,
best time to contact, and the
On Tue, Oct 20, 2009 at 9:09 PM, Михаил Лукин
wrote:
> For some reason, __exact and __isnull are described in documentation [1],
> while =None is not. So which of them are historical?
As I said, __exact and __isnull are historical.
The documentation you reference points out that __exact=X and =
Hi Selena,
To avoid this problem and make your app relocable, you should not use
hard coded paths.
Here's what I use on my projects:
from os import path
rel = lambda *x: path.join(path.abspath(path.dirname(__file__)), *x)
DATABASE_NAME = rel('dev.db')
MEDIA_ROOT = rel('media')
TEMPLATE_DIRS = (
Михаил Лукин wrote:
> For some reason, __exact and __isnull are described in documentation
> [1], while =None is not. So which of them are historical?
Django pre 1.0 generated bogus SQL, when doing nullable_field=None.
These days __isnull can be replaced by the expressions:
filter(foo__isnul
Christmas is around the corner: And old customers can also enjoy the
gifts sent by my company in a can also request to our company. Gifts
lot,Buy more get the more。Only this site have this treatmentOur goal
is "Best quality, Best reputation , Best services". Your satisfaction
is our main pursue.
Hi ALL:
We have a new django powered project which have a potential heavy-traffic
characteristic(means a heavy db interaction). So we need to consider the
database scalability in advance. With some researches, the following
questions are still not clear to us:
1. coarse-grained: how to specify
On 20 Oct 2009, at 14:49 , Russell Keith-Magee wrote:
>
> Ok - this may border on spam
I disagree that it "borders on" spam. It is downright spam (and I'm
glad my spamtrap flagged it as such and sent the original message
straight to the bin).
--~--~-~--~~~---~--~-
On Tue, Oct 20, 2009 at 9:51 PM, Michael P. Jung wrote:
>
> You're right in one thing. The whole foo=value thing is not documented.
>From the "exact" subsection in
http://docs.djangoproject.com/en/dev/topics/db/queries/#field-lookups
"""
For example, the following two statements are equivalent:
Python add's itself to your path by default right? If not, it would be much
more convenient just adding python to your path so you could just say
"python" instead of the full path to the exe...
--~--~-~--~~~---~--~~
You received this message because you are subscrib
buttman wrote:
> you could also do it this way:
>
> http://pythonblog300246943.blogspot.com/2009/09/cron-jobs-with-django-made-easy.html
url whacking like that is pretty evil...
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.
Shawn Milochik wrote:
> I know this doesn't answer the hard part of your question, but here's
> a simple way I delete old stuff from a database via an external script
> that's run by cron:
>
> Item.objects.filter(date_updated__lte = datetime.now() - timedelta
> (days = 30)).delete()
Yep, th
On 20 Paź, 08:37, "Michael P. Jung" wrote:
> > I was unclear, but SQL should explain what I want to do - select
> > all ObjectRevision-s that are latest in Object-s that they belong to.
> > Moreover, I want to do this in with one ORM query, without resorting
> > to SQL or splitting the query to
As I said in my first post, I understand that all three ways are correct. I
just wanted to know "the best", which means that it should always give the
same results and should not be deprecated in the future.
If I understand you correctly, "=None" is most recent implementation of "is
null" and (for
mp> I'd go for a denormalized database:
mp> (...)
tz> I'm aware of this solution, in fact I was using it. Unfortunately I
tz> had problems with deleting objects with this circular dependency, but
tz> maybe I was overlooking something (db we're using is MySQL 5).
You're right. You have to make su
On Thu, Oct 15, 2009 at 12:30 PM, Gerard wrote:
>
> Hi All,
>
> It seems the max_lenght from the model definition is not respected
> thoughout
> the form that's created when using Modelform.
>
> company_name = models.CharField(max_length=75)
>
> Is this correct or am I missing something?
>
T
On Fri, Oct 16, 2009 at 8:04 AM, grimmus wrote:
>
> Hi,
>
> On my website i have a edit profile page, this enables users to edit 4
> fields : username, first name, last name and email address. For some
> reason the form never validates, is it not enough just to pass the 4
> fields i want to edit
On Sun, Oct 18, 2009 at 12:52 PM, eric woodworth wrote:
> Hi,
>
> This is my first django app and I can't seem to get filter_horizontal
> to work correctly. I've seen other people asking about this but I don't see
> any answers in an hour of searching. Can anybody give me some insight into
>
On Sun, Oct 18, 2009 at 8:41 PM, Christophe Pettus wrote:
>
> Greetings,
>
> I'm installing Django on a Centos 5.3 system, running under mod_wsgi
> on Apache, using Django 1.1.1. In a very basic install, when I
> attempt to access the /admin/ URL, I get the above error... but the
> templates are
On Mon, Oct 19, 2009 at 5:03 PM, John Handelaar wrote:
>
> Hello
>
> For reasons I won't bore you with, a Mysql legacy DB *whose schema I
> cannot alter* contains (inter alia) two tables. I'm trying to write
> an alternative front-end to this DB in Django which would be
> read-only.
>
> tableone
There is a couple of models in auth application to check user permissions in
Django. But sometimes we need to grant permissions per instance, not per
model.
Example:
*class Employee(django.contrib.auth.models.User):
pass
class Task(models.Model):
summary = models.CharField(max_length=50)
des
Why not do this:
for p in products.objects.all():
for c in p.categories.all():
print p,' - ', c
-richard
On Oct 20, 7:57 am, Михаил Лукин wrote:
> As I know, each category has attribute product_set
>
> 2009/10/20 ausi1972
>
>
>
>
>
> > I am trying to work out how to construct a q
On Tue, Oct 20, 2009 at 1:47 PM, Михаил Лукин
wrote:
> What is your best practice in such situations?
write a custom tag
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
Good idea, thanks Javier.
2009/10/20 Javier Guerra
>
> On Tue, Oct 20, 2009 at 1:47 PM, Михаил Лукин
> wrote:
> > What is your best practice in such situations?
>
> write a custom tag
>
> --
> Javier
>
> >
>
--
regards,
Mihail
--~--~-~--~~~---~--~~
You receiv
On Tuesday 20 October 2009 11:47:51 Михаил Лукин wrote:
> Next, we don't want 'edit' and 'change status' links to always appear on
> task detail page, so we pass 'can_edit' and 'can_change_status' flags to
> the template. But we never trust the browser, so in views 'task_edit' and
> 'task_change
Actually, I told about server-side form processing, not client-side. When
client posts data, I always check permissions in a VIEW that receives it.
2009/10/20 Mike Ramirez
> On Tuesday 20 October 2009 11:47:51 Михаил Лукин wrote:
>
> > Next, we don't want 'edit' and 'change status' links to alwa
Hi,
I'm still very much a noob for django... as I'm a systems guy for my
day job... as my problem will illustrate...
Im not sure how I should go about this really... I've tired several
ways and I've been looking through the archives and browsing the web
for the last two days
I'm trying to t
Hello everybody,
I'm facing a delicate problem. I want to make ensure the security of
my app and I created a unitest to do so. To make it easy, I was
thinking about fixture, but they don't support model permission
evolution and create conflict over time. So I add a function linked to
the syncdb
./manage runserver is OK for debugging purposes... unless you use
server-specific features, in my case - NTLM authentication. When deploying
Django project with Apache2+mod_wsgi, I need to `rcapache2 reload` to apply
changes in Python modules (while `manage runserver` does this automaticaly).
This
When I had to do this kind of tasks, I've added a new management command and
run it from the cron (or manually any time you need it, with params, etc).
You can run it calling
python manager.py miCommand parameters
The official documentation is not very complete, which is rare, but there
are some
On Oct 21, 4:00 pm, Михаил Лукин wrote:
> ./manage runserver is OK for debugging purposes... unless you use
> server-specific features, in my case - NTLM authentication. When deploying
> Django project with Apache2+mod_wsgi, I need to `rcapache2 reload` to apply
> changes in Python modules (whi
On Oct 21, 5:07 pm, Graham Dumpleton
wrote:
> On Oct 21, 4:00 pm, Михаил Лукин wrote:
>
> > ./manage runserver is OK for debugging purposes... unless you use
> > server-specific features, in my case - NTLM authentication. When deploying
> > Django project with Apache2+mod_wsgi, I need to `rcap
On 20 okt, 21:19, r_f_d wrote:
> Why not do this:
>
> for p in products.objects.all():
> for c in p.categories.all():
> print p,' - ', c
>
> -richard
>
> On Oct 20, 7:57 am, Михаил Лукин wrote:
>
This will obviously leave you with a lot of queries. Take a look at eg
django-selectre
57 matches
Mail list logo