Re: OperationalError: no connection to the server using Django and gunicorn

2011-07-01 Thread Adrián Ribao Martínez
I think that the error comes only when starting the server.

Reload the page about 10 times and check if you still get the error.

Regards,

Adrián

> Hi Adrian,
> 
> Have you solved this weird issue?
> 
> if yes, please tell me how.
> 
> Best regards,
> Andrey Makhnach
> 
> On May 27, 12:53 pm, Adrián Ribao  wrote:
> > I'm doing it manually because I'm just testing:
> >
> > ./manage.py run_gunicorn -c gunicorn.conf.py
> >
> > where gunicorn.conf.py
> >
> > # -*- coding: utf-8 -*-
> > import multiprocessing
> >
> > bind = "127.0.0.1:8000"
> > workers = multiprocessing.cpu_count() * 2 + 1
> > worker_class = 'gevent'
> >
> > On 27 mayo, 02:23, Shawn Milochik  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > What's the command you're using to run it?
> >
> > > Are you in screen? Are you using supervisor or anything like that?
> 
> 

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



Re: Weird join conditions

2011-07-01 Thread peroksid


On 1 июл, 01:35, Michal Petrucha  wrote:
> On Thu, Jun 30, 2011 at 02:13:05PM -0700, peroksid wrote:
> > Thank you, Michal,
>
> > Unfortunately, I need join condition, not a WHERE clause, which can be
> > easily extended with extra() method arguments.
> > It is not my bad mood, simply the same condition in WHERE and ON
> > produces different effect.
>
> Hmm, could you please provide an example? (-: Don't know whether it's
> the late night combined with lack of caffeine or something else but I
> can't figure out the difference at the moment...
>

Example, yes. As Haroon said, it is LEFT OUTER JOIN.

We have models reduced for convenience's sake here:

class Campaign(models.Model):
pass

class CampaignExtraStatus(models.Model):
campaign = models.ForeignKey(Campaign)
user = models.ForeignKey(User)

There is campaign with id = 34, user with id - 17, CampaignExtraStatus
for user_id = 17 does not exist:

select count(*) from campaign_campaign where campaign_campaign.id = 34

count
=
1

select count(*) from auth_user where auth_user.id = 17

count
=
1

select count(*) from campaign_campaignextrastatus where user_id = 17
and campaign_id = 34;

count
=
0

Now, query of type "a" takes all campaigns and fills columns from
NULLs where no row in campaign_campaignextrastatus for join condition.
Besides user_id there are  useful data in that table.

a) SELECT "campaign_campaign"."id",
"campaign_campaignextrastatus"."user_id" FROM "campaign_campaign" LEFT
OUTER JOIN "campaign_campaignextrastatus" ON ("campaign_campaign"."id"
= "campaign_campaignextrastatus"."campaign_id" AND
campaign_campaignextrastatus.user_id = 17) WHERE
"campaign_campaign"."id" = 34

id | user_id

34 | Null

1 row

b) SELECT "campaign_campaign"."id",
"campaign_campaignextrastatus"."user_id" FROM "campaign_campaign" LEFT
OUTER JOIN "campaign_campaignextrastatus" ON ("campaign_campaign"."id"
= "campaign_campaignextrastatus"."campaign_id") WHERE
("campaign_campaign"."id" = 34   AND
campaign_campaignextrastatus.user_id = 17)

id | user_id


0 rows

c) SELECT "campaign_campaign"."id",
"campaign_campaignextrastatus"."user_id" FROM "campaign_campaign" LEFT
OUTER JOIN "campaign_campaignextrastatus" ON ("campaign_campaign"."id"
= "campaign_campaignextrastatus"."campaign_id") WHERE
("campaign_campaign"."id" = 34   AND
(campaign_campaignextrastatus.user_id = 17 OR
campaign_campaignextrastatus.user_id IS NULL ))

id | user_id


0 rows

Queries "b" and "c" have the condition in WHERE, where it can not
produce required impact. It works in join condition clause, and only
there.

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



Re: E-store

2011-07-01 Thread Kai Diefenbach

On 2011-06-28 15:34:34 +0200, lillian cauldwell said:


How does one set up an e-store on their d'jango website?


You can use several shop solutions:

  http://djangopackages.com/grids/g/ecommerce/

You can read following book (I haven't read it) and build your own solution:

  http://django-ecommerce.blogspot.com/

HTH
Kai


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



Re: OperationalError: no connection to the server using Django and gunicorn

2011-07-01 Thread Андрей Махнач
I'm getting this error randomly
and it throws 500error to nginx (I'm using nginx+gunicorn)

and it appears really randomly ;)

On Jul 1, 10:16 am, Adrián Ribao Martínez  wrote:
> I think that the error comes only when starting the server.
>
> Reload the page about 10 times and check if you still get the error.
>
> Regards,
>
> Adrián
>
>
>
>
>
>
>
> > Hi Adrian,
>
> > Have you solved this weird issue?
>
> > if yes, please tell me how.
>
> > Best regards,
> > Andrey Makhnach
>
> > On May 27, 12:53 pm, Adrián Ribao  wrote:
> > > I'm doing it manually because I'm just testing:
>
> > > ./manage.py run_gunicorn -c gunicorn.conf.py
>
> > > where gunicorn.conf.py
>
> > > # -*- coding: utf-8 -*-
> > > import multiprocessing
>
> > > bind = "127.0.0.1:8000"
> > > workers = multiprocessing.cpu_count() * 2 + 1
> > > worker_class = 'gevent'
>
> > > On 27 mayo, 02:23, Shawn Milochik  wrote:
>
> > > > What's the command you're using to run it?
>
> > > > Are you in screen? Are you using supervisor or anything like that?

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



Re: More than one project using the same database

2011-07-01 Thread ALJ
Hi all and thanks for the feedback.

I'll elaborate on my situation. The sites have different uses but they
use exactly the same models. Infact the second site has no model.py of
its own. The second site's views simply import the required models
from the first site and, where possible, uses the same form classes
and functions.

Given the above, I hope that I shouldn't get any race issues.

However, if anyone knows of any documentation on recommended setup for
situations like these, it would be good to get a pointer. Secondly, on
how to detect if there is a risk of race conditions.

Cheers

ALJ

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



Re: db shardning

2011-07-01 Thread Mateusz Harasymczuk
anyone?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/lv8Uuskxkx0J.
To post to this group, send email to django-users@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.



dajngo TabularInline fixed objects

2011-07-01 Thread Mateusz Harasymczuk
Is there a way to declare a set of fixed objects in TabularInline?

I have:

Contract object (with user data, user address and stuff) and tabular inline 
added months.

months names are fixed, and there is some data to change for each month

I have done this with JavaScript, setting value of each field (month name), 
on document ready, and then disabling a select list
is there a way to do so via django?

acting like readonly_field with default value set, but not one static value, 
but variable depending on row num. 


--
Matt Harasymczuk
http://www.matt.harasymczuk.pl

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/1gcQQsNjB4cJ.
To post to this group, send email to django-users@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 use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Russell Keith-Magee
On Friday, July 1, 2011, Herman Schistad  wrote:
> What about including something about e.g. http://dpaste.com for snippets etc.
> I know I hate to read more than 10 lines of code in my email reader,
> without syntax highlighting or correct indentation.

Actually, there is a really good reason not to use dpaste (or a
similar alternative) - it breaks the integrity of the Django-users
archive. If dpaste ever goes away, or expires old pastes, then a
valuable resource is lost. If we cant say "search the archives for an
answer", then one of the big reasons for having a mailing list in the
first place is lost.

Yours,
Russ Magee %-)

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



Stay on a step in a form wizard until the user is ready to move on.

2011-07-01 Thread Levi Campbell
I'm working on a site that uses a form wizard as the main user interface. 
I've got one step however that I'd like to have a user be able to complete 
it several times if needed, storing the data bound to the user's session. Is 
there a way to do this using the FormWizard class, or am I asking too much? 
Thank you for your consideration and have a good day.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/jeDVROAr610J.
To post to this group, send email to django-users@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.



access fields in intermediate model

2011-07-01 Thread feng yu
http://stackoverflow.com/questions/2005953/django-access-fields-in-intermediate-model

in this post, you can find how to access fields in intermediate model
like this 'my_group.membership_set.all()'

i use this in my own code, but it did not work. it get ' [] '

my models is very likely with the models in that post. And the code
"my_group.members.all()" is not ' [] '.

anyone know the reason?

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



Re: Managing objects spred among several tables/databases.

2011-07-01 Thread Hummingbird
I have a somewhat similar situation.

In my form, fields from various database tables are combined.
A user may add/edit/delete/doesn't change fields.
While saving the form, the logic should check--
1) which table(s) would require add SQL statement,
2) which table(s) require update stmt,
3) which one(s) require delete stmt.

At present, I am using some other web framework.
There, I need to do the circus of deriving the above statements.
Although one can write a class for the above, I would be happy if
something similar is already there in django.

In such a case, I may abandon my present framework & switch to this
web framework.

Does anybody know about such a facility here?
Any comments / response highly pappreciated.

On Jun 30, 9:23 am, qMax  wrote:
> Hello here.
>
> My application task is to integrate several applications, and it
> should manipulate objects, spread among several tables in several
> databases. Final object is constructed by 'joining' tables by single
> field (or derivatives).
> A user should see such objects as solid entities and manipulate them
> with basic CRUD operations (with search).
> Backend should synchronize all changes in all databases.
> And i wish i could use admin site for that.
>
> If i guess correctly, all required magic should go into custom
> QuerySet implementation to properly translate CRUD operations on
> models into various distributed requests on databases, like zigzag-
> joins, etc instead of usual sql.Queries.
>
> I wonder if QuerySet is the only consolidation of such interface.
> What else should i customize to make it work? (i see at least
> db.models.Manager should be customized to use another queryset impl)
> Also, how to figure out what subset of QuerySet interface is used in
> admin site?
>
> Maybe, someone already managed similar task and there are some recipes?

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



Re: More than one project using the same database

2011-07-01 Thread patrickf
I agree with Andres; based on your description, you should be able to
do this with no issues. We are using a legacy database system with 15
years worth of company data - constantly updated by a legacy web based
app (written in delphi) - and have adding new functionality via django
(both reading and writing to the same db) for about 18 months now,
with no issues.

You must:  Create a stage environment by taking duplicates of your
live data and use it to test, test, and test. And test again. Examine
the data record by record to ensure that what you THINK is happening
actually IS happening. Make sure that your models match from one
application to another.

Also read up on how transactions work in your particular database
system  - and check out how django handles them (eg:
https://docs.djangoproject.com/en/dev/topics/db/transactions/#controlling-transaction-management-in-views).

Transactions are designed to avoid data corruption, not eliminate race
conditions - and a race condition is just as likely to occur in the
same app as different apps sharing the same DB -  and it is your
responsibility to avoid them (ie in your code, not django or the DBMS)
but there are many examples on how to avoid them, such as:
http://stackoverflow.com/questions/1030270/race-conditions-in-django

(I know that some of the advice above may seem obvious, but in my
experience it hasnt been to some...)

Good luck - Patrick

On Jun 30, 12:53 pm, andres.osin...@gmail.com wrote:
> In theory, unless you've disabled transactions, the database should be able 
> to manage all contention issues.
> Enviado desde mi BlackBerry de Movistar (http://www.movistar.com.ar)
>
>
>
>
>
>
>
> -Original Message-
> From: ALJ 
>
> Sender: django-users@googlegroups.com
> Date: Thu, 30 Jun 2011 04:46:15
> To: Django users
> Reply-To: django-users@googlegroups.com
> Subject: More than one project using the same database
>
> I have an extranet type project that has been running for a year. It
> only has a maximum user base of about 50 people of which probably only
> a few are using it at any one time. The users can add, edit and delete
> items within the application
>
> However, we need to expose the data in that extranet application to a
> another group of users but through another domain. Anonymous users
> will be able to register requests to be contacted, and another group
> of known users  will be able to log in with read only access to see
> the status of those requests.
>
> My question is, what are the issues that I need to think about (are
> race issues one?), is it possible to detect if these issues could
> occur in my particular situation, and how do you mitigate against
> these.
>
> ALJ
>
> --
> 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 
> 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-users@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.



Aw: Different urlpatterns for different subdomains

2011-07-01 Thread Juergen Schackmann
maybe that helps: https://github.com/jezdez/django-hosts

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/dUDV20f2CsUJ.
To post to this group, send email to django-users@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 AJAX polling: Best practice?

2011-07-01 Thread Duane Griffin
On 30 June 2011 21:31, Shawn Milochik  wrote:
> This isn't a job for AJAX -- it's a job for Comet, which is tailor-made for
> your exact needs.

Yes. Have your clients subscribe to an update channel for the game
(you will probably need separate channels for each user, unless all
players have full information). Generate the delta when the update
happens and push it out to the relevant channel(s).

> Check out Hookbox. Here's a tutorial which can definitely get you started. I
> was able to learn enough from it to get a small sample working.
> http://charlesleifer.com/blog/writing-a-real-time-chat-app-using-hookbox-and-flask/

Hookbox is a great way to easily get something up and running with
Comet*, but be aware that the project looks sadly unloved at the
moment. I'd be pretty wary about using it in production. On the other
hand, it can't possibly be worse than polling.

Cheers,
Duane.

* shameless plug: especially if you use django-hookbox.

-- 
"I never could learn to drink that blood and call it wine" - Bob Dylan

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



Re: How to use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Brian Bouterse
Just because dpaste breaks integrity of django-users doesn't mean that
e-mail is the "right" forum.  E-mail doesn't preserve code formatting or
syntax highlighting which is legitimately annoying.  Also lots of coders
still use text based e-mail (I don't but others do) so html syntaxing won't
always work either.  pastebin.com does have the option to retain snippets
forever as an alternative to dpaste.com which deleted them eventually.

Brian

On Fri, Jul 1, 2011 at 5:58 AM, Russell Keith-Magee  wrote:

> On Friday, July 1, 2011, Herman Schistad 
> wrote:
> > What about including something about e.g. http://dpaste.com for snippets
> etc.
> > I know I hate to read more than 10 lines of code in my email reader,
> > without syntax highlighting or correct indentation.
>
> Actually, there is a really good reason not to use dpaste (or a
> similar alternative) - it breaks the integrity of the Django-users
> archive. If dpaste ever goes away, or expires old pastes, then a
> valuable resource is lost. If we cant say "search the archives for an
> answer", then one of the big reasons for having a mailing list in the
> first place is lost.
>
> Yours,
> Russ Magee %-)
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Brian Bouterse
ITng Services

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



Re: How to use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Herman Schistad
Yeah, I forgot that dpaste deleted after 7 days, but pastebin is a
good proposal Brian.

We could also recommend people to paste the code in both pastebin and
email, as the probability of someone taking the time to read through
the code then becomes higher (I know I would much rather click on a
pastebin link and read the code there - which makes it more probable
that I'll help)

-- 
With regards, Herman Schistad

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



Re: More than one project using the same database

2011-07-01 Thread Cal Leeming [Simplicity Media Ltd]
(sorry this email bounced yesterday)

OP: in a nutshell, unless you fully understand the risks, you should avoid
doing this on a site which is in production. However, this would be a great
opportunity to learn about this subject in a dev environment. After all,
thats how i learnt (except i made the mistake of doing it in production and
now i have to support and maintain that bad code for 5 years) lol
On 1 Jul 2011 11:53, "patrickf"  wrote:
> I agree with Andres; based on your description, you should be able to
> do this with no issues. We are using a legacy database system with 15
> years worth of company data - constantly updated by a legacy web based
> app (written in delphi) - and have adding new functionality via django
> (both reading and writing to the same db) for about 18 months now,
> with no issues.
>
> You must: Create a stage environment by taking duplicates of your
> live data and use it to test, test, and test. And test again. Examine
> the data record by record to ensure that what you THINK is happening
> actually IS happening. Make sure that your models match from one
> application to another.
>
> Also read up on how transactions work in your particular database
> system - and check out how django handles them (eg:
>
https://docs.djangoproject.com/en/dev/topics/db/transactions/#controlling-transaction-management-in-views
).
>
> Transactions are designed to avoid data corruption, not eliminate race
> conditions - and a race condition is just as likely to occur in the
> same app as different apps sharing the same DB - and it is your
> responsibility to avoid them (ie in your code, not django or the DBMS)
> but there are many examples on how to avoid them, such as:
> http://stackoverflow.com/questions/1030270/race-conditions-in-django
>
> (I know that some of the advice above may seem obvious, but in my
> experience it hasnt been to some...)
>
> Good luck - Patrick
>
> On Jun 30, 12:53 pm, andres.osin...@gmail.com wrote:
>> In theory, unless you've disabled transactions, the database should be
able to manage all contention issues.
>> Enviado desde mi BlackBerry de Movistar (http://www.movistar.com.ar)
>>
>>
>>
>>
>>
>>
>>
>> -Original Message-
>> From: ALJ 
>>
>> Sender: django-users@googlegroups.com
>> Date: Thu, 30 Jun 2011 04:46:15
>> To: Django users
>> Reply-To: django-users@googlegroups.com
>> Subject: More than one project using the same database
>>
>> I have an extranet type project that has been running for a year. It
>> only has a maximum user base of about 50 people of which probably only
>> a few are using it at any one time. The users can add, edit and delete
>> items within the application
>>
>> However, we need to expose the data in that extranet application to a
>> another group of users but through another domain. Anonymous users
>> will be able to register requests to be contacted, and another group
>> of known users  will be able to log in with read only access to see
>> the status of those requests.
>>
>> My question is, what are the issues that I need to think about (are
>> race issues one?), is it possible to detect if these issues could
>> occur in my particular situation, and how do you mitigate against
>> these.
>>
>> ALJ
>>
>> --
>> 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
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-users@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-users@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 use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Cal Leeming [Simplicity Media Ltd]
Or, how about the django website team create their own pastebin for django
mailing lists :) They could even just use a stock pastebin install. Any
thoughts?
On 1 Jul 2011 13:23, "Herman Schistad"  wrote:
> Yeah, I forgot that dpaste deleted after 7 days, but pastebin is a
> good proposal Brian.
>
> We could also recommend people to paste the code in both pastebin and
> email, as the probability of someone taking the time to read through
> the code then becomes higher (I know I would much rather click on a
> pastebin link and read the code there - which makes it more probable
> that I'll help)
>
> --
> With regards, Herman Schistad
>
> --
> 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
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-users@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: JQuery .load() works in production but fails in development

2011-07-01 Thread Joe Linoff
Hi Folks:

I figured it out. The idea is NOT to use CGI. It is not needed. Simply use a 
Django WSGI URL to access the python module (in a view) and everything it 
works fine. It as blindingly obvious once I figured it out.

Here is what I did to get it to work:

   1. Added a new URL called '/status/sync' in urls.py: 
   url(r'^sync/status/$','status'),
   2. Added status to my views.py:
   from django.http import HttpResponse
   import datetime
   def sync_status(request):
   now = datetime.datetime.now()
   html = 'now = %s' % (now)
   return HttpResponse(html)
   3. Changed my index.html javascript as follows:
   $('#status').load('/employees/sync/status');

And everything worked perfectly in both environments. I have now removed the 
CGI stuff.

Sorry to have bothered you.

Regards,

Joe



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/nSUGnywpdngJ.
To post to this group, send email to django-users@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.



OT: Drummers / Percussionists

2011-07-01 Thread Tim Sawyer

Hi Folks,

I'm in the process of building a Django site to host my drum/percussion 
tutor books, and could do with some testers with multiple browsers and 
OSes to have a go and tell me what works and what doesn't.  The site 
allows playback of the percussion music "karaoke" style - see the 
homepage for an example.


I think it works in Firefox/Chrome - I've had some issues with audio in 
Safari, no chance in IE <= 8, haven't tried IE 9.


http://percussion360.com/

As the functionality you'll be testing is primarily SVG/JavaScript and 
not Django, please reply to me off list.


Many thanks,

Tim.

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



Re: Global generic files? Best practice(s)?

2011-07-01 Thread Andre Terra
On Fri, Jul 1, 2011 at 3:32 AM, Micky Hulse  wrote:

Hello Andre! Thanks so much for your help, I really appreciate the pro
> advice!!! :)
>

I'm not sure it's pro, but I'm glad to help :)


>  On Thu, Jun 30, 2011 at 6:01 AM, Andre Terra 
> wrote:
> > __init__.py
> > app1/
> > app2/
> > appN/
> >__init__.py
> >models.py
> >views.py
> >urls.py
> >forms.py
> >templates/
> >utils.py
> > project/
> >__init__.py
> >forms.py
> >settings.py
> >urls.py
> >utils.py
> >views.py
> >templates/
> >static/
> >(etc.)
>
>
> Oooh, I really like the above setup!
>
> That's similar to how I setup my very first Django project/app (sorry,
> poorly packaged... er, not packaged at all!):
>
> https://github.com/mhulse/code.hulse.me/tree/master/webapps
>
> project/
>__init__.py
>manage.py
>settings.py
>urls.py
>views.py
> apps/
>app1/
>app2/
> templates/
>app1/
>app2/
>

The standard really seems to be having a 'templates' folder for each app,
but I think I did the same in my first 'hello world' project.


> That layout seemed to work well for that particular project.
>
> At work, we use a more out-of-the-box setup:
>
> project/
>__init__.py
>manage.py
>settings.py
>urls.py
>views.py
>app1/
>__init__.py
>views.py
>models.py
>admin.py
>helpers.py
>managers.py
>validators.py
>widgets/
>urls.py
>forms.py
>fields.py
>utils.py
>templates/
>app1/
>app2/
>app3/
>templates/
>app1/
>app2/
>app2/
>
> I really like your suggested setup though! Putting the apps at the
> same level as the project seem to make a lot of sense.
>
> Using the project as a container for utils.py is a great idea also. :)
>
> > Which basically means my project is just another app. Nothing is
> > preventing you from creating utils.py files in your apps, or even
> > settings.py that get loaded from an import in your project's settings.
>
> Yes! That sounds like an optimal setup! :)
>
> When you talk about an app's settings.py file, do you just put
> something like this:
>
> from app import settings


> ... at the top of the project's settings.py file?
>

I usually put that at the *bottom* of the settings.py file, and give each
app's settings file a different name which usually follows an
app_settings.py format.

So basically something like this should work:

try:
from myapp.settings import *
except ImportError:
pass

Which brings us to my next point. I recently decided (out of the blue,
haven't seen anyone else do it) to use the same solution to differentiate
between production and development settings. As it's often the case, you
will probably have your project in a git repo somewhere, so pulling/pushing
on development and production environments can break things every time.

To prevent me from having to set things like the DEBUG variable and
different db configs, I figured why not create a production.py file which
has the settings for the server? It was just a matter of adding that to
.gitignore, and now *that* file doesn't get added to the git repo, and I can
safely pull without having to manually alter anything. Don't forget the
try/except block or your dev server will choke!

Now, it feels incredibly fast to pull to my dev laptop, make changes, push
to the repo, ssh into the server, pull from the repo, kill python and reload
the production page.


> I had never considered doing that before... I will have to experiment.
> Thanks for tip!
>
> > I find this arrangement to be the best for my development workflow
> > after many other attempts. This also helps newcomers avoid the often
> > made mistake of referencing their apps in relation to the project like
> > from project.app1 import views
> > which would prevent the code from being reused in other projects.
>
> Hehe, I can relate. Been there, done that. :)
>
> > About your Place model, my recommendation/guess would be to abstract
> > it one more time so that you could have a global BasePlace class which
> > gets subclassed in an app-specific Place model.
>
> That's an interesting idea!
>
> I actually have several (abstract) models similar to "Place" that I
> could use in my various apps/projects... I have found myself
> duplicating the code for these various apps... It would be great to
> put them at a higher level and import/sub-class as they are needed.
>
>
> > Or at least that's what I thought last nignt before going to sleep. As
> > I write this, I realize that a BasePlace would have no place (pun not
> > intended) in your project, so maybe what you need is a package for
> > your multiple apps which in turn gets imported into your project.
>
> That's a great idea/tip!
>
> You inspired me to create my first pip-installable package:
>
> https://github.com/mhulse/django-goodies
>
> Not much there at the moment, but I plan on adding mo

Re: Weird join conditions

2011-07-01 Thread peroksid
Unfortunately, join and friends  are off use because SQLCompiler's
get_from_clause() creates join conditions on dumb string template.
I monkeypatched compiler's get_from_clause in connection.ops._cache.
Now it calls original method saved under another name on compiler and
after that replaces join condition with required one in one of data
chunks.

How do you think, will there be problems?

On 1 июл, 01:35, Michal Petrucha  wrote:
> On Thu, Jun 30, 2011 at 02:13:05PM -0700, peroksid wrote:
> > Thank you, Michal,
>
> > Unfortunately, I need join condition, not a WHERE clause, which can be
> > easily extended with extra() method arguments.
> > It is not my bad mood, simply the same condition in WHERE and ON
> > produces different effect.
>
> Hmm, could you please provide an example? (-: Don't know whether it's
> the late night combined with lack of caffeine or something else but I
> can't figure out the difference at the moment...
>
> > I think rather about some method which gets together whole SQL query.
> > Currently I call join() on queryset's query to join my table with part
> > of target join condition.
> > I could take the query assembled by "assembler" method and replace the
> > part of condition with an entire one.
>
> > It seems you know pretty much about Django ORM if you work on
> > composite keys (great respect).
> > Could you please hint me about this "assembler" method I babble about?
>
> Well, basically, the models.sql.query.Query.join method and friends
> manage a list of joins which is then processed in
> models.sql.compiler.SQLCompiler.get_from_clause.
>
> Anyway, in some cases it might be more reasonable to just write your
> own query instead of fighting with the ORM to make it do what you
> wanti at all cost. (-; Bear in mind that if you try to override these
> deeply hidden mechanisms in your code, you'll have to keep in sync
> with any internal changes and refactors. And I can assure you these
> will happen in the foreseeable future. (-;
>
> Michal
>
>  signature.asc
> < 1KбПросмотретьЗагрузить

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



Re: How to use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Micky Hulse
Don't forget about GitHub Gists!

https://gist.github.com/

Considering a lot of Django projects are already hosted there... Seems
like a natural fit to me. :)

Also, Gist has the "fork" feature.

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



Re: forms and form processing

2011-07-01 Thread urukay
Hi Jay,

take a look here, it is explained pretty well
https://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#email-backend

If don't have own SMTP server, you can try to use Google's SMTP
server.

Radovan
http://www.yau.sk

On 30. Jún, 21:06 h., "jay K."  wrote:
> Hello,
>
> thanks for the reply
>
> I dont have email settings in my settings.py file? is that straightforward,
> like an import statement or
> something more complex?
>
> I am using django version (1, 1, 1, 'final', 0) - that's what i got after
> typing import django django.VERSION on the python shell
>
> Jay k
>
>
>
>
>
>
>
> On Thu, Jun 30, 2011 at 3:36 AM, urukay  wrote:
> > Hi,
> > have you got email settings set in your settings.py?
> > What version of Django are you using?
>
> > Radovan
> >http://www.yau.sk
>
> > On 29. Jún, 00:23 h., "jay K."  wrote:
> > > Hello,
>
> > > I need to add a form on my django website
>
> > > so far this is what i have:
>
> > > in my models.py:
>
> > >  import statements not shown here
>
> > > CONTACT_OPTIONS = (
> > >                                  ('skype video anruf','Skype Video-
> > > Anruf'),
> > >                                  ('skype anruf ','Skype Anruf'),
> > >                                  ('telefon','Telefon')
> > >                                 )
>
> > > class ContactForm(forms.Form):
>
> > >     #wann
> > >     date_input = forms.CharField(max_length=30, required=True) #,
> > > initial="MO-FR"
> > >     time_input = forms.CharField(max_length=30, required=True) # 14:00
> > > - 22:00
>
> > >     #wie
> > >     choice_options = forms.ChoiceField(widget=RadioSelect,
> > > choices=CONTACT_OPTIONS, required=True)
>
> > >     #contact
> > >     email = forms.EmailField(max_length=30, required=True)
> > >     telephone = forms.CharField(max_length=30, required=False)
> > >     skype = forms.CharField(max_length=30, required=False)
>
> > >     #comment
> > >     comment_text = forms.CharField(widget=forms.Textarea,
> > > required=False)
>
> > > my views.py
>
> > > from website.contact.models import ContactForm
> > > from django.shortcuts import render_to_response
> > > from django.template.context import RequestContext
> > > from django.http import HttpResponseRedirect, HttpResponse
> > > from django.core.mail import send_mail
>
> > > def contact(request):
>
> > >     if request.method == 'POST': # If the form has been submitted...
> > >         form = ContactForm(request.POST) # A form bound to the POST
> > > data
>
> > >         if form.is_valid(): # All validation rules pass
> > >             # Process the data in form.cleaned_data
>
> > >             subject = form.cleaned_data['subject']
> > >             message = form.cleaned_data['message']
> > >             sender = form.cleaned_data['sender']
> > >             cc_myself = form.cleaned_data['cc']
>
> > >             date_input = form.cleaned_data['date input']
> > >             time_input = form.cleaned_data['time input']
> > >             choice_options = form.cleaned_data['contact options']
>
> > >             telephone = form.cleaned_data['telefone']
> > >             email = form.cleaned_data['email'] # this is the sender's
> > > email
> > >             skype = form.cleaned_data['skype']
>
> > >             comment_text = form.cleaned_data['comment text']
>
> > >             """
> > >             recipients = ['joung.k...@lingua-group.org']
> > >             if cc_myself:
> > >                 recipients.append(sender)
> > >             """
> > >            #subject
> > >             send_mail('subject', 'message', 'myem...@myemail.com',
> > > ['myem...@myemail.com', email], fail_silently=False)
>
> > >             return HttpResponseRedirect('/danke/')
>
> > >     else:
> > >         form = ContactForm() # An unbound form
>
> > >     return render_to_response('beratungstermin.html', {'form': form},
> > > context_instance=RequestContext(request))
>
> > > And on the website I have all the fields inside the form tag
> > > 
> > > {{ forms.as_p }}
> > > 
>
> > > What I want to do basically is to add the fields for name, email, tel,
> > > some of them being compulsory, so the form should not be processed if
> > > there is some info. missing.
>
> > > I also want to receive a confirmation email whenever a user sends
> > > information through the page, to my "myem...@myemail.com" (this is not
> > > working on my code either), and a "CC" button if the user wants a copy
> > > of his/her own message.
>
> > > Thanks
>
> > > Let me know if you need any details
>
> > > PS: i copied most of the code from the official django tutorial
> > athttps://docs.djangoproject.com/en/dev/topics/forms/?from=olddocs, but
> > > somehow I do not receive any emails after hitting the submit button.
> > > Also, even if I declared in my views.py that some fields are
> > > "required=True", I can still hit the send button with no error
> > > messages for those unfilled textfields.
>
> > --
> > You received this message because you are subscribed to the G

Re: Global generic files? Best practice(s)?

2011-07-01 Thread Micky Hulse
Hello again Andre!

On Fri, Jul 1, 2011 at 7:58 AM, Andre Terra  wrote:
> The standard really seems to be having a 'templates' folder for each app,
> but I think I did the same in my first 'hello world' project.

That's good to hear! :)

That's what I have been doing for all of my recent apps:

app/
templates/
base.html
app/
base.html
foo.html

One of the things I love about the Django templating language is that
I can then put a templates folder at the root level of my project:

project/
templates/
base.html
app/
base.html
foo.html

And, for example, the "new guy" can trump my app-specific templates...
Which means I always have a base look/feel tied to my app (sorry to
state the obvious here.)

Django rocks. :)

> I usually put that at the *bottom* of the settings.py file, and give each
> app's settings file a different name which usually follows an
> app_settings.py format.
> So basically something like this should work:

That's cool!

So, putting it at the bottom allows you to trump any setting already
defined in the main settings file... Nice.

I should search DjangoSnippets for a snippet that would dynamically
import any app/appname_settings.py files... Seems like a piece of code
like that would be pretty handy.

> Which brings us to my next point. I recently decided (out of the blue,
> haven't seen anyone else do it) to use the same solution to differentiate
> ..
> to the repo, ssh into the server, pull from the repo, kill python and reload
> the production page.

Oooh, now that's cool!!!

At my work, we normally just develop on a dedicated testing server and
then copy/paste code over to our live server...

I really need to start testing on my local machine... Seems like most
people do as you say, and pull/push from GitHub or BitBucket, work
locally, and then push things back up to the main repo.

Ok, so, here's my weekend todo list:

1. Hone Python skills:

* Google's Python Class
http://code.google.com/edu/languages/google-python-class/

* Dive Into Python
http://diveintopython.org/

2. Install (on my local machine)/update/learn more about Macports and VirtualEnv

* Practice using github to push/pull projects/apps.

> Sounds like you might be on your way to writing a truly reusable app, nice!
> I need to do that one of these days. I've never packaged anything for pip,
> but I promise to give it a try next month.

It's nice to have had the experience... Not that I have, or will,
build anything worth sharing (outside of my work)... It's just nice to
know how it's done. Thanks for the inspiration!

> Again, congrats and best of luck!

You too! Thanks again Andre, I really appreciate the help and advice. :)

Cheers,
Micky

-- 
Micky Hulse
Web Content Editor
The Register-Guard
3500 Chad Drive
Eugene, OR 97408
Phone: (541) 338-2621
Fax: (541) 683-7631
Web: 

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



ListView.get_context_data Exception

2011-07-01 Thread Brian Bouterse
I implemented a silly thing that ended up getting reworked because I
couldn't make Django work in the way my (silly) design wanted it to.  Here
was the situation:

1.  I wrote a class based (Django 1.3) view named
HomepageViewthat inherited from ListView
2.  I defined a post method for HomepageView which would save a form that
was posted to it.
3.  Inside the post, if the form validates, I redirect the user, which works
well
4.  Inside the post, if the form is not valid, I try to put the bound form
(with validation errors) into the context and then render the page like
normal

I receive this traceback .  Which is telling
me that when ListView.get_context_data is called it can't find the object
named 'object_list'.

I don't know why this is occurring.  The path of execution calls
ListView.get_context_data twice, yet when it is called from within my post
function it fails strangely.  I know what I'm doing is kind-of strange, but
it should work right?

Enlighten me...

Thanks,
Brian

-- 
Brian Bouterse
ITng Services

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



Re: Django AJAX polling: Best practice?

2011-07-01 Thread Andreas Pfrengle
Thanks so far for showing me that I was on the completely wrong
track ;-)

I found that there is really not much official information available
about Hookbox: . That doesn't make an easy
decision for Hookbox.

Has anyone experience with socket.io and gevent instead? Looks
interesting at first glance:



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



Re: How to use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Cal Leeming [Simplicity Media Ltd]
+1 on gists (i didn't even know this existed).

Because to be honest, if github disappears, then something has gone terribly
wrong with the interwebs :X

But also +1 on django web team deploying their own...

On Fri, Jul 1, 2011 at 5:46 PM, Micky Hulse  wrote:

> Don't forget about GitHub Gists!
>
> https://gist.github.com/
>
> Considering a lot of Django projects are already hosted there... Seems
> like a natural fit to me. :)
>
> Also, Gist has the "fork" feature.
>
> --
> 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
> 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-users@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 use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Cal Leeming [Simplicity Media Ltd]
Also, I modified the wiki entry to include one good/one bad example of a
thread.

Could others people also contribute some examples of what they consider
good/bad threads too? (maybe could even put some text underneath to explain
why)

On Fri, Jul 1, 2011 at 10:46 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> +1 on gists (i didn't even know this existed).
>
> Because to be honest, if github disappears, then something has gone
> terribly wrong with the interwebs :X
>
> But also +1 on django web team deploying their own...
>
>
> On Fri, Jul 1, 2011 at 5:46 PM, Micky Hulse  wrote:
>
>> Don't forget about GitHub Gists!
>>
>> https://gist.github.com/
>>
>> Considering a lot of Django projects are already hosted there... Seems
>> like a natural fit to me. :)
>>
>> Also, Gist has the "fork" feature.
>>
>> --
>> 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
>> 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-users@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: Weird join conditions

2011-07-01 Thread Michal Petrucha
> Example, yes. As Haroon said, it is LEFT OUTER JOIN.

Yeah, of course, must have been the lack of caffeine as I said. (-:

> Unfortunately, join and friends  are off use because SQLCompiler's
> get_from_clause() creates join conditions on dumb string template.
> I monkeypatched compiler's get_from_clause in connection.ops._cache.
> Now it calls original method saved under another name on compiler and
> after that replaces join condition with required one in one of data
> chunks.
> 
> How do you think, will there be problems?

First, if you look at the extent of changes required to force the ORM
to solve your problem, a question that comes to mind: Was it worth the
effort? I mean, if it were me, I'd probably try to do something like
this only if I needed it quite often, like, half of the queries I make
require this or something like that, otherwise I'd just stick to a raw
query. And even then, it might be easier to just create a reusable raw
query factory, if you get what I mean... But, of course, I don't know
your app nor what problem you're dealing with, so I may be off by
miles.

Second, the mechanisms you're altering aren't part of the public API;
they may change between versions just like that. Though this doesn't
usually happen, I already had to make some changes in this area in my
branch and I'll definitely have to also modify the joining code in
question. All I'm saying is, once you go this route, you shouldn't be
surprised if stuff breaks upon upgrade.

Michal


signature.asc
Description: Digital signature


Re: How to use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Andre Terra
To be honest, I often think about how an e-mail list is actually one of the
worst media to help with coding.

Here's some food for thought: wouldn't it be better if we had a django-help
project that combined django snippets, a stack overflow-like ratings system
(an incentive to both good questions and speedy answers), code highlighting,
moderation, open/closed questions, etc?



Sincerely,

André Terra


On Fri, Jul 1, 2011 at 6:51 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Also, I modified the wiki entry to include one good/one bad example of a
> thread.
>
> Could others people also contribute some examples of what they consider
> good/bad threads too? (maybe could even put some text underneath to explain
> why)
>
> On Fri, Jul 1, 2011 at 10:46 PM, Cal Leeming [Simplicity Media Ltd] <
> cal.leem...@simplicitymedialtd.co.uk> wrote:
>
>> +1 on gists (i didn't even know this existed).
>>
>> Because to be honest, if github disappears, then something has gone
>> terribly wrong with the interwebs :X
>>
>> But also +1 on django web team deploying their own...
>>
>>
>> On Fri, Jul 1, 2011 at 5:46 PM, Micky Hulse  wrote:
>>
>>> Don't forget about GitHub Gists!
>>>
>>> https://gist.github.com/
>>>
>>> Considering a lot of Django projects are already hosted there... Seems
>>> like a natural fit to me. :)
>>>
>>> Also, Gist has the "fork" feature.
>>>
>>> --
>>> 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
>>> 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-users@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-users@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 use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Geoff Kuenning
If your mail reader reformats text, IMHO it's broken.  At a minimum,
it ought to give you the option of seeing a message without
"helpfully" reformatting it.

I see little harm in asking (politely) that people go through the
significant hassle of posting code in two places (one of which may be
inaccessible at the moment of posting) just to work around broken
mailers and the preference of some readers for multicolored code.  But
don't expect it to increase the number of answers to legitimate
questions.

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



Re: Managing objects spred among several tables/databases.

2011-07-01 Thread Hummingbird
Hi !
I have a similar situation.
(disclaimer:-- I have tried turbogears & web2py before.
But could not find the following functionality there.
So I have signed-in here to see whether I can get it in django).

My form is composed of fields from various tables.
When a user interacts with form, he/she may add/edit/delete/keep
unchanged certain fields,
After saving the form, I need to understand---
1) which table(s) should receive SQL add statement,
2) which one(s) need update stmt,
3) which one(s) to receive delete stmt.

Some examples of (desktop) frameworks having this feature:--
i) CursorAdaptor in VFP
ii) DABO desktop framework
But I am looking for a web framework having this feature.

Without a proper method (rather class) to handle it, it would be very
messy.
There will be code repetitions, etc.

I am eager to know whether there is any facility to do the above thing
in django.
In that case, I will happily switch to django.
Any comments/advise/knowledge-sharing highly appreciated.

Thanks.

On Jun 30, 9:23 am, qMax  wrote:
> Hello here.
>
> My application task is to integrate several applications, and it
> should manipulate objects, spread among several tables in several
> databases. Final object is constructed by 'joining' tables by single
> field (or derivatives).
> A user should see such objects as solid entities and manipulate them
> with basic CRUD operations (with search).
> Backend should synchronize all changes in all databases.
> And i wish i could use admin site for that.
>
> If i guess correctly, all required magic should go into custom
> QuerySet implementation to properly translate CRUD operations on
> models into various distributed requests on databases, like zigzag-
> joins, etc instead of usual sql.Queries.
>
> I wonder if QuerySet is the only consolidation of such interface.
> What else should i customize to make it work? (i see at least
> db.models.Manager should be customized to use another queryset impl)
> Also, how to figure out what subset of QuerySet interface is used in
> admin site?
>
> Maybe, someone already managed similar task and there are some recipes?

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



Re: How to use the django-users mailing list properly and doing your homework..

2011-07-01 Thread Piotr Zalewa

Everything has its place. For me it looks like that:

direct help - IRC
searching for solutions - tutorials, documentation, django snippets
discovering new stuff - email list, StackOverflow

zalun

On 07/02/11 01:11, Andre Terra wrote:

To be honest, I often think about how an e-mail list is actually one of
the worst media to help with coding.

Here's some food for thought: wouldn't it be better if we had a
django-help project that combined django snippets, a stack overflow-like
ratings system (an incentive to both good questions and speedy answers),
code highlighting, moderation, open/closed questions, etc?



Sincerely,

André Terra


On Fri, Jul 1, 2011 at 6:51 PM, Cal Leeming [Simplicity Media Ltd]
mailto:cal.leem...@simplicitymedialtd.co.uk>> wrote:

Also, I modified the wiki entry to include one good/one bad example
of a thread.

Could others people also contribute some examples of what they
consider good/bad threads too? (maybe could even put some text
underneath to explain why)

On Fri, Jul 1, 2011 at 10:46 PM, Cal Leeming [Simplicity Media Ltd]
mailto:cal.leem...@simplicitymedialtd.co.uk>> wrote:

+1 on gists (i didn't even know this existed).

Because to be honest, if github disappears, then something has
gone terribly wrong with the interwebs :X

But also +1 on django web team deploying their own...


On Fri, Jul 1, 2011 at 5:46 PM, Micky Hulse mailto:rgmi...@gmail.com>> wrote:

Don't forget about GitHub Gists!

https://gist.github.com/

Considering a lot of Django projects are already hosted
there... Seems
like a natural fit to me. :)

Also, Gist has the "fork" feature.

--
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
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-users@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-users@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-users@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.