Re: orm relation

2019-12-03 Thread bill dexter
hi friend;
i tryed your answer, but it says that error in syntax near  __gt  in ""
extractyear(dat_enc) - extractyear(annee)__gt = 3""; don't work

Le lun. 2 déc. 2019 à 20:31, Integr@te System  a
écrit :

> Hi friend,
>
> All_list = list(users.object.aggregate(age =
> cast(extractyear(datetime.now()) - extractyear(dat_nais), output_field =
> IntField())).filter(extractyear(dat_enc) - extractyear(annee)__gt = 3 & 
> extractyear(datetime.now())
> - extractyear(dat_nais)__IN=range(54,70) & cod_nad__contain = 
> 'CN').order_by('num___annee',
> 'prn'))
>
>
> Plz add more alias field as your sql command according to a sample above.
>
> Ps: check your question first(sql), then pass to communities.
>
>
>
> On Mon, Dec 2, 2019, 21:16 bill dexter <55dexte...@gmail.com> wrote:
>
>> thank you, but if you can give me answer to this  exacte probleme, as
>> mentioned in question
>>
>> Le dim. 1 déc. 2019 à 18:55, Integr@te System 
>> a écrit :
>>
>>> Hi,
>>>
>>> here u can try for complex queryset
>>>
>>>
>>>
>>> https://docs.djangoproject.com/en/2.2/topics/db/queries/#complex-lookups-with-q
>>>
>>> On Sun, Dec 1, 2019, 21:08 bill dexter <55dexte...@gmail.com> wrote:
>>>
>>>> ELECT a.matr
>>>>   ,[nom]
>>>>   ,[prn]
>>>>   ,cast([dat_nais] as date) as dat_nais
>>>>   , (YEAR(getdate()) - YEAR(dat_nais)) as age
>>>>   ,cast([dat_deces] as date) as dat_deces
>>>>   ,cast([dat_imm] as date) as dat_imm
>>>>   ,cast([dat_aj] as date) as dat_j
>>>>   ,[cod_position]
>>>>   ,YEAR(dat_imm) as anne_imm
>>>>   ,YEAR(dat_encais) as ann_regl
>>>>   ,[annee]
>>>>   ,[cod_nat]
>>>>   ,cast([dat_e
>>>>
>>>> Snc] as date) as dat_regl
>>>>   ,[mt_encais]
>>>>   FROM users a
>>>> left join enca e on e.matr = a.matr
>>>> left join encr c on (c.cod_encais = e.cod_encais)
>>>>   where (YEAR(c.dat_enc) - c.annee > 3 ) and ((YEAR(getdate()) -
>>>> YEAR(a.dat_nais)) between 54 and 70) and c.cod_nat = 'CN'
>>>>   order by a.nom_, a.prn, c.annee asc;
>>>>
>>>> hello;
>>>> my models are users, enca; encr;
>>>> who can i performe this query using django ORM, note that i'm using
>>>> MSSQL; thank very much
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/85f7f91b-0f52-4a96-8700-bee588eb4a3d%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/85f7f91b-0f52-4a96-8700-bee588eb4a3d%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAP5HUWqap3ddCEmW-7yD_uRWhwxDNQdSNZ%2BQPPvHzcAwDf1e5Q%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAP5HUWqap3ddCEmW-7yD_uRWhwxDNQdSNZ%2BQPPvHzcAwDf1e5Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAA7%3DR20i-DNEFTgdHQ7bjmvzQHrmML3LjzamrSiK07oJgbC_%2Bw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAA7%3DR20i-DNEFTgdHQ7bjmvzQHrmML3LjzamrSiK07oJgbC_%2Bw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAP5HUWoRjYGOMbQf2Lz9npLi7%2BhsOfDoN-wYLAUAjbr9ites-Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAP5HUWoRjYGOMbQf2Lz9npLi7%2BhsOfDoN-wYLAUAjbr9ites-Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA7%3DR22g%3DsVQJA1d4JdBC-biw%2BzcRCec9FPn_rbnBNo7%2B2%3DkTw%40mail.gmail.com.


Re: orm relation

2019-12-02 Thread bill dexter
thank you, but if you can give me answer to this  exacte probleme, as
mentioned in question

Le dim. 1 déc. 2019 à 18:55, Integr@te System  a
écrit :

> Hi,
>
> here u can try for complex queryset
>
>
>
> https://docs.djangoproject.com/en/2.2/topics/db/queries/#complex-lookups-with-q
>
> On Sun, Dec 1, 2019, 21:08 bill dexter <55dexte...@gmail.com> wrote:
>
>> ELECT a.matr
>>   ,[nom]
>>   ,[prn]
>>   ,cast([dat_nais] as date) as dat_nais
>>   , (YEAR(getdate()) - YEAR(dat_nais)) as age
>>   ,cast([dat_deces] as date) as dat_deces
>>   ,cast([dat_imm] as date) as dat_imm
>>   ,cast([dat_aj] as date) as dat_j
>>   ,[cod_position]
>>   ,YEAR(dat_imm) as anne_imm
>>   ,YEAR(dat_encais) as ann_regl
>>   ,[annee]
>>   ,[cod_nat]
>>   ,cast([dat_e
>>
>> Snc] as date) as dat_regl
>>   ,[mt_encais]
>>   FROM users a
>> left join enca e on e.matr = a.matr
>> left join encr c on (c.cod_encais = e.cod_encais)
>>   where (YEAR(c.dat_enc) - c.annee > 3 ) and ((YEAR(getdate()) -
>> YEAR(a.dat_nais)) between 54 and 70) and c.cod_nat = 'CN'
>>   order by a.nom_, a.prn, c.annee asc;
>>
>> hello;
>> my models are users, enca; encr;
>> who can i performe this query using django ORM, note that i'm using
>> MSSQL; thank very much
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/85f7f91b-0f52-4a96-8700-bee588eb4a3d%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/85f7f91b-0f52-4a96-8700-bee588eb4a3d%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAP5HUWqap3ddCEmW-7yD_uRWhwxDNQdSNZ%2BQPPvHzcAwDf1e5Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAP5HUWqap3ddCEmW-7yD_uRWhwxDNQdSNZ%2BQPPvHzcAwDf1e5Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA7%3DR20i-DNEFTgdHQ7bjmvzQHrmML3LjzamrSiK07oJgbC_%2Bw%40mail.gmail.com.


orm relation

2019-12-01 Thread bill dexter
ELECT a.matr
  ,[nom]
  ,[prn]
  ,cast([dat_nais] as date) as dat_nais
  , (YEAR(getdate()) - YEAR(dat_nais)) as age
  ,cast([dat_deces] as date) as dat_deces
  ,cast([dat_imm] as date) as dat_imm
  ,cast([dat_aj] as date) as dat_j
  ,[cod_position]
  ,YEAR(dat_imm) as anne_imm
  ,YEAR(dat_encais) as ann_regl
  ,[annee]
  ,[cod_nat]
  ,cast([dat_e

Snc] as date) as dat_regl
  ,[mt_encais]
  FROM users a
left join enca e on e.matr = a.matr
left join encr c on (c.cod_encais = e.cod_encais)
  where (YEAR(c.dat_enc) - c.annee > 3 ) and ((YEAR(getdate()) - 
YEAR(a.dat_nais)) between 54 and 70) and c.cod_nat = 'CN'
  order by a.nom_, a.prn, c.annee asc;

hello;
my models are users, enca; encr;
who can i performe this query using django ORM, note that i'm using MSSQL; 
thank very much

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/85f7f91b-0f52-4a96-8700-bee588eb4a3d%40googlegroups.com.


Re: Scaling Django

2016-02-06 Thread Dexter T.
Hi Sergiy, are you referring to my post or to the OP?

On Sunday, February 7, 2016 at 6:03:11 AM UTC+8, Sergiy Khohlov wrote:
>
> Print database structure.
> Check possibility of DB normalization. 
>

You might have meant "denormalization" here (?), especially when operating 
at such scale. We do used denormalization for some of our larger tables.
 

> 100 GB  (my "record" is 452 GB  )is not so high but  this size requires 
> some attention. (Look like you Mysql used only one db file: try to set 
> table per file.  Check index size , and verify that indexes  are working 
> corectly)
>

We are using innodb_file_per_table. But see that I mentioned that all this 
100GB data fit on a lowly 8GB ram VM, 50% of which was allocated to innodb 
buffers. With such little resources, but at the same time intimately 
knowing your database workload, it is still possible to handle such db 
size. And yes, our indexes are used well, as most queries were EXPLAINed 
and optimized accordingly. 

What hardware are you running your 452GB db in?

Review  your project: 
>  try to avoid  Many to Many field 
> Is it possible switch from hardcode SQL to  stored function and procedure 
> ? 
>

See my above post about denormalization. And arguably storedprocs are even 
harder to manage, code-wise, and deployment wise.
 

>  Look like  this issue in not connected to django only. 
>

Again, if you are referring to my post, I am not the OP. Not that our 
system is perfect, and yes we're not the ones with scaling problems. 
I was in fact sharing the practices of scaling that worked for us. See the 
OPs post on what problems they're facing (organizational / political / 
methodological).

Cheers!
 

>
>
> Many thanks,
>
> Serge
>
>
> +380 636150445
> skype: skhohlov
>
> On Sat, Feb 6, 2016 at 7:09 PM, Dexter T. 
> > wrote:
>
>> Lots of great replies already.
>> I also want to add a few (random) things ...
>>
>> - have you clearly defined and isolated what issue(s) are you facing?
>> - you mentioned using DRF in a service, with a large JSON reponse taking 
>> seconds to finish, how did you troubleshoot/profile this? Seconds to 
>> process server-side? Seconds to download client-side? Where specifically? 
>> If you said you don't know, then find out!
>> - your system will have so many legs, have you made an effort to 
>> instrument and measure and isolate which parts are slow and why?
>> - you mentioned using the debug toolbar, have you proven that your 
>> database schema is optimal? Any queries in your slow queries log? Indexes 
>> used and ok and optimal? For your workload, can_read caching help? Db 
>> replicas be of help?
>> - how are your server resources utilized? Are you sure you are not 
>> bottlenecked by thrashing disk-io? Overcomitted CPU? Low memory/swapping? 
>> File descriptor count?
>> - have you checked if clients are not bottlenecked? An ajax call to 
>> download a  complex nested json object is both costly to serialize, CPU and 
>> bandwidth wise. Gzip can help here, if applicable.
>> - for more context, can you share some numbers, like http and db level 
>> req/sec, row count for the most heavily used tables? How about server 
>> infrastructure specs?
>>
>> Note that these are basic questions and are basic problem-solving steps, 
>> im assuming your teams should be aware and be taking steps like these 
>> already.
>>
>> In one project of mine, we're doing a 100gb mysql db, some tables above 
>> 100mil recs and growing rapidly, properly indexed and optimized, it works 
>> ok on a lowly single vps instance with 8gb ram; workload is clearly oltp, 
>> we're throwing more sustained writes (100s/sec) than reads, all queries 
>> were scrutinized, almost all using the ORM, some handwritten SQL, other 
>> complex queries rewritten to be done at application level, joins are harder 
>> at this scale and therefore preferrably avoided (major architectural 
>> decision anticipated). But still we can easily throw hardware if needed.
>>
>> For us, scaling is an continuous commitment to measure and refactor.
>>
>> And one very important learning for me in my years of writing software: 
>> rewriting is very very very very costly.
>>
>> These new engineers/other colleagues coming in, are they familiar with 
>> the domain problem, the exisiting codebase, the scale at which you operate 
>> now and expected in the future? Are they experienced in doing similar 
>> scaling before? And even if you think you can throw your old work, and now 
>> that you guys think you know better, be very careful of 
>> The-Second-System-Effect.
>

Scaling Django

2016-02-06 Thread Dexter T.
Lots of great replies already.
I also want to add a few (random) things ...

- have you clearly defined and isolated what issue(s) are you facing?
- you mentioned using DRF in a service, with a large JSON reponse taking 
seconds to finish, how did you troubleshoot/profile this? Seconds to process 
server-side? Seconds to download client-side? Where specifically? If you said 
you don't know, then find out!
- your system will have so many legs, have you made an effort to instrument and 
measure and isolate which parts are slow and why?
- you mentioned using the debug toolbar, have you proven that your database 
schema is optimal? Any queries in your slow queries log? Indexes used and ok 
and optimal? For your workload, can_read caching help? Db replicas be of help?
- how are your server resources utilized? Are you sure you are not bottlenecked 
by thrashing disk-io? Overcomitted CPU? Low memory/swapping? File descriptor 
count?
- have you checked if clients are not bottlenecked? An ajax call to download a  
complex nested json object is both costly to serialize, CPU and bandwidth wise. 
Gzip can help here, if applicable.
- for more context, can you share some numbers, like http and db level req/sec, 
row count for the most heavily used tables? How about server infrastructure 
specs?

Note that these are basic questions and are basic problem-solving steps, im 
assuming your teams should be aware and be taking steps like these already.

In one project of mine, we're doing a 100gb mysql db, some tables above 100mil 
recs and growing rapidly, properly indexed and optimized, it works ok on a 
lowly single vps instance with 8gb ram; workload is clearly oltp, we're 
throwing more sustained writes (100s/sec) than reads, all queries were 
scrutinized, almost all using the ORM, some handwritten SQL, other complex 
queries rewritten to be done at application level, joins are harder at this 
scale and therefore preferrably avoided (major architectural decision 
anticipated). But still we can easily throw hardware if needed. 

For us, scaling is an continuous commitment to measure and refactor.

And one very important learning for me in my years of writing software: 
rewriting is very very very very costly. 

These new engineers/other colleagues coming in, are they familiar with the 
domain problem, the exisiting codebase, the scale at which you operate now and 
expected in the future? Are they experienced in doing similar scaling before? 
And even if you think you can throw your old work, and now that you guys think 
you know better, be very careful of The-Second-System-Effect.

I hope you succeed.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ddc6db79-af4c-4e78-a16f-84f2dc8b69ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating a custom view in Django admin,

2010-05-28 Thread Dexter
Thank you chr,

I've never experimented with managers, but it's quite useful.
I guess a custom manager is also the only way to have a foreignkey to a user
in a specific group.

But although I'm a bit further, I still don't know the answer to my
million-dollar question.

Is it possible to have an intermediary step before actually saving the
object. In which I have a custom view?
What I actually want is a multiple step saving process.

Is that possible without ugly hacks?

Thanks in advance.

Grtz, Dexter

On Thu, May 27, 2010 at 8:54 PM, chr  wrote:

> On May 26, 7:02 pm, Dexter  wrote:
> > Another thing:
> >
> > At the event model, it is unnecessary to display all the events in the
> > admin. How can I make sure only the events coming (ie
> > date__gte=datetime.now()) are displayed in the admin?
>
> i think a proxy model[1] might work where you set the default manager
> to only filter for all objects greater than now(). then, instead of
> (or in addition to) the actual event model you register the proxymodel
> with the admin.
>
> [1]
> http://docs.djangoproject.com/en/dev/topics/db/models/#proxy-model-managers
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Creating a custom view in Django admin,

2010-05-26 Thread Dexter
Hi,

I am building a newsletter system, but I'm wondering how to incorporate it
into the django admin.
Just recently I started discovering the capabilities of the admin interface,
and finding out how things are supposed to be working.
I want to make an interface which follows the django "zen".

My situation is as follows, I have to models which need to be incorporated
into the newsletter,
An agenda, with events, and a messaging system to display announcements.
My newsletter model has two manytomanyfields pointing to the event and the
message models.

What I really want to do, is at creation of a new newsletter, the user
selects the events and messages that should be displayed in the newsletter.
Then, when the user saves the newsletter, a custom view is displayed (The
newsletter is not yet saved). In which the user can select the order in
which the objects (messages and events) should be displayed.(ie via drag and
drop)

The next step is confirmation, so the user sees the entire
newsletter, entirely formatted.

Is this the best way to do this kind of thing?, or should it be approached
differently?

Another thing:

At the event model, it is unnecessary to display all the events in the
admin. How can I make sure only the events coming (ie
date__gte=datetime.now()) are displayed in the admin?

 Thanks in advance for your help.

Greetings, Dexter

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Sync user objects with sympa mailinglist

2010-05-19 Thread Dexter
Hi thanks for your replies,

I couldn't run the django page on a different server, because I only have
one VPS running.

But I understand there isn't a way to catch "events" on a database update.

Grtz, Dexter

On Wed, May 19, 2010 at 3:43 PM, Daniel Hilton wrote:

> On 19 May 2010 00:02, Dexter  wrote:
> > Hi,
> > I want to sync emailadresses in the django.contrib.auth User model, to a
> > sympa mailinglist subscriberlist.
> > I really don't have any experience with sympa. So I don't know how this
> > process usually goes,
> > but what I did found out, is that sympa documentation is lacking a bit.
> > I find the concepts they use really vague, but I guess its powerful as
> well.
> > Does anyone know how this is done?
> > Grtz, Dexter
>
> You would have to write a management command that did the sync.
>
> Your command could then make use of the bulk load command as outlined here:
>
> http://www.sympa.org/manual_6.1/database#importing_data_from_a_text_file
>
> All you would need is a management command that either wrapped around
> that creating a stream of text which could then be piped in or that it
> did that for you.
>
> Alternatively if you wanted to run the django instance on a different
> machine (recommended++) you could make use of their SOAP server.
>
> I would recommend having a look at Suds, a really nice python package
> for talking to soap services.
>
> HTH
> Dan
>
>
>
>
>
>
> >
> > --
> > 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
> > django-users+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
>
>
>
> --
> Dan Hilton
> 
> www.twitter.com/danhilton
> www.DanHilton.co.uk
> 
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Sync user objects with sympa mailinglist

2010-05-19 Thread Dexter
Hi,

I'm just trying to run a mailinglist now, but when I set alias_manager in
sympa.conf, I get the following error:

unknown field: alias_manager in sympa.conf

How should I set my alias_manager?

Grtz, Dexter

On Wed, May 19, 2010 at 1:02 AM, Dexter  wrote:

> Hi,
>
> I want to sync emailadresses in the django.contrib.auth User model, to a
> sympa mailinglist subscriberlist.
> I really don't have any experience with sympa. So I don't know how this
> process usually goes,
> but what I did found out, is that sympa documentation is lacking a bit.
> I find the concepts they use really vague, but I guess its powerful as
> well.
>
> Does anyone know how this is done?
>
> Grtz, Dexter
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Sync user objects with sympa mailinglist

2010-05-18 Thread Dexter
Hi,

I want to sync emailadresses in the django.contrib.auth User model, to a
sympa mailinglist subscriberlist.
I really don't have any experience with sympa. So I don't know how this
process usually goes,
but what I did found out, is that sympa documentation is lacking a bit.
I find the concepts they use really vague, but I guess its powerful as well.

Does anyone know how this is done?

Grtz, Dexter

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: One to One chat like Facebook?

2010-05-16 Thread Dexter
I don't know, but I guess you could easily make your own.

Django and Comet would be a nice combination

Grtz, Dexter

On Sun, May 16, 2010 at 12:13 PM, Anand Agarwal  wrote:

> Hi All
>
> Is there any chat application in django similar to facebook chat?
>
>
> Regards
> Anand
> Got an Idea? BootStrap <http://bootstraptoday.com>it Today!!
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: formsets and empty results

2010-05-15 Thread Dexter
Hey,

Ik zou deze pagina even bekijken:
http://docs.djangoproject.com/en/1.1/ref/forms/validation/#ref-forms-validation


Grtz

On Sat, May 15, 2010 at 7:34 PM, Wim Feijen  wrote:

> Hi all,
>
> Can some of you please help me with the following?
>
> For an application, I need to display the same form ten times over.
> Filling in each form is optional. Of course, I'd like to keep this
> safe & simple and therefore I am looking at formsets.
>
> Is it possible to use a formset, call formset.is_valid() and that it
> ignores empty forms?
>
> I'm using the forms only for adding new data, not for altering
> existing data.
>
> Thanks!
>
> Best regards, Wim
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Loading picasa photo's with syncr

2010-05-11 Thread Dexter
I now hacked it like this:

updated = datetime(*strptime(album.updated.text[:-5],
"%Y-%m-%dT%H:%M:%S")[:7])

not very pretty imho. But its stable, and I don't know a better way.

Grtz, Dexter

On Tue, May 11, 2010 at 12:02 PM, Dexter  wrote:

> Hi everyone,
>
> I want to populate my db using syncr,
> But when I run "python manage.py syncr_picasaweb", I get the following
> error :
>
> Traceback (most recent call last):
>   File "manage.py", line 11, in 
> execute_manager(settings)
>   File "/home/site/domains/
> jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/django/core/management/__init__.py",
> line 438, in execute_manager
> utility.execute()
>   File "/home/site/domains/
> jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/django/core/management/__init__.py",
> line 379, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/home/site/domains/
> jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/django/core/management/base.py",
> line 191, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File "/home/site/domains/
> jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/django/core/management/base.py",
> line 218, in execute
> output = self.handle(*args, **options)
>   File "/home/site/domains/
> jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/syncr/picasaweb/management/commands/sync_picasaweb.py",
> line 55, in handle
> ps.syncAllAlbums(username=picasaweb_user)
>   File "/home/site/domains/
> jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/syncr/app/picasaweb.py",
> line 225, in syncAllAlbums
> self.syncAlbum(album)
>   File "/home/site/domains/
> jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/syncr/app/picasaweb.py",
> line 166, in syncAlbum
> updated = datetime(*strptime(album.updated.text,
> "%Y-%m-%dT%H:%M:%S.000Z")[:7])
>   File "/usr/lib/python2.5/_strptime.py", line 330, in strptime
> (data_string, format))
> ValueError: time data did not match format:  data=2009-12-23T14:26:34.825Z
>  fmt=%Y-%m-%dT%H:%M:%S.000Z
>
> Do you know how I can format the format so the .***Z is catched?
>
> Grtz, Dexter
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Loading picasa photo's with syncr

2010-05-11 Thread Dexter
Hi everyone,

I want to populate my db using syncr,
But when I run "python manage.py syncr_picasaweb", I get the following error
:

Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File "/home/site/domains/
jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/django/core/management/__init__.py",
line 438, in execute_manager
utility.execute()
  File "/home/site/domains/
jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/django/core/management/__init__.py",
line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/site/domains/
jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/django/core/management/base.py",
line 191, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/home/site/domains/
jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/django/core/management/base.py",
line 218, in execute
output = self.handle(*args, **options)
  File "/home/site/domains/
jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/syncr/picasaweb/management/commands/sync_picasaweb.py",
line 55, in handle
ps.syncAllAlbums(username=picasaweb_user)
  File "/home/site/domains/
jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/syncr/app/picasaweb.py",
line 225, in syncAllAlbums
self.syncAlbum(album)
  File "/home/site/domains/
jcdedukdalf.nl/jcdedukdalf.nl/lib/python2.5/site-packages/syncr/app/picasaweb.py",
line 166, in syncAlbum
updated = datetime(*strptime(album.updated.text,
"%Y-%m-%dT%H:%M:%S.000Z")[:7])
  File "/usr/lib/python2.5/_strptime.py", line 330, in strptime
(data_string, format))
ValueError: time data did not match format:  data=2009-12-23T14:26:34.825Z
 fmt=%Y-%m-%dT%H:%M:%S.000Z

Do you know how I can format the format so the .***Z is catched?

Grtz, Dexter

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Generic web-dev question: Best way to do a processing page?

2010-05-01 Thread Dexter
You could try to juggle with comet, but I wouldn't if its the best
solution,

Otherwise you could let them fill in an email address, and send the result
to that emailaddress

On Sat, May 1, 2010 at 2:22 PM, Joshua Russo  wrote:

> This is mainly just curiosity at the moment. How do you create a
> "processing" intermediate page, like you see on travel sites when they are
> looking for the rates? I would always avoid this if at all possible, but
> sometimes you have a process that takes longer than usual.
>
> I've been looking around the web and I am not coming up with many examples.
> So far I have only found one.
>
>
> http://blog.ysatech.com/post/2010/02/06/ASPNET-redirect-a-web-page-with-AJAX-loading-indicator-image.aspx
>
> Is that pretty much how it's done?
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django app svn management

2010-04-29 Thread Dexter
This was not really a feature request or how its really setup.
But I wanted to know how the community thinks of this kind of development
setup.

I'm looking forward to your responses.

Grtz, Dexter

On Thu, Apr 29, 2010 at 4:10 PM, Dexter  wrote:

> Hi there,
>
> I was wondering if there is a solution to manage a django deployment with
> svn like revision tool.
> What I would like to have my main django deployment to be a trunk like
> folder.
> When I want to test something, or make a new app, I want to make a branch
> oid. which should be visible under some sort of url structure (ie.
> www.example.org/svn/branchname/normal_folder_structure)
>
> I wouldn't know if this is the best way to develop app's, but I guess it
> would be nice to commit something when it's solid, and not having to
> compromise the general site preformance/stability.
>
> What do you think of this?
>
> Grtz, Dexter
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django app svn management

2010-04-29 Thread Dexter
Hi there,

I was wondering if there is a solution to manage a django deployment with
svn like revision tool.
What I would like to have my main django deployment to be a trunk like
folder.
When I want to test something, or make a new app, I want to make a branch
oid. which should be visible under some sort of url structure (ie.
www.example.org/svn/branchname/normal_folder_structure)

I wouldn't know if this is the best way to develop app's, but I guess it
would be nice to commit something when it's solid, and not having to
compromise the general site preformance/stability.

What do you think of this?

Grtz, Dexter

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Distributing application

2010-04-29 Thread Dexter
What do you mean by distributing your app?
getting people to view it?, or having your clients running their own server.

If you want people to view it, you have to deploy a django installation
somewhere with your app.
Else, if you want you clients to have each their own app, theyll have to
have their own django installation, and with that a python installation

Grtz, Dexter

On Thu, Apr 29, 2010 at 1:37 PM, Mag  wrote:

> I have been using Django and I like it a lot.
>
> I was wondering what is the best way to distribute my application?
> Previously, with Apache tomcat it was very easy to distribute it. I
> provided the tomcat server and the war file and everything was done.
>
> Is there a tool or a preferred way to do this? I am not sure if my
> clients all have python installed.
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to return an audio file in django

2010-04-26 Thread Dexter
X-Sendfile doesn't work (yet),
Although I got the ugly way working now.
When I try to download it manually, it seems to be getting an empty file.
even though I have set the Content-Length value.
Any suggestions?

Grtz, Dexter

On Mon, Apr 26, 2010 at 9:24 PM, Dexter  wrote:

> It doesn't seem to work very good.
> I'll read about X-Sendfile, don't know if it suits my purpose.
>
> On Mon, Apr 26, 2010 at 8:52 PM, Dexter  wrote:
>
>> I'm using both,
>>
>> I'm not familiar with X-Sendfile,
>>
>> But my situation is this: I have a folder with my music collection, I scan
>> the folder and record the pathnames.
>> Because I don't want to set this folder public, I want to manage the user
>> login with django so not everyone can download my music.
>>
>> Is this possible with X-Sendfile?
>>
>> TY Nick, I'll try this one. But I guess X-Sendfile is a better solution.
>>
>> Grtz, Dexter
>>
>> On Mon, Apr 26, 2010 at 8:43 PM, Christophe Pettus wrote:
>>
>>> Another possibility, if you are using either Apache or Lighttpd, is the
>>> X-Sendfile header, so that the Python process does not have to handle the
>>> content.
>>>
>>>
>>> For lighttpd:   http://blog.lighttpd.net/articles/2006/07/02/x-sendfile
>>> For Apache: http://tn123.ath.cx/mod_xsendfile/
>>>
>>>
>>> On Apr 26, 2010, at 10:41 AM, Nick Serra wrote:
>>>
>>>  Interesting. If the file is an mp3, maybe try:
>>>>
>>>> file = open("/path/to/my/song.mp3", "rb").read()
>>>> response['Content-Disposition'] = 'attachment; filename=filename.mp3'
>>>> return HttpResponse(file, mimetype="audio/mpeg")
>>>>
>>>>
>>>> On Apr 26, 1:20 pm, Dexter  wrote:
>>>>
>>>>> Hi there,
>>>>>
>>>>> I want to send an audio file via a django view, but I don't know how.
>>>>>
>>>>> This doesn't seem to work:
>>>>>
>>>>>return HttpResponse(open(song.path).read(), mimetype = "audio/mpeg")
>>>>>
>>>>> Can you guy's help me?
>>>>>
>>>>> Grtz, Dexter
>>>>>
>>>>> --
>>>>> 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
>>>>> django-users+unsubscr...@googlegroups.com
>>>>> .
>>>>> For more options, visit this group athttp://
>>>>> groups.google.com/group/django-users?hl=en.
>>>>>
>>>>
>>>> --
>>>> 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
>>>> django-users+unsubscr...@googlegroups.com
>>>> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/django-users?hl=en.
>>>>
>>>>
>>> --
>>> -- Christophe Pettus
>>>   x...@thebuild.com
>>>
>>>
>>> --
>>> 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
>>> django-users+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to return an audio file in django

2010-04-26 Thread Dexter
It doesn't seem to work very good.
I'll read about X-Sendfile, don't know if it suits my purpose.

On Mon, Apr 26, 2010 at 8:52 PM, Dexter  wrote:

> I'm using both,
>
> I'm not familiar with X-Sendfile,
>
> But my situation is this: I have a folder with my music collection, I scan
> the folder and record the pathnames.
> Because I don't want to set this folder public, I want to manage the user
> login with django so not everyone can download my music.
>
> Is this possible with X-Sendfile?
>
> TY Nick, I'll try this one. But I guess X-Sendfile is a better solution.
>
> Grtz, Dexter
>
> On Mon, Apr 26, 2010 at 8:43 PM, Christophe Pettus wrote:
>
>> Another possibility, if you are using either Apache or Lighttpd, is the
>> X-Sendfile header, so that the Python process does not have to handle the
>> content.
>>
>>
>> For lighttpd:   http://blog.lighttpd.net/articles/2006/07/02/x-sendfile
>> For Apache: http://tn123.ath.cx/mod_xsendfile/
>>
>>
>> On Apr 26, 2010, at 10:41 AM, Nick Serra wrote:
>>
>>  Interesting. If the file is an mp3, maybe try:
>>>
>>> file = open("/path/to/my/song.mp3", "rb").read()
>>> response['Content-Disposition'] = 'attachment; filename=filename.mp3'
>>> return HttpResponse(file, mimetype="audio/mpeg")
>>>
>>>
>>> On Apr 26, 1:20 pm, Dexter  wrote:
>>>
>>>> Hi there,
>>>>
>>>> I want to send an audio file via a django view, but I don't know how.
>>>>
>>>> This doesn't seem to work:
>>>>
>>>>return HttpResponse(open(song.path).read(), mimetype = "audio/mpeg")
>>>>
>>>> Can you guy's help me?
>>>>
>>>> Grtz, Dexter
>>>>
>>>> --
>>>> 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
>>>> django-users+unsubscr...@googlegroups.com
>>>> .
>>>> For more options, visit this group athttp://
>>>> groups.google.com/group/django-users?hl=en.
>>>>
>>>
>>> --
>>> 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
>>> django-users+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>> --
>> -- Christophe Pettus
>>   x...@thebuild.com
>>
>>
>> --
>> 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
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to display only one instance of an object returned by a query.

2010-04-26 Thread Dexter
Oops, wrong post

On Mon, Apr 26, 2010 at 9:23 PM, Dexter  wrote:

> It doesn't seem to work very good.
>
>
> On Mon, Apr 26, 2010 at 8:53 PM, greatlemer wrote:
>
>> > @G
>> >
>> > thanks for that. the code im writing will wait til dev version becomes
>> > 1.2 so at least i know there is a way to do it in the next version.
>> > must check when 1.2 is gonna land.
>>
>> You probably noticed anyway but ifchanged is actually in the current
>> version (and has been since at least 1.0) so you can use it whenever
>> (I keep forgetting when I post links I should probably not link
>> straight to the dev branch of the docs).
>>
>> --
>> G
>>
>> --
>> 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
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to display only one instance of an object returned by a query.

2010-04-26 Thread Dexter
It doesn't seem to work very good.

On Mon, Apr 26, 2010 at 8:53 PM, greatlemer wrote:

> > @G
> >
> > thanks for that. the code im writing will wait til dev version becomes
> > 1.2 so at least i know there is a way to do it in the next version.
> > must check when 1.2 is gonna land.
>
> You probably noticed anyway but ifchanged is actually in the current
> version (and has been since at least 1.0) so you can use it whenever
> (I keep forgetting when I post links I should probably not link
> straight to the dev branch of the docs).
>
> --
> G
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to return an audio file in django

2010-04-26 Thread Dexter
I'm using both,

I'm not familiar with X-Sendfile,

But my situation is this: I have a folder with my music collection, I scan
the folder and record the pathnames.
Because I don't want to set this folder public, I want to manage the user
login with django so not everyone can download my music.

Is this possible with X-Sendfile?

TY Nick, I'll try this one. But I guess X-Sendfile is a better solution.

Grtz, Dexter

On Mon, Apr 26, 2010 at 8:43 PM, Christophe Pettus  wrote:

> Another possibility, if you are using either Apache or Lighttpd, is the
> X-Sendfile header, so that the Python process does not have to handle the
> content.
>
>
> For lighttpd:   http://blog.lighttpd.net/articles/2006/07/02/x-sendfile
> For Apache: http://tn123.ath.cx/mod_xsendfile/
>
>
> On Apr 26, 2010, at 10:41 AM, Nick Serra wrote:
>
>  Interesting. If the file is an mp3, maybe try:
>>
>> file = open("/path/to/my/song.mp3", "rb").read()
>> response['Content-Disposition'] = 'attachment; filename=filename.mp3'
>> return HttpResponse(file, mimetype="audio/mpeg")
>>
>>
>> On Apr 26, 1:20 pm, Dexter  wrote:
>>
>>> Hi there,
>>>
>>> I want to send an audio file via a django view, but I don't know how.
>>>
>>> This doesn't seem to work:
>>>
>>>return HttpResponse(open(song.path).read(), mimetype = "audio/mpeg")
>>>
>>> Can you guy's help me?
>>>
>>> Grtz, Dexter
>>>
>>> --
>>> 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
>>> django-users+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group athttp://
>>> groups.google.com/group/django-users?hl=en.
>>>
>>
>> --
>> 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
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
> --
> -- Christophe Pettus
>   x...@thebuild.com
>
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to return an audio file in django

2010-04-26 Thread Dexter
Hi there,

I want to send an audio file via a django view, but I don't know how.

This doesn't seem to work:

return HttpResponse(open(song.path).read(), mimetype = "audio/mpeg")

Can you guy's help me?

Grtz, Dexter

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: TemplateDoesNotExistError makes no sense

2010-04-12 Thread Dexter
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 does work).
> > The runserver runs with the same settings.py, so there should be no
> > difference
>
> I'd check file permissions on the inaccessible templates. I'm guessing
> your Apache user is different to the user you're running runserver
> with.
>
> > On Sun, Apr 11, 2010 at 11:24 PM, Shawn Milochik 
> wrote:
> >>
> >> On Apr 11, 2010, at 5:22 PM, David Zhou wrote:
> >>
> >> > On Sun, Apr 11, 2010 at 4:26 PM, Dexter  wrote:
> >> >
> >> >> I have a server running with primarily nginx and secundary apache2,
> >> >> And I am getting an template error trying to browse an app. It seems
> it
> >> >> cannot find a template, but it is certainly there, the runserver just
> >> >> works
> >> >> fine.
> >> >
> >> > Everything in programming makes sense, it's just a matter of figuring
> >> > out why something makes sense.
> >> >
> >> > Examine your trace -- there should be a list of directories of where
> >> > its looking for templates.  Verify that your template is actually in
> >> > one of those paths.
> >> >
> >> > -- dz
> >>
> >> Also, are you getting that error when you try to browse a page defined
> in
> >> one specific template, or all of your templates?
> >>
> >> The answer to that will also give you more information to use in solving
> >> the problem -- really big clues.
> >>
> >> Shawn
> >>
> >> --
> >> 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
> >> django-users+unsubscr...@googlegroups.com
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/django-users?hl=en.
> >>
> >
> > --
> > 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
> > django-users+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: TemplateDoesNotExistError makes no sense

2010-04-11 Thread Dexter
I have problem's with 2 templates, the newest, it is in the same dir as my
index.html template (Which does work).
The runserver runs with the same settings.py, so there should be no
difference

On Sun, Apr 11, 2010 at 11:24 PM, Shawn Milochik  wrote:

>
> On Apr 11, 2010, at 5:22 PM, David Zhou wrote:
>
> > On Sun, Apr 11, 2010 at 4:26 PM, Dexter  wrote:
> >
> >> I have a server running with primarily nginx and secundary apache2,
> >> And I am getting an template error trying to browse an app. It seems it
> >> cannot find a template, but it is certainly there, the runserver just
> works
> >> fine.
> >
> > Everything in programming makes sense, it's just a matter of figuring
> > out why something makes sense.
> >
> > Examine your trace -- there should be a list of directories of where
> > its looking for templates.  Verify that your template is actually in
> > one of those paths.
> >
> > -- dz
>
> Also, are you getting that error when you try to browse a page defined in
> one specific template, or all of your templates?
>
> The answer to that will also give you more information to use in solving
> the problem -- really big clues.
>
> Shawn
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



TemplateDoesNotExistError makes no sense

2010-04-11 Thread Dexter
Hi,

I have a server running with primarily nginx and secundary apache2,
And I am getting an template error trying to browse an app. It seems it
cannot find a template, but it is certainly there, the runserver just works
fine.

Can anyone point me in a direction to look for,

Thanks,

Dexter

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Media Server

2010-04-02 Thread Dexter
Hi,

I don't have any experience with lighthttpd, but I guess you shouldn't use
django for serving your static files.
You should redirect your domain.tld/media folder to your box using
lighthttpd or apache.

Grtz, Dexter

On Fri, Apr 2, 2010 at 5:21 PM, Media Server setup wrote:

> Hello,
>
> I have recently setup a Media server on a different box which I would
> like to use to serve static files to my django application. I
> personally find django documentation to be vague on this particular
> topic and I was hoping if someone who has done this type of setup
> before would be able to help me out here. I am using lighttpd on my
> media server and django app is using apache2. Can someone please
> explicitly specify what needs to go in MEDIA_URL and MEDIA_ROOT and
> how does urls.py routes to a cross domain media server. I am not
> interested in any local directory structure to accomplish this task
> because that is insecure and inefficient. Any help would be
> appreciated.
>
> Thanks
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with defer

2010-02-23 Thread Dexter
Aah.. TY

On Tue, Feb 23, 2010 at 9:46 PM, Daniel Roseman wrote:

>
> On Feb 23, 8:25 pm, Dexter  wrote:
> > I want to stringify that objectList with only the name field in the
> result.
> > How can I achieve this?
>
> Floor.objects.all().values_list("name", flat=True)
>
> --
> DR.
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with defer

2010-02-23 Thread Dexter
I want to stringify that objectList with only the name field in the result.
How can I achieve this?

On Tue, Feb 23, 2010 at 8:00 PM, Bill Freeman  wrote:

> How do you know they weren't deferred?  You can still access them if they
> were, IIUC.  It just causes additional queries, behind the scenes.
>
> On Mon, Feb 22, 2010 at 12:31 PM, Dexter  wrote:
> > Oh, I'm sorry,
> >
> > no error appears, but the queryset returns the complete objects with all
> the
> > fields, not only the name field
> >
> > On Mon, Feb 22, 2010 at 6:30 PM, Daniel Roseman 
> > wrote:
> >>
> >> On Feb 22, 5:15 pm, Dexter  wrote:
> >> > Hi,
> >> >
> >> > Im using django 1.1.1, and i'm trying to defer a queryset, but it
> >> > doesn't
> >> > seem to work.
> >> > Here's my callback:
> >> >
> >> > def open(request, id=None):
> >> >
> >> > > """Callback to fire when a specific floor is opened."""
> >> > > if request.user.is_authenticated():
> >> > > if id:
> >> > > data = serializers.serialize('json',
> >> > > Floor.objects.filter(id=id))
> >> > > else:
> >> > > object = Floor.objects.only("name").all()
> >> > > print object.values()
> >> > > data = serializers.serialize('json',
> Floor.objects.all())
> >> > > #print data
> >> > > return HttpResponse(data)
> >> >
> >> > > return HttpResponse("Operation not permitted!")
> >> >
> >> > Thanks in advance.
> >> >
> >> > Grtz, Dexter
> >>
> >> What doesn't work? You didn't post the traceback, you posted the code.
> >> It would have been useful to have the error message, if there is one,
> >> or some indication of what you are seeing versus what you expected to
> >> see.
> >> --
> >> DR.
> >>
> >> --
> >> 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
> >> django-users+unsubscr...@googlegroups.com
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/django-users?hl=en.
> >>
> >
> > --
> > 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
> > django-users+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: integration of non-sql

2010-02-23 Thread Dexter
You don't have to use the standard managers,
You could search for a orm with MongoDB support.

I can't see why the dev's should integrate support for such db.

Grtz, Dexter

On Tue, Feb 23, 2010 at 11:56 AM, Joan Miller  wrote:

> Will be there interation for non-sql databases as MongoDB?
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Problem with defer

2010-02-22 Thread Dexter
Oh, I'm sorry,

no error appears, but the queryset returns the complete objects with all the
fields, not only the name field

On Mon, Feb 22, 2010 at 6:30 PM, Daniel Roseman wrote:

> On Feb 22, 5:15 pm, Dexter  wrote:
> > Hi,
> >
> > Im using django 1.1.1, and i'm trying to defer a queryset, but it doesn't
> > seem to work.
> > Here's my callback:
> >
> > def open(request, id=None):
> >
> > > """Callback to fire when a specific floor is opened."""
> > > if request.user.is_authenticated():
> > > if id:
> > > data = serializers.serialize('json',
> > > Floor.objects.filter(id=id))
> > > else:
> > > object = Floor.objects.only("name").all()
> > > print object.values()
> > > data = serializers.serialize('json', Floor.objects.all())
> > > #print data
> > > return HttpResponse(data)
> >
> > > return HttpResponse("Operation not permitted!")
> >
> > Thanks in advance.
> >
> > Grtz, Dexter
>
> What doesn't work? You didn't post the traceback, you posted the code.
> It would have been useful to have the error message, if there is one,
> or some indication of what you are seeing versus what you expected to
> see.
> --
> DR.
>
> --
> 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
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Problem with defer

2010-02-22 Thread Dexter
Hi,

Im using django 1.1.1, and i'm trying to defer a queryset, but it doesn't
seem to work.
Here's my callback:

def open(request, id=None):
> """Callback to fire when a specific floor is opened."""
> if request.user.is_authenticated():
> if id:
> data = serializers.serialize('json',
> Floor.objects.filter(id=id))
> else:
> object = Floor.objects.only("name").all()
> print object.values()
> data = serializers.serialize('json', Floor.objects.all())
> #print data
> return HttpResponse(data)
>
> return HttpResponse("Operation not permitted!")
>

Thanks in advance.

Grtz, Dexter

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: pushing messages on a webapp

2010-02-22 Thread Dexter
Hi there,

I was wondering if it is possible to push messages to client side, or is the
only possible way polling from client to server.

Grtz, Dexter

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How add extra data to m2m-field before saving form?

2008-11-26 Thread dexter

This is the error i receive:

'EventForm' object has no attribute 'managers'
--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



How add extra data to m2m-field before saving form?

2008-11-26 Thread dexter

I want to add 'request.user' to 'members' of an 'event' that the user
creates. I have tried several different methods and googled without
finding any correct solutions. Right now, code looks like this but
still wont work:

# views.py
def new_event(request):
if request.method == 'POST':
form = EventForm(request.POST)
if form.is_valid():
form.save()
form.members.add(request.user) # THIS LINE DOESNT WORK
form.save_m2m()
return HttpResponseRedirect('/events/')
else:
form = EventForm()
return render_response(request, 'events/new.html', {'form': form})

#models.py
class Event(models.Model):
event = Models.CharField(max_length=64)
managers = models.ManyToManyField(User, blank=True, null=True)

#forms.py
class EventForm(ModelForm):
class Meta:
model = Event
--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: In forms, how add dynamic initial values out of reach for clients?

2008-11-17 Thread dexter

I've already read that and can't get the first one working:

instance = Instance(required_field='value')
form = InstanceForm(request.POST, instance=instance)
new_instance = form.save()

In my case, shouldn't it look like this:

user = request.user
discussion = Discussion.objects.get(pk=discussion_pk)
form = CommentForm(request.POST, user=user, discussion=discussion)
form = form.save()

Or am I wrong?
--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



In forms, how add dynamic initial values out of reach for clients?

2008-11-16 Thread dexter

I want logged in users to be able to add comments but only want some
of the formfields displayed. Fields 'user', 'date' and 'discussion'
should be out of reach for my sitevisitors/clients.

#models.py:
class Comment(models.Model):
user = models.ForeignKey(User)
date = models.DateTimeField(default=datetime.now())
text = models.TextField()
discussion = models.ForeignKey(Discussion)

How should i solve this? I've tried numerous ways but none of them
really worked.
--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Sort querysets by their data attribute values

2008-11-06 Thread dexter

I have a queryset which I have looped thru and added a (temporary)
data attribute to each instance. Now I would like to order the
queryset by the value of the data attributes. If I do it like this:

sorted(queryset, key=lambda x: x.data_attr)

the queryset turns into a list and I can't use it like a queryset
anymore = not good!
How can i solve this?

--~--~-~--~~~---~--~~
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, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---