Hello Praveen,
Thanks for you reply
I tried with following script and it worked
import win32file
import win32con
int a = win32file.GetFileAttributes("C:\\TestFiles\\r.txt") &
win32con.FILE_ATTRIBUTE_HIDDEN
win32file.GetFileAttributes("C:\\TestFiles\\r.txt") will return 32 if
the file is withou
There is not a big deal.
If you want to find the hiddend file on windos there is one command
attrib -h
for more info look at http://commandwindows.com/command2.htm and find
for "Changing file attributes with "attrib" "
for unix http://www.faqs.org/docs/securing/chap5sec62.html
you need to write and
Hi,
I have a database of related data connected via foreign keys. One to
many relationships between one table and various other tables.
Random example:
Client
- id
- name
- age
Receipts
- id
- client (fk)
- timestamp
Contacts
- id
- client (fk)
- timestamp
I have my urls.py looking something l
Guys, can you please share your approach to handle complex models
where each model has a ForeignKey to another? I am trying to build a
flex app using RemoteObject and [RemoteClass(alias=...)] flex feature
to map flex VO to django data models.
Here's an approximate scenario I'm working with:
---
Hi all,
I have a question about complex form.
There are my models:
class Country(models.Model):
name = models.CharField(max_length=30)
class Author(models.Model):
name = models.CharField(max_length=30)
age = models.IntegerField()
Tom,
You could try doing this clear logic in a pre_delete signal. You might have
to test out the timing of when the signals get called but it should call
pre_delete for all deleted models. In this case it would call pre_delete on
model2 before model1 but you should be able to get what you are look
Mr. Yu,
On Tue, Apr 13, 2010 at 9:56 AM, Mister Yu wrote:
>
> 1. can you suggest an up-to-date(django 1.1) book which can guide a
> newbie to a higher level? ebook is ok, free is more than ok :)
>
I think the semi-official Django book is where most people start. It's
available online and curre
Hi experts,
i m a newbie and i m self learning django and writing an web app as i
go along. i learn django by following this great screencast tutorial
from here: http://showmedo.com/videotutorials/series?name=PPN7NA155
called Django From the Ground-up.
it's a really great serious of tutorial. how
Hi,
maybe someone would be interested in: http://eclipse.kacprzak.org/
I use Eclipse + PyDev, however Django tags coloring was always sth I
was missing.
However if you found such a plugin already, please let me know.
I'd like to avoid wasting my time in duplicate implementation.
Regards,
Zbiggy
On Tue, Apr 13, 2010 at 2:14 AM, Phlip wrote:
>> How do I access the error message?
>
> In this case, turning on --verbosity=2 reveals a huge dump, and
> tweezering through it reveals the fixture file was not found. (A
> colleague bumped its app from the app list.)
>
> It seems that "fixture not f
Or, using range:
MyModel.objects.filter( Q(a__range=(1,5)) | Q(b__range=(20,70)) )
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
Hi, I'm trying to figure out the way django deletes models so that I
can clear the correct references that I need to prior to deleting. So
I have models set up with overrided delete functions so that I can do
clears before the actual delete. However, it appears the delete
functions in a model don't
http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects
MyModel.objects.filter( ( Q(a__gt=1) & Q(a__lt=5) ) | ( Q(b__gt=20) &
Q(b__lt=70) ) )
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
On 13 April 2010 01:09, zweb wrote:
> how do i do this kind of condition in django orm filter:
>
> ( 1 < a < 5) or ( 20 < b < 70)
>
> select * from table where (a between 1 and 5) or (b between 20 and 70)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Djang
To get to the attributes: do this: {{ form.title.field.max_length }}.
Does not seems to see this documented anywhere.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscr
how do i do this kind of condition in django orm filter:
( 1 < a < 5) or ( 20 < b < 70)
select * from table where (a between 1 and 5) or (b between 20 and 70)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email t
On Mon, Apr 12, 2010 at 5:55 PM, Phlip wrote:
> Or do all of your see filenames and line numbers, for your .html
> templates, at error time?
>
>
I do on debug pages, with the line causing the error highlighted.
I'm still not sure if you are talking about test output or debug pages. (I
didn't sug
On Apr 13, 8:07 am, Bdidi wrote:
> On Apr 12, 8:31 pm, Steven Elliott Jr wrote:> Did
> you run the install as sudo?
Yes, the install was run as sudo.
Alex Robbins wrote
> If you are planning to deploy to linux servers, you might have a nicer
> time developing on a linux vm. I have a mac, bu
Without seeing the traceback, this is all just guessing--stabbing in
the dark. But...
a) posting a traceback allows people to actually help not only solve
the problem, but help show how to read the traceback.
b) commenting out template code may have suppressed the problem, but
that still doesn't
On Apr 12, 8:31 pm, Steven Elliott Jr wrote:
> Did you run the install as sudo?
>
> -Steven Elliott Jr
>
Hmm, good question - I'd better check that.
Thanks,
Brett
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send em
Replying to my own message - problem solved - ignore previous posting!
I forgot to include my variables in my response
so expected values were not being passed - I was doing this:
variables = RequestContext(request, {
'form': form,
'caller': caller,
'error': error
})
retur
> If you posted some specifics of what you are actually seeing, someone might
> be able to help. I mean, actually copy-paste the traceback into your post
> (or put it someplace like dpaste.com and point to it).
I am not asking "oo help I can't get my template working". That part's
done - by clampi
You could try a custom filter_spec.
Examples @ http://www.djangosnippets.org/tags/filterspec/
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, se
On Mon, Apr 12, 2010 at 3:28 PM, phoebebright wrote:
> If you edit an item in admin, a files uploaded are displayed above the
> input field. But if the model form is loaded with an instance, the
> form seems unaware that there may already be an uploaded file. No
> existing file is displayed and
First off, you should know Python a bit before you start trying to use Django.
Otherwise you'll keep asking "how do I do X in Django," when what you really
want to know is how to do it in Python.
http://docs.python.org/tutorial/index.html
Secondly, start with the official documentation, which is
Again, without seeing the trace it's hard to say, but it sounds like
your error is happening well before it ever gets to the template,
making the template irrelevant.
On Apr 12, 4:10 pm, Phlip wrote:
> > Uusually the first line in the traceback tells you pretty explicitly
> > where the error is.
On Mon, Apr 12, 2010 at 5:10 PM, Phlip wrote:
> > Uusually the first line in the traceback tells you pretty explicitly
> > where the error is. Without the traceback, it's hard to say where your
> > problem lies.
>
> One of the templates is "basket.html", and "basket.html" does not
> appear in the
> Uusually the first line in the traceback tells you pretty explicitly
> where the error is. Without the traceback, it's hard to say where your
> problem lies.
One of the templates is "basket.html", and "basket.html" does not
appear in the transcript.
All the lines are only django's internal rend
Uusually the first line in the traceback tells you pretty explicitly
where the error is. Without the traceback, it's hard to say where your
problem lies.
On Apr 12, 3:25 pm, Phlip wrote:
> Djangoists:
>
> When code below a template throws an error, we get an insanely
> detailed stack trace of all
Thank you! I was trying to hunt that down but gave up hope and assumed
django didn't handle that. Saves me several lines, thanks again
On Apr 12, 3:18 pm, Ian Struble wrote:
> I think you are looking for the 'in' field lookup:
>
> http://docs.djangoproject.com/en/dev/ref/models/querysets/#in
>
hey guys im a noob @ django/python i still dont understand the concept
of django and python
i know django is a framework for pytohn and python is a scripting
language but i dont know exactly what django does and even if i did i
still cant figure out how to install Django with python i tried and by
Djangoists:
When code below a template throws an error, we get an insanely
detailed stack trace of all the lines AROUND the template.
How do I tell what lines INSIDE the templates caused the error?
--
Phlip
http://c2.com/cgi/wiki?ZeekLand
--
You received this message because you are subscr
I have a reusable search form and want to display a different form
header based on where/how the search is called from (I get this from
the url). In the search template I'd like to test a variable to
determine which header to display. I need to somehow pass variable
from the view the template - som
Probably a dumb question, but can the comments system handle generic
comments? In other words, if I just have a general "comments" page,
can I have comments that aren't attached to any particular object?
--
You received this message because you are subscribed to the Google Groups
"Django users"
I'm not saying it's the best way, but I would either define my own
get_comment_count in my application's models.py that looped through
the ojbects comments (and their comments) to get an accurate count.
OR
I would store comment_count locally on the object and send a signal
when a comment is saved
There are several ways you can do it, but probably the most
straightforward is how django does it in the first place:
{% for field in form %}
{% if field.is_hidden %}
{{ field }}
{% else %}
{% if field.errors %}{{ field.errors }}{% endif %}
Hi everybody:
I am implementing comments functionalities in my web application, I am
making the documentation examples.
I have customized my comment form exaxtly like the documentation:
{% get_comment_form for document as form %}
{{ form }}
But the thing is that a field that is su
If you edit an item in admin, a files uploaded are displayed above the
input field. But if the model form is loaded with an instance, the
form seems unaware that there may already be an uploaded file. No
existing file is displayed and if the form is resaved, the uploaded
file link is lost.
Am po
hey everyone,
i'm a young django user and need some advice or opinions on the way of
general use.
in my application (blog-like site) i have objects and they can have
comments. i also decided to implement limited comment reply feature.
so the objects can have comments, and those comments can have c
I think you are looking for the 'in' field lookup:
http://docs.djangoproject.com/en/dev/ref/models/querysets/#in
Item.objects.filter(genre__in=some_video.genre.all())
On Apr 12, 10:03 am, Nick Serra wrote:
> Hey everyone, thanks for looking. I couldn't think of a good title for
> this one.
To answer my own question, it looks like you can't do this:
class LinkForm(ModelForm):
event =
forms.ModelChoiceField(queryset=Event.objects.filter(start_date__lte=today).order_by('-start_date')[:15])
The limit (of 15) will be counted as another 'slice' when the form is validated.
I got aroun
We are currently installing the latest version of Django and Python on
IIS6. We have followed the instructions on the following site:
http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer
We are receiving a 403 error when trying to access our Django
application via the IIS server.
Rookie programmer here, so please excuse if this is the wrong forum.
I have a simple app on Google Appengine that uses the built in django
template system. This displays the data great, the forms, work etc.
What I really want is a way to edit the data within a table interface,
like a datagrid.
I'd like to display 2 inline forms on the same page, which are
different filtered versions of the same table.
Screenshot of the page:
http://static.mftransparency.org/media/misc/2-inline-filtered-formsets.png
I filter the queryset to limit the form to a subset of the table:
class Disburseme
> How do I access the error message?
In this case, turning on --verbosity=2 reveals a huge dump, and
tweezering through it reveals the fixture file was not found. (A
colleague bumped its app from the app list.)
It seems that "fixture not found" should be a fatal error, not a
silent warning. The f
Djangoists:
(Under version 1.1.1) loaddata (and the fixtures= line in tests)
silently fails if the data cannot load.
How do I access the error message?
--
Phlip
http://c2.com/cgi/wiki?ZeekLand
--
You received this message because you are subscribed to the Google Groups
"Django users" grou
Welcome! You might just want to incorporate the answer into the
question model, and then do a boolean field for is_answered for quick
reference. The thought of multiple answers for one question seems odd,
and use of one-to-one fields isn't recommended, so i'd just keep it in
one model l)
On Apr 12
I think this can help you, it allows you to make choices for django
admin fields.
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.Field.choices
http://www.djangoproject.com/documentation/models/choices/
-Francis
On Apr 12, 10:58 am, Daxal wrote:
> Hey,
>
> I am wonderin
Yes! That's it! Thank you.
On Apr 12, 1:21 pm, Nick Serra wrote:
> You could query like this:
>
> Question.objects.filter(answer__isnull=False)
>
> This would give you a set of questions where an answer exists. Setting
> it to True would give you a set where answers don't exist.
>
> On Apr 12,
You could query like this:
Question.objects.filter(answer__isnull=False)
This would give you a set of questions where an answer exists. Setting
it to True would give you a set where answers don't exist.
On Apr 12, 12:20 pm, Jim N wrote:
> Just to clarify, I'm trying to filter questions that hav
I'm using the standard reset password option and all the other fields
are filled in but the {{new_password}} field is blank.
Here is the email:
You're receiving this e-mail because you requested a password reset
for your user account at nwlc
Your new password is:
Feel free to change this passwor
Hey everyone, thanks for looking. I couldn't think of a good title for
this one. I have a question on queries on manytomany relations. Here
is an example:
class Item:
genre = models.ForeignKey(Genre)
class Genre:
name = models.CharField()
class Video:
genre = models.ManyToManyField(G
Just to clarify, I'm trying to filter questions that have an answer,
but I don't know the particular answer. I just want to determine
whether or not an answer object exists, with the foreign key of this
question.
I could do
Answer.objects.filter(question = my_question)
but I am filtering ques
To Summarize, two options are,
1) Template method pattern which Thierry suggested
http://en.wikipedia.org/wiki/Template_method_pattern
2) Django Decorators
On Apr 10, 11:38 pm, Thierry Chich wrote:
> I have written my functions as méthods of classes. Then it allow to
> use inheritance.
>
> L
Hi Djangoists,
I have a model "question" which has a one-to-many relationship with
"answer".
class Question(models.Model):
text = models.TextField()
class Answer(models.Model):
text = models.TextField()
question = models.ForeignKey(Question)
I can't figure out how to construct a fil
Hi,
I'm trying to create full text search on model, everything goes fine when
searching TextFields but I have a problem with ForeignKey field.
How can i do that? Can anyone point me to the right direction?
Thanks
Model example:
class Model1(models.Model):
text_field =models.TextField(ma
> On Mon, Apr 12, 2010 at 1:58 PM, Omer Barlas wrote:
> > Can you please add a prefix to the email subject? I am reading my mail
> > mostly from my BB Bold, but I cannot filter mail like Thunderbird
> > does, it would be much simpler if there was a prefix like [django] or
> > such.
>
It is tru
Thanks this helped me with a similar problem
On Feb 16, 8:18 am, Matt Schinckel wrote:
> On Feb 14, 3:49 pm, john wrote:
>
>
>
> > Yes, the Items model data can be accessed through another part of the
> > Admin interface, but I think the purpose of the Green Plus Sign was to
> > alleviate this e
On 12 avr, 14:47, Pradnya wrote:
> Hello,
>
> I am using Django with Python on windows. I want to list the files
> from specific directory and want to highlight files / directories
> which are hidden. How to recognize a file / directory as it's hidden?
This is highly platform-specific, and by no
Hey,
I am wondering on how to populate list of items for a specific field
on model from the admin section of Django?
For ex,
class cvdb(models.Model):
language = models.ManyToManyField(Language,
db_table='cm_cvdb_language',
verbose_name="languages")
I would
Hello, I kind of found the answer; for create_update generic view,
the framework create a ModelForm object 'form', but in package form,
class Field only has the following instance attributes. In particular,
why attribute label worked and others did not, can be explained.
In further tracing, why
thanks for your reply i will try python socket programming in views and if i
have any problems will post it
On Mon, Apr 12, 2010 at 4:41 PM, Javier Guerra Giraldez
wrote:
> On Mon, Apr 12, 2010 at 5:19 AM, vishwanath b
> wrote:
> > tom i know the programming language is python but the frame
I have a simple filter that takes input based upon the url.
urlpatterns = patterns('ahrlty.listings.views',
(r'^(?P.*)$', 'index'),
)
In the view I do a simple validation against a tuple in my listings
model that I use for choices in a field.
if dict(Listing.listing_types).has_key(listin
On Sat, Mar 27, 2010 at 10:40 PM, Paul Harouff wrote:
> On Sat, Mar 27, 2010 at 2:45 AM, Thierry Chich
> wrote:
>> Are you sure that the postgres driver of your jython is installed ?
>>
>
> Yes. But I don't believe Jython is seeing it.
>
> I might have to switch to python. I was hoping to use jy
If you are planning to deploy to linux servers, you might have a nicer
time developing on a linux vm. I have a mac, but do my development in
an ubuntu vm. Many difficult installations become a simple "sudo apt-
get install ".
YMMV,
Alex
On Apr 12, 2:09 am, Bdidi wrote:
> I reinstalled XCode to in
Hi,
> I'm a little concerned by django error handling.
you could try the Werkzeug debugger[1], it really does save time a
lot. Or, by the way, you could try Werkzeug without Django, in some
cases it's a good idea.
There are many good frameworks, I suggest that you pick the language
first and then
Hello,
I am new to Django. I tried experimenting with create_update generic
view, exploring the template tags, especially concerning widgets.
From my reading of the documentation, within the
_form.html is passed the model form (either
passed in, or the framework create one), and therefore, the m
This is a tough question for sure.
If you prefer Ruby syntax, then to me it seems clear. If it feels
clunky, it won't flow properly and you won't code as well.
Then again, you point out that you built a finished product quickly
and you're happy with it compared to what you built with Rails. Isn
Hi,
I would like to know if it is possible to use properties as filters in
the admin site.
I have a model with a property and would like to use this property as
a filter. As far as I read in the documentation one can only use
attributes as filters but I would like to know if there is any
workarou
Hello,
I am using Django with Python on windows. I want to list the files
from specific directory and want to highlight files / directories
which are hidden. How to recognize a file / directory as it's hidden?
This particular application could be running on Unix / Linux platform.
Is there any com
On 09/04/10 12:42, CCC wrote:
now i have a finished template which wrote by j2ee,like this:
Your template stuff (FreeMarker I think?), well, it is not Django.
And Now i want to changeit,write by django,anyone know how to achieve
the "<#break>"
in this tenplate
thanks!
Well, you can't (IIRC
Here's the (simple) solution:
http://stackoverflow.com/questions/2621440/generic-list-view-raises-attribute-error-function-object-has-no-attribute-c
Change .filter(pub_date__lte=datetime.datetime.now())
to .filter(pub_date__lte=datetime.datetime.now)
On Apr 12, 11:46 am, QC wrote:
> An odd err
Thanks, Peter, this is what i want.
Now the question is how to customize django to use 'allow_unicode=True' and
'default_flow_style=False'?
I found quick and dirty solution.
in Django-1.1.1-py2.5.egg/django/core/serializers/pyyaml.py
i changed a little:
def end_serialization(self):
On Mon, Apr 12, 2010 at 4:41 AM, Sheena wrote:
> Still no luck...
> I've run syncdb and I can talk to my db through the interpreter easily
> so I don't think there's a problem with that.
> When i log in i get add and change options for Groups, Users, Comments
> and Sites but not for anything rela
An odd error here, perhaps someone can help track down source as it's
attempting to extend the Django CMS & attempts to use uses some logic
written as part of that project. In short, using:
urls.py
==
from django.conf.urls.defaults import *
from cmsplugin_flat_news.models impor
On Mon, Apr 12, 2010 at 5:19 AM, vishwanath b wrote:
> tom i know the programming language is python but the framework is
> djangoso i want to know how to use the python socket code in this
> framework that is what my question is?
- there's no IPC code in Django
- there are lots of IPC in Py
On 09/04/10 19:05, Paweł Roman wrote:
I've noticed that django always fetches 'naive' datetimes from the
database. Tzinfo property on a datetime object is always set to null,
even if the database stores a value WITH a timezone.
This is a bit tedious because such datetime cannot be later converte
AAh, Why didn't I think of that ><,
Well, thank you very much. It works now.
Grtz, Dexter
On Mon, Apr 12, 2010 at 1:16 AM, Sam Lai wrote:
> On 12 April 2010 07:41, Dexter wrote:
> > I have problem's with 2 templates, the newest, it is in the same dir as
> my
> > index.html template (Which doe
Did you run the install as sudo?
-Steven Elliott Jr
On Apr 12, 2010, at 3:09 AM, Bdidi wrote:
I reinstalled XCode to include 10.4 support and tried again, and
MySQLdb is now installed, but now I get this:
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
site-packages/dj
tom i know the programming language is python but the framework is
djangoso i want to know how to use the python socket code in this
framework that is what my question is?
On Apr 12, 12:08 am, "Tom X. Tobin" wrote:
> On Sun, Apr 11, 2010 at 12:45 PM, vishwanath b wrote:
> > as i searched th
Thanks for reply
I know waht's you mean.
But in the template inside the for loop,there are some 'css',not only
just put the result in the template
That's the difficult i can't solved out
On Apr 12, 4:41 pm, Jirka Vejrazka wrote:
> > the syntax you're using is not standard Django template syntax
> the syntax you're using is not standard Django template syntax, so
> unless someone has replaced the default Django tempating system with
> the same one as you did (and is familiar with it and read your email),
> you are unlikely to get a response from this list.
Oops - sorry. I misread your
Still no luck...
I've run syncdb and I can talk to my db through the interpreter easily
so I don't think there's a problem with that.
When i log in i get add and change options for Groups, Users, Comments
and Sites but not for anything relating to my application (as created
in chapter 5 of the Djan
>> now i have a finished template which wrote by j2ee,like this:
>> <#list dailyStarList as dailyS>
>> > 0>class="list_color_w"<#else>class="list_color"><#list
Hi,
the syntax you're using is not standard Django template syntax, so
unless someone has replaced the defaul
I reinstalled XCode to include 10.4 support and tried again, and
MySQLdb is now installed, but now I get this:
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
site-packages/django/db/backends/mysql/base.py", line 13, in
raise ImproperlyConfigured("Error loading MySQLdb
85 matches
Mail list logo