Awesome, following.
On Nov 7, 1:28 pm, djangopro <[EMAIL PROTECTED]> wrote:
> Hello everybody,
>
> We will be broadcasting professional django development news and tips
> via our twitterhttp://twitter.com/djangopro. Please follow and let
> everybody know. @djangopro is an effort to make the djang
> This idea is a little more sound, and is certainly in the realm of the
> possible. I have some plans to improve fixture loading as a part of my
> work on ticket #7052; Adding a --noclobber option would be a
> reasonable extension to this work. I would suggest opening a ticket so
> that the idea i
On Sat, Nov 8, 2008 at 1:19 PM, Dana Woodman <[EMAIL PROTECTED]> wrote:
>
>> Having an option to add data in the way you describe isn't really a
>> good idea. If the syncdb behaviour was changed to add rather than
>> overwrite initial data, you would have a different (and IMHO much
>> worse) conse
DR,
Now I have a new problem. When I use this as a related_manager
(Report.objects.all()[0].task_set.accomplishments()) it returns all
the accomplishments. I've even added the use_for_related_fields=True
in the manager. The all() (default) call seems to work fine, but the
others done.
Any ide
On Sat, Nov 8, 2008 at 1:35 AM, Ivan Tarradellas <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> With Django, what is the easy and best way to serialize/deserialize
> objects that are no Django objects?
>
> django.core.serializers only works with Django objects. But what
> happens if we have other obje
> The initial data fixture is reloaded every time that syncdb is
> executed; this will overwrite any changes that have been made to that
> initial data. This is normal, intended behaviour, and there isn't a
> setting or option to change this behaviour.
>
I had a feeling that was the case...
Havin
thanks alot for your reply. i need to check out this logout_then_login
method. i will update the status after testing.
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group
On Sat, Nov 8, 2008 at 5:13 AM, Dana <[EMAIL PROTECTED]> wrote:
>
> Hey everyone,
>
> I just set up a few fixtures for some of my models and realized that
> every time I syncdb it changes the existing data in my database. I
> assume this is normal behavior, but I was wondering if it is possible
>
>
> As I understand, and also as documented syncdb doesn't change existing
> table.
I wish that were true but its not the case. When I run syncdb, it will alter
the object if it was already created.
Here is what my initial_data.json file looks like:
[
{
"pk": 1,
"model": "my
On Fri, Nov 7, 2008 at 9:45 PM, tegbert <[EMAIL PROTECTED]> wrote:
>
> SELECT FOR UPDATE has been discussed in this group before, but I don't
> think it's been resolved whether it should be implemented in Django. I
> think it should.
>
> [snip]
>
... Any thoughts on how this could be implemented w
SELECT FOR UPDATE has been discussed in this group before, but I don't
think it's been resolved whether it should be implemented in Django. I
think it should.
The idea is to avoid update collisions, i.e., the situation in which
one process is attempting to select a row and update it, and while
do
On Fri, Nov 7, 2008 at 5:28 PM, matthew <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm sure this is a properly neophyte post, but I'm stumped and would
> really appreciate some guidance. I am trying to serve a site under
> apache2 using django. I have apache2 and mod_python installed (setup
> below).
> I just set up a few fixtures for some of my models and realized that
> every time I syncdb it changes the existing data in my database. I
> assume this is normal behavior, but I was wondering if it is possible
> to have the fixtures only *add* data and not change it?
As I understand, and also a
Dave,
Thanks for the quick reply, yea, I figured out what I needed to do,
which turns out just what you said.
I will change to the pythonic way of doing things, thanks.
John
On Nov 7, 11:47 am, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Nov 7, 7:13 pm, John M <[EMAIL PROTECTED]> wrote:
>
>
> I was trying to parse their data and replace it empty date fields
> values by a '-00-00', no luck.
maybe you should try to set default value in database engine. as I
know mysql supports it, and inserts default value if no value has been
provided.
--
Regards
Dulmandakh
--~--~-~--
Environment: Request Method: POST Request URL:
http://127.0.0.1:8080/save/Django Version: 1.0-final-SVN-unknown
Python Version: 2.5.2 Installed
Applications: ['django.contrib.auth', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sites',
'django_bookmarks.bookmarks'] Insta
Thanks for kind expatiation. I can understand why the error occured
easily.
But, it seems that templates' "." has to resolve dir(default_dict)
first before dictionary lookup.
Anyway, I glad to know the reason. Thanks.
Hyungyong Kim
On 11월7일, 오후10시18분, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
I have a list of categories that allows you to set a parent/child
relationship such as:
Financial
Financial > Billing
Financial > Billing > Collections
Financial > Invoices
In the example above, "Financial" is a category, then "Billing" is a
category with "Financial" as the parent, etc.
Hi all,
My question is:
Is there any chance to put into a DB date field a value -00-00
using Django ORM?
My users upload their data into a DB using Django application.
If the data field is empty from their source file, Django generate an
exception that format is not correct.
I was trying to
Hi,
I'm sure this is a properly neophyte post, but I'm stumped and would
really appreciate some guidance. I am trying to serve a site under
apache2 using django. I have apache2 and mod_python installed (setup
below). I have followed the instructions at
http://docs.djangoproject.com/en/dev/howto/d
Hello everybody,
We will be broadcasting professional django development news and tips
via our twitter http://twitter.com/djangopro. Please follow and let
everybody know. @djangopro is an effort to make the django community
stronger. More to come.
Thanks,
@djangopro
--~--~-~--~~---
Any thoughts on this one? Just checking.
Thanks.
On Nov 6, 9:06 pm, "Milan Andric" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a view that displays hundreds of applications based on some filter
> params. But I want to render the actual template based on user (an fkey)
> and list their appli
Thanks for your help. I am so close to what I want.
The output that I want is an XML file. So I try:
reporter = Reporter.objects.get(id=10)
arts = reporter.article_set.all()
xmlout = serialize('xml',arts,fields=('date','reporter.name'))
However, it writes date but it does not w
> I tried your suggested solution and instead of printing the result I
> use Django serializer to create an XML file. But it seems that
> something is taking too
> long and my browser just stalls. Is it because of select_related()
> method? I have about 200 articles per each reporter.
Another pos
Many thanks tim for your quick reply. You are right I meant inner join
not cart product.
I tried your suggested solution and instead of printing the result I
use Django serializer to create an XML file. But it seems that
something is taking too
long and my browser just stalls. Is it because of sel
Hey everyone,
I just set up a few fixtures for some of my models and realized that
every time I syncdb it changes the existing data in my database. I
assume this is normal behavior, but I was wondering if it is possible
to have the fixtures only *add* data and not change it?
For example:
I have
> class Reporter()
> id primary key
> name
> e-mail
> ...
>
> class Article()
> reporter = model.ForeignKey(reporter)
> date
> ...
>
> Now I want to implement the following SQL statement in Django:
>
> select name,e-mail,date from Reporter,Article where reporter
Hi,
I am a newbie and am trying to select fields from two table related to
each other using a foreign key:
class Reporter()
id primary key
name
e-mail
...
class Article()
reporter = model.ForeignKey(reporter)
date
...
Now I want to implement the following SQL s
On Nov 7, 7:13 pm, John M <[EMAIL PROTECTED]> wrote:
> I wanted to get some feedback on how I'm using custom model managers.
>
> I've put all my queries into one manager, each in a different method.
> Is this the right way to go?
>
> So for example:
>
> CHOICES_TASK = (
> (
On Nov 7, 4:11 pm, jago <[EMAIL PROTECTED]> wrote:
> Sure.
>
> {% for gallerykind in gallerykinds %}
>
> {{ gallerykind.title }}
>
> {% if gallerykind.author %}
>
Hello,
I was wondering if I could get some advice for the following problem I
am trying to solve. Is it possible to have a form field (or widget)
render different html elements depending on different situations?
To help illustrate my point, I have come up with the following fake
scenario which
I wanted to get some feedback on how I'm using custom model managers.
I've put all my queries into one manager, each in a different method.
Is this the right way to go?
So for example:
CHOICES_TASK = (
("NO", "None"),
("GR", "Green"),
Hi,
I got Django to work behind Apache2 with mod_python, but had some
questions for the experts.
1) Is there an easy way to log stdout without re-writing all my output
statements? What about python logging?
2) Is there a good way in Django to put startup code when deployed in
Apache that only g
to quote the django internationizaton documentation...
"Using ugettext_lazy() and ungettext_lazy() to mark strings in models
and utility functions is a common operation. "
Getting data from your models requires you to place
django.utils.translation.ugettext_lazy() functions within the
arguments
On Nov 7, 4:19 pm, Gerard flanagan <[EMAIL PROTECTED]> wrote:
> I don't know if it's clever or stupid, but this is what I have done in a
> similar situation:
>
It appears to be a nice solution - it throws an error If I try to
get_related() on a generic non-specialised place rather than just
ret
Hi,
I am trying to enable django cookie based authentification within
apache using the patch at http://code.djangoproject.com/ticket/3583.
Apache seems to be suceffuly passing the request onto django, but then
fails with the following error:
[Fri Nov 07 17:47:40 2008] [error] [client 10.1.0.27]
Thanks Alex that worked great.
Vitaly Babiy
On Fri, Nov 7, 2008 at 12:19 PM, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> Try to connection handler without `sender` specified. And filter needed
> models inside it.
>
> def my_handler(sender, **kwargs):
> if not isinstance(sender, CustomModel):
Try to connection handler without `sender` specified. And filter needed
models inside it.
def my_handler(sender, **kwargs):
if not isinstance(sender, CustomModel):
return
signals.pre_save.connect(my_handler)
On Fri, Nov 7, 2008 at 20:03, Vitaly Babiy <[EMAIL PROTECTED]> wrote:
> if
if I define a model called CustomModel and I attach attach a pre_save signal
to it. Is there any way to have that signal be called any time model that
extends CustomModel is being saved has that method saved.
I know i could do this by overriding the save method on CustomeModel but I
was wondering
Alistair Marshall wrote:
> As I said, I have the function named the same in each child class but
> I need to be able to access it from a list of all the Places.
>
> My current thinking is just a long list of try, except: statements
> attempting to call the subclass from the Place model but this f
Hi all,
With Django, what is the easy and best way to serialize/deserialize
objects that are no Django objects?
django.core.serializers only works with Django objects. But what
happens if we have other object type?
How to serialize this:
class MyClass(object):
a = 'a'
b = 'b'
xm
Sure.
{% for gallerykind in gallerykinds %}
{{ gallerykind.title }}
{% if gallerykind.author %}
by {{ gallerykind.author }}
On Nov 7, 2:12 pm, jago <[EMAIL PROTECTED]> wrote:
> I tried the slice solution before. Unluckily it returns a list itself
> holding 1 item instead of the item itself. Most importantly though I
> cannot use a variable like forloop.counter0 to select the item I want
> but instead can only use stati
Benedict Verheyen wrote:
I have solved it in my view.
However, i'm not sure this is the best way to deal with it.
In my view i set the input_formats of the datefield like this:
report_f = ReportForm(request.POST,instance=r)
report_f.base_fields['date_reported'].input_formats = ('%d/%m/%Y',)
To
You're right -- there's no need to run syncdb. All of this is a
learning exercise for me.
I'm just running the commands to see the output and behavior as I go
through the docs, with an eye for potential snags and "gotchas" that
might kill me later on.
On Nov 5, 9:06 pm, "Karen Tracey" <[EMAIL
500 error will generate a error log in your ~/logs/ directory, do a
little research on it, or maybe post it here :)
On Nov 6, 1:58 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I think I had the .htaccess and dispatch.fcgi files in the wrong
> place. I had them in the django generated mys
I changed my template model to use OneToOneField and remove the
Blank=True, but the same error appears...
On 7 nov, 12:30, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 7, 2008 at 9:10 AM, Daniel Roseman <
>
>
>
> [EMAIL PROTECTED]> wrote:
>
> > On Nov 4, 6:02 pm, Petry <[EMAIL PROTECTE
Here's my solutions, for anyone who may be experiencing the same
problem.
In my url config, I have 4 different named patterns corresponding to
each of the possibilities:
url(r'^(?P[a-zA-Z]+)/(?P[\+\-].\w+)/$',
'catalogueFilter', name="catalogue_search_no_filters"),
url(r'^(?P[a-zA-Z]+)/(?P[\
Hi,
> Although I would have to wonder why you're doing it this way, rather
> than using the database to sort them?
Since in my case it is easier. I need to filter out some item before.
This calculation
needs to be in python code.
Thomas
--
Thomas Guettler, http://www.thomas-guettler.de/
E-Ma
On Nov 7, 1:54 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I just discovered, that you can't sort a list of model instances.
>
> This failed with AssertionError:
>
> view_groups=sorted([brg.group for brg in ... ])
> change_groups=sorted([...])
> if view_groups=
On Fri, Nov 7, 2008 at 9:10 AM, Daniel Roseman <
[EMAIL PROTECTED]> wrote:
>
> On Nov 4, 6:02 pm, Petry <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I'm having a weird problem when using inlineformset_factory, he can
> > only register up to 2 records, after that causes a validation error
> >
> >
Wiadomość napisana w dniu 2008-11-07, o godz. 14:54, przez Thomas
Guettler:
> I just discovered, that you can't sort a list of model instances.
>
> This failed with AssertionError:
>
>view_groups=sorted([brg.group for brg in ... ])
>change_groups=sorted([...])
>if view_g
I tried the slice solution before. Unluckily it returns a list itself
holding 1 item instead of the item itself. Most importantly though I
cannot use a variable like forloop.counter0 to select the item I want
but instead can only use static numeric values like 1,2,3
On Nov 7, 10:39 am, Daniel Ros
On Nov 4, 6:02 pm, Petry <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm having a weird problem when using inlineformset_factory, he can
> only register up to 2 records, after that causes a validation error
>
> "(Hidden field id) User phone with this None already exists."
>
> Here is my forms [1], mo
Obviously I want to select for each iteration another item from the
array. Unluckily something like:
arr.forloop.counter0
forloop.counter0 is the variable that holds the currently used index
in a for loop: http://www.djangoproject.com/documentation/0.96/templates/#for
Any idea how I could selec
On Nov 7, 1:57 pm, PeteDK <[EMAIL PROTECTED]> wrote:
> Hiii everybody...
>
> I am trying to create this class called "car".
> In this car class i have an IntegerField "year". The thing is, this
> field should not be required and therefor the user should not be
> "forced" to enter anything into thi
anyone?
On 4 nov, 16:02, Petry <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm having a weird problem when usinginlineformset_factory, he can
> only register up to 2 records, after that causes a validation error
>
> "(Hidden field id) User phone with this None already exists."
>
> Here is my forms [
Hiii everybody...
I am trying to create this class called "car".
In this car class i have an IntegerField "year". The thing is, this
field should not be required and therefor the user should not be
"forced" to enter anything into this field if the person doesn't want
to.
However i can't seem to
Hi,
I just discovered, that you can't sort a list of model instances.
This failed with AssertionError:
view_groups=sorted([brg.group for brg in ... ])
change_groups=sorted([...])
if view_groups==change_groups:
...
else:
assert set(view_gro
On Nov 7, 9:02 am, "Alex Koshelev" <[EMAIL PROTECTED]> wrote:
> For example you can use `thread locals` to store there request object
Really, don't. As James has posted here many times, this was only ever
at best a horrible hack, and is now completely unnecessary.
In response to the OP, I'm not
On Fri, Nov 7, 2008 at 2:51 AM, Hyungyong Kim <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Since a few hours ago, I've suffered following problem.
> I found this problem is due to collections.defaultdict.
>
> Normal dictionary is working collectly, but defaultdict is not
> working.
>
> >>> from django.t
Rob Hudson wrote:
> I have the following:
>
> ## MODELS
>
> class Category(models.Model):
> user = models.ForeignKey(User)
> name = models.CharField(max_length=200)
>
> class Link(models.Model):
> user = models.ForeignKey(User)
> category = models.ForeignKey(Category)
> name
Well, it does, except that when you do a default_dict.items, it adds
"items" to the dict with a value of 0 in the template. To verify this,
try dumping default_dict after the exception is thrown. You will get a
new key called "items".
To fix your problem, pass dict(default_dict) to the Context.
>
Because I want persistent cache in some cases.
2008/11/7 DULMANDAKH Sukhbaatar <[EMAIL PROTECTED]>
>
> > I want to use per-view cache with memcached and low-level cache with
> > filesystem caching.
>
> what's the advantage of having both of them?
>
>
> --
> Regards
> Dulmandakh
>
> >
>
--
Rodr
Maybe you need something like that: http://www.djangosnippets.org/snippets/267/
Have a nice day,
Nikolay.
On Fri, Nov 7, 2008 at 13:36, Alex Jonsson <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
>
> I'm working on a Django application where I'd like to redirect IE6
> users to a specific page enc
Graham thanks,
First of all here is my httpd.conf file modules:
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule python_module modules/mod_python.so
#LoadModule dav_svn_module modules/mod_dav_svn.so
#LoadModule authz_svn_module modules/mod_authz_svn.so
#
So as you ca
Hey guys,
I'm working on a Django application where I'd like to redirect IE6
users to a specific page encouraging them to update their browser.
How would be the most efficient way of doing this?
Thanks!
Alex
--~--~-~--~~~---~--~~
You received this message becaus
On 3 Nov., 16:34, Bülent Aldemir <[EMAIL PROTECTED]> wrote:
> Create methods with like:
>
> class MyModel(models.Model):
> mystring = models.CharField(max_length=100)
>
> class MyForm(forms.ModelForm):
> def clean_mystring(self):
> raise forms.ValidationError('Error Message')
>
T
Sorry for the spam, I thought Google dint record my earlier reply ;)
On Nov 7, 12:36 pm, Raja <[EMAIL PROTECTED]> wrote:
> If you are using the "django.contrib.auth" app, then the
> logout_then_login method should logout the user, then redirect them to
> the login screen. Since this is a http red
On Nov 7, 12:52 am, jago <[EMAIL PROTECTED]> wrote:
> I have a for loop over a list A.
>
> inside the loop I want to print out the item of list B at the index
> 'forloop.counter0' of list A.
>
> It is really strange. One can select randon items in a list, or the
> first item in a list, but I did n
You can use something like {{ array.index}} to get the value of a
specific index.
For e.g.
arr = [1,2,3,4]
In view, if I do a
{{ arr.1 }}, it should return 2
-- Raja
On Nov 7, 5:52 am, jago <[EMAIL PROTECTED]> wrote:
> I have a for loop over a list A.
>
> inside the loop I want to print out t
If you are using the "django.contrib.auth" app, then the
logout_then_login method should logout the user, then redirect them to
the login screen. Since this is a http redirect, doing a back after
logout will still bring them back to login page.
-- raja
On Nov 7, 9:21 am, jai_python <[EMAIL PROT
If you are using "django.contrib.auth", you can use the
logout_then_login method, which logs out a user, then redirects to the
login page. Since its redirected, you will be brought back to the
login page even if the user hits the back button.
-- Raja
On Nov 7, 9:21 am, jai_python <[EMAIL PROTECT
On Fri, Nov 7, 2008 at 12:17 AM, Darthmahon <[EMAIL PROTECTED]> wrote:
>
> Hi guys, I'll give both a try tomorrow when I am near my dev box
> again. Can't really do it in the template as I just want to dump out
> JSON only, but I'll give them both a go :)
I use templates for all my JSON output, m
For example you can use `thread locals` to store there request object
On Fri, Nov 7, 2008 at 10:58, Rob Hudson <[EMAIL PROTECTED]> wrote:
>
> I have the following:
>
> ## MODELS
>
> class Category(models.Model):
>user = models.ForeignKey(User)
>name = models.CharField(max_length=200)
>
>
Ah, I've been busy past couple of days.. but there's some interesting
ideas here.
Thanks!
Justin
On Nov 3, 6:35 am, "Valts Mazurs" <[EMAIL PROTECTED]> wrote:
> Sure, I also keep django apps outside site-packages directory but it is not
> really the same level of convenience :)
>
> Valts.
>
> On
The is not way to get list item by variable index with standard django
template tags.
On Fri, Nov 7, 2008 at 03:52, jago <[EMAIL PROTECTED]> wrote:
>
> I have a for loop over a list A.
>
> inside the loop I want to print out the item of list B at the index
> 'forloop.counter0' of list A.
>
> It
77 matches
Mail list logo