Re: Admin for proxy model for custom User

2013-05-28 Thread Tomas Neme
Silly, but aren't you missing

class Patient()
save(self):
self.kind = 'p'
super(Patient, self).save()

or some such thing and something similar for Doctor? I guess it might be in
the forms, but since it's nowhere in the code you showed...

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Admin for proxy model for custom User

2013-05-28 Thread Andres Osinski
Hi everyone, I've created a custom User model and reated a proxy for
it, like this:

class User(AbstractUser):
USER_KINDS = (
('d', 'doctor'),
('p', 'patient')
)
 kind = models.CharField(max_length=2, choices=USER_KINDS)

class DoctorManager(BaseUserManager):
def get_queryset(self):
return super(DoctorManager, self).get_queryset().filter(kind='d')


class PatientManager(BaseUserManager):
def get_queryset(self):
return super(DoctorManager, self).get_queryset().filter(kind='p')


class Doctor(User):
objects = DoctorManager()

class Meta:
proxy = True


class Patient(User):
objects = PatientManager()

class Meta:
proxy = True




Now, my admin has the following code:

# Forms subclassing default auth forms
class DemographicsUserAdmin(reversion.VersionAdmin, UserAdmin):
form = DemographicsUserChangeForm
add_form = DemographicsUserCreationForm

class PatientAdmin(admin.ModelAdmin):
add_form_template = 'admin/auth/user/add_form.html'
form = PatientChangeForm
add_form = PatientCreationForm

def get_queryset(self, request):
return Patient.objects.all()

class DoctorAdmin(admin.ModelAdmin):
add_form_template = 'admin/auth/user/add_form.html'
form = PatientChangeForm
add_form = PatientCreationForm

def get_queryset(self, request):
return Doctor.objects.all()



admin.site.register(User, DemographicsUserAdmin)
admin.site.register(Doctor, DoctorAdmin)
admin.site.register(Patient, PatientAdmin)

--


Now, this would seem to indicate that the proxy model admins would be
filtering only those users with the proper kind. However, not only is
this not happening, but the get_queryset() methods for either admins
is not running, nor the default objects() manager. Any idea why this
would be happening?

Andrés Osinski
http://www.andresosinski.com.ar/

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread Chris Conover
Interesting. Thanks for the rundown. Looking forward to 1.6.

On Tuesday, May 28, 2013 6:40:28 PM UTC-4, akaariai wrote:
>
> On 29 touko, 01:07, Chris Conover  wrote: 
> > Adding commit_unless_managed() before the get() seems to fix the 
> problem. 
> > Looking at it locally, the Gearman worker starts a transactions and just 
> > calls commit when the processing is done, over and over, never starting 
> a 
> > new transaction. That combined with REPEATABLE-READ seems to be the 
> culprit. 
> > 
> > My next step was going to be to set the isolation level to 
> READ-COMMITTED 
> > which would probably have fixed it as well.  Thought I'm not sure how 
> that 
> > would have affected performance. 
> > 
> > Will the changes to transactions in 1.6 possibly address this issue so I 
> > can remove the commit_unless_managed() call? It looks like the major 
> change 
> > is using the underlying database's autocommit mode rather than emulating 
> it 
> > in the ORM. I suppose I'll have to test... 
>
> The thing is Django didn't even emulate the autocommit mode in pre 1.6 
> versions. The behavior in 1.5 is this: 
>   1. Any query will start a transaction (unless of course you are 
> already in transaction) 
>   2. An ORM write will commit after the write is done (but not 
> rollback on exception!) 
>   3. Any other write will not commit 
>
> This is changed to: 
>   1. Any query will happen in autocommit mode - that is there are no 
> user-visible transactions. 
>   2. Some ORM write operations are wrapped in transaction (unless 
> already in transaction). Again, this is not user visible. Reason is 
> that for example multitable save() should be atomic. 
>
> That is, in 1.6 the mode is autocommit with some extra protection for 
> certain ORM write operations. 
>
> Another significant change: In pre 1.6 you can enter transaction block 
> by @commit_on_success. All queries inside the block will be part of 
> the same transaction. The name should be treated literally. If you 
> nest commit_on_success decorators you might get surprising behavior: 
> with commit_on_success: # Starts a transaction 
> with commit_on_success: # Uses the same transaction 
> obj.save() 
> # Second commit_on_success commits on success. Note however that 
> the first commit_on_success started the transaction. 
> otherobj.save() 
> raise Exception("what happens?") 
>
> End situation is that obj.save() was committed, otherobj.save() 
> wasn't. A new transaction was started after the inner 
> commit_on_success block exited. In 99% of cases this isn't what was 
> wanted. 
>
> In 1.6 the code should be converted to: 
> with atomic: # Starts a transaction 
> with atomic: # Creates a savepoint 
> obj.save() 
> # The savepoint is released 
> otherobj.save() 
> raise Exception 
>
> Now, the exception will cause a rollback of the transaction. Both obj 
> and otherobj save are rolled back. 
>
> All in all 1.6 transactions should be a lot easier to understand 
> (there isn't one unless you explicitly asked for a transaction), and 
> the atomic decorator is more powerful than commit_on_success. 
>
> I am not sure if you will need some form of commit in 1.6 before 
> the .get(). It depends on how the code is structured, and what does 
> start the problematic transaction. If the code uses some form of 
> explicit transaction control (commit_on_success, commit_manually) then 
> the autocommit behavior will not be in effect, and you will need 
> manual commit. If autocommit mode is in effect, things should just 
> work. 
>
>  - Anssi 
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




django database cache for longtime?

2013-05-28 Thread kase
i need cache a page  where i'm process a lot information

and i dont wish process again
and  i dont wish keep in memory RAM, (maybe nobody ever review) 

so i wish put this page in a database cache but what can i do for never 
expire?

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread akaariai
On 29 touko, 01:07, Chris Conover  wrote:
> Adding commit_unless_managed() before the get() seems to fix the problem.
> Looking at it locally, the Gearman worker starts a transactions and just
> calls commit when the processing is done, over and over, never starting a
> new transaction. That combined with REPEATABLE-READ seems to be the culprit.
>
> My next step was going to be to set the isolation level to READ-COMMITTED
> which would probably have fixed it as well.  Thought I'm not sure how that
> would have affected performance.
>
> Will the changes to transactions in 1.6 possibly address this issue so I
> can remove the commit_unless_managed() call? It looks like the major change
> is using the underlying database's autocommit mode rather than emulating it
> in the ORM. I suppose I'll have to test...

The thing is Django didn't even emulate the autocommit mode in pre 1.6
versions. The behavior in 1.5 is this:
  1. Any query will start a transaction (unless of course you are
already in transaction)
  2. An ORM write will commit after the write is done (but not
rollback on exception!)
  3. Any other write will not commit

This is changed to:
  1. Any query will happen in autocommit mode - that is there are no
user-visible transactions.
  2. Some ORM write operations are wrapped in transaction (unless
already in transaction). Again, this is not user visible. Reason is
that for example multitable save() should be atomic.

That is, in 1.6 the mode is autocommit with some extra protection for
certain ORM write operations.

Another significant change: In pre 1.6 you can enter transaction block
by @commit_on_success. All queries inside the block will be part of
the same transaction. The name should be treated literally. If you
nest commit_on_success decorators you might get surprising behavior:
with commit_on_success: # Starts a transaction
with commit_on_success: # Uses the same transaction
obj.save()
# Second commit_on_success commits on success. Note however that
the first commit_on_success started the transaction.
otherobj.save()
raise Exception("what happens?")

End situation is that obj.save() was committed, otherobj.save()
wasn't. A new transaction was started after the inner
commit_on_success block exited. In 99% of cases this isn't what was
wanted.

In 1.6 the code should be converted to:
with atomic: # Starts a transaction
with atomic: # Creates a savepoint
obj.save()
# The savepoint is released
otherobj.save()
raise Exception

Now, the exception will cause a rollback of the transaction. Both obj
and otherobj save are rolled back.

All in all 1.6 transactions should be a lot easier to understand
(there isn't one unless you explicitly asked for a transaction), and
the atomic decorator is more powerful than commit_on_success.

I am not sure if you will need some form of commit in 1.6 before
the .get(). It depends on how the code is structured, and what does
start the problematic transaction. If the code uses some form of
explicit transaction control (commit_on_success, commit_manually) then
the autocommit behavior will not be in effect, and you will need
manual commit. If autocommit mode is in effect, things should just
work.

 - Anssi

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




django 1.5 robots.txt

2013-05-28 Thread Wade Williams
http://stackoverflow.com/questions/16802176/django-1-5-robots-txt

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread Chris Conover
Also, thank you Tom, Christian, Christophe, and Anssi for helping me track 
down this problem. Users are now receiving notifications in a timely manner 
because of you.

On Tuesday, May 28, 2013 6:07:22 PM UTC-4, Chris Conover wrote:
>
> Adding commit_unless_managed() before the get() seems to fix the problem. 
> Looking at it locally, the Gearman worker starts a transactions and just 
> calls commit when the processing is done, over and over, never starting a 
> new transaction. That combined with REPEATABLE-READ seems to be the culprit.
>
> My next step was going to be to set the isolation level to READ-COMMITTED 
> which would probably have fixed it as well.  Thought I'm not sure how that 
> would have affected performance.
>
> Will the changes to transactions in 1.6 possibly address this issue so I 
> can remove the commit_unless_managed() call? It looks like the major change 
> is using the underlying database's autocommit mode rather than emulating it 
> in the ORM. I suppose I'll have to test...
>
> On Tuesday, May 28, 2013 5:43:31 PM UTC-4, Chris Conover wrote:
>>
>> I bribed the DBA to turn on the general query log briefly (which 
>> generated 327k logs in 2 minutes and 2 seconds). Looking at the logs, I see 
>> the transaction block for the INSERT. The SELECT is definitely coming after 
>> the COMMIT in a different thread. I'll try the commit_unless_managed fix 
>> quickly and if that doesn't work, I'll post the full query trace.
>>
>> On Tuesday, May 28, 2013 5:27:36 PM UTC-4, akaariai wrote:
>>>
>>> On 28 touko, 22:20, Chris Conover  wrote: 
>>> > Well, you can inspect the object and see it's primary key. Surely that 
>>> > means the INSERT is completed? So the workflow goes like this: 
>>> > 
>>> > foo = Foo() 
>>> > foo.save() 
>>> > foo.pk # new primary key is available 
>>> > submit_gearman_task(foo.pk) 
>>> > 
>>> > Then in the Gearman worker: 
>>> > 
>>> > foo = Foo.objects.get(pk=foo_pk) # this causes a Foo.DoesNotExist 
>>> exception 
>>> > 
>>> > That's what I don't understand. The primary key is assigned and 
>>> available 
>>> > in the application layer in one place but then the lookup using that 
>>> > primary key fails in another place. Maybe it has something to do with 
>>> the 
>>> > fact that the database is set to REPEATABLE-READ isolation level 
>>> versus 
>>> > READ-COMMITTED. Still investigating... 
>>>
>>> Could it be that the Gearman worker is in a transaction? When you 
>>> issue Foo.objects.get(), if the transaction Gearman is in has started 
>>> before the save() you will not see the new object (as MySQL uses 
>>> REPEATABLE READ transaction). 
>>>
>>> Note that any read query will start a transaction implicitly, and ORM 
>>> writes commit implicitly started transaction. You can also use 
>>> connection.commit_unless_managed() to commit implicitly started 
>>> transaction (not part of public API!). So, even if you haven't 
>>> explicitly started any transactions in Gearman worker an earlier read 
>>> query might have started one for you. (If you find this behavior 
>>> confusing this is one of the reasons why transaction handling will be 
>>> changed in Django 1.6). 
>>>
>>> In short: try if connection.commit_unless_managed() before the get() 
>>> changes anything. If so, investigate why there is an ongoing 
>>> transaction in the worker. 
>>>
>>>  - Anssi 
>>>
>>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread Chris Conover
Adding commit_unless_managed() before the get() seems to fix the problem. 
Looking at it locally, the Gearman worker starts a transactions and just 
calls commit when the processing is done, over and over, never starting a 
new transaction. That combined with REPEATABLE-READ seems to be the culprit.

My next step was going to be to set the isolation level to READ-COMMITTED 
which would probably have fixed it as well.  Thought I'm not sure how that 
would have affected performance.

Will the changes to transactions in 1.6 possibly address this issue so I 
can remove the commit_unless_managed() call? It looks like the major change 
is using the underlying database's autocommit mode rather than emulating it 
in the ORM. I suppose I'll have to test...

On Tuesday, May 28, 2013 5:43:31 PM UTC-4, Chris Conover wrote:
>
> I bribed the DBA to turn on the general query log briefly (which generated 
> 327k logs in 2 minutes and 2 seconds). Looking at the logs, I see the 
> transaction block for the INSERT. The SELECT is definitely coming after the 
> COMMIT in a different thread. I'll try the commit_unless_managed fix 
> quickly and if that doesn't work, I'll post the full query trace.
>
> On Tuesday, May 28, 2013 5:27:36 PM UTC-4, akaariai wrote:
>>
>> On 28 touko, 22:20, Chris Conover  wrote: 
>> > Well, you can inspect the object and see it's primary key. Surely that 
>> > means the INSERT is completed? So the workflow goes like this: 
>> > 
>> > foo = Foo() 
>> > foo.save() 
>> > foo.pk # new primary key is available 
>> > submit_gearman_task(foo.pk) 
>> > 
>> > Then in the Gearman worker: 
>> > 
>> > foo = Foo.objects.get(pk=foo_pk) # this causes a Foo.DoesNotExist 
>> exception 
>> > 
>> > That's what I don't understand. The primary key is assigned and 
>> available 
>> > in the application layer in one place but then the lookup using that 
>> > primary key fails in another place. Maybe it has something to do with 
>> the 
>> > fact that the database is set to REPEATABLE-READ isolation level versus 
>> > READ-COMMITTED. Still investigating... 
>>
>> Could it be that the Gearman worker is in a transaction? When you 
>> issue Foo.objects.get(), if the transaction Gearman is in has started 
>> before the save() you will not see the new object (as MySQL uses 
>> REPEATABLE READ transaction). 
>>
>> Note that any read query will start a transaction implicitly, and ORM 
>> writes commit implicitly started transaction. You can also use 
>> connection.commit_unless_managed() to commit implicitly started 
>> transaction (not part of public API!). So, even if you haven't 
>> explicitly started any transactions in Gearman worker an earlier read 
>> query might have started one for you. (If you find this behavior 
>> confusing this is one of the reasons why transaction handling will be 
>> changed in Django 1.6). 
>>
>> In short: try if connection.commit_unless_managed() before the get() 
>> changes anything. If so, investigate why there is an ongoing 
>> transaction in the worker. 
>>
>>  - Anssi 
>>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Kevin
Hello Nik,

  Yes, I can definitely understand the frustrations a PHP developer may 
have when moving away from it.  PHP is very unique in that's it's one of 
the rare web technologies which has a deployment like it does.  The 
original Active Server Pages and CGI also share the same deployment 
scheme.  Usually programming languages which were not originally intended 
for the web use complex deployment structures, as seen with Python, Ruby, 
and ASP.Net.  I am in agreement that deployment shouldn't be difficult.  I 
have successfully deployed many Django powered websites, on private 
servers, and on cloud services such as RedHat OpenShift and 
PythonAnywhere.  Kudos to PythonAnywhere for creating such a remarkable 
service, and their service will definitely be mentioned in the course.  
Originally I was going to focus the course around PythonAnywhere, where 
students would create an account there and do all their development in the 
cloud service.  However, since I wanted to focus on the utter basics of the 
framework for at least the first couple chapters, I thought mentioning this 
service would take time away from actually learning Django.

  Needless to say, there will be at least a couple chapters which provide a 
good basis for a successful deployment and how to troubleshoot issues along 
the way.

Best Regards,
  Kevin Veroneau
  PythonDiary.com

On Tuesday, 28 May 2013 16:37:06 UTC-5, Nikolas Stevenson-Molnar wrote:
>
> Deployment in general is something you should be sure to cover. 
> Especially when people are coming from the PHP world, deployment is 
> quite different. It seems like there are often questions on this list 
> around deployment problems, and they are often fairly trivial issues. 
>
> _Nik 
>
> On 5/28/2013 2:01 PM, Subodh Nijsure wrote: 
> > This is all IMHO. 
> > 
> > One of the thing that has been missing from many django books: 
> > 
> > How do you "marry" the current best practices for --deploying-- large 
> > scale web applications when using django. 
> > 
> > What are the best practices for enabling, monitoring caching? 
> > Implementing search using haystack or some other extensions? 
> > Would be interesting to find out, learn from best practices regarding 
> > how large  software development teams work on django projects. 
> > 
> > -Subodh 
> > 
> > On Tue, May 28, 2013 at 11:34 AM, Kevin  
> wrote: 
> >> Sean, 
> >> 
> >>   Thank you for your input.  Having those types of examples would 
> actually 
> >> be a great idea for the course, as these are some of the most popular 
> >> website being developed in our social web 2.0 these days. 
> >> 
> >>   As for your thought on inputting financial data, I actually built a 
> >> personal financial manager in Django, and Django has the form 
> facilities to 
> >> validate complex financial forms and tell the user to correct any 
> issues 
> >> with their input.  This would actually be a great idea for an example 
> as 
> >> well, since Django manages form validation very well.  I have this 
> personal 
> >> application up on my BitBucket page if you wanted to take a look at it, 
> >> here's a link to the actual app: 
> >> 
> >> 
> https://bitbucket.org/kveroneau/django-pim/src/fffb63b6d03050b30d134bbe39d862e5004a90da/pcbank?at=default
>  
> >> 
> >>   Keep in mind that this app is some of my much earlier work, stuff I 
> built 
> >> when I was first learning the framework.  This was first built on 
> Django 1.2 
> >> I believe, so it still does use function-based generic views.  I do 
> have it 
> >> running currently on a website, and use it all the time to manage my 
> >> personal financial data, such as bills and debt. 
> >> 
> >> 
> >> Best Regards, 
> >>   Kevin Veroneau 
> >>   PythonDiary.com 
> >> 
> >> 
> >> On Tuesday, 28 May 2013 12:29:20 UTC-5, SeanJ wrote: 
> >>> Kevin, 
> >>> 
> >>> Looking forward to what you come up with.  I'd be willing to be a 
> guinea 
> >>> pig for the course. 
> >>> 
> >>> First, I am a hobbyist developer (Java, Groovy/Grails, 
> JS/Jquery/HTML5, 
> >>> PL/SQL, Python/Django), not a pro, and relatively new at it.  My day 
> job is 
> >>> a Software QA Manager for 40,000+ employee ERP Web App. 
> >>> Just for the fun of it I've been exploring Django.  I've been through 
> all 
> >>> the usual places on the web (djangoproject, djangobook, and others, 
> and all 
> >>> the youtube tutorials) and I'm currently redeveloping 2 apps in django 
> that 
> >>> I originally wrote in other languages/frameworks -- just as an 
> exercise to 
> >>> see how django handles them. 
> >>> 
> >>> Second, My 2 cents on your outline and my request for content:  I know 
> >>> with its newsy roots django excels in the blog/wiki/social posting 
> space so 
> >>> there is a bit of glut in the django tutorial world for these types of 
> >>> examples, but I'm coming from a business web perspective and I don't 
> find 
> >>> much out there on incorporating user number input (financial or other 
> 

Bootstrap and Django together at last!

2013-05-28 Thread Kevin
Hello everyone!

  I thought I'd provide a recently released Django app I built.  I have 
listed it on several Django communities including my blog, but I feel it 
would also be great to everyone if I also provide a link here as well.

https://bitbucket.org/kveroneau/django-bootstrap-theme

  Now your wondering, why should you use this?  Well, it's a Django app!  
And it makes integrating Bootstrap into your project super easy.  It comes 
packed with all the Bootstrap example HTML templates in Django template 
format which you can easily extend into your own project.  There is an 
example project to display how this is done as well.  There is also a wide 
variety of templatetags for specifically working with Django templates and 
bootstrap.  Need to add a bunch of stars on a template to display a rating 
for a model?  No problem, there's a template filter for that!  Need to 
create a modal window with as little effort as possible?  Not a problem, 
use the new modal template block tag and your set!  If you've been using 
bootstrap with Django before this, you'll immediately want to convert over 
just because of all the shear helpers included to make using bootstrap in 
Django so much easier and less stressful!

  The documentation is on my blog post announcing the app itself:

http://www.pythondiary.com/blog/May.25,2013/django-bootstrap-theme-ready.html

  It explains all the available "base templates" you can extend, and the 
available templatetags.

Best Regards,
  Kevin Veroneau
  PythonDiary.com

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread Chris Conover
I bribed the DBA to turn on the general query log briefly (which generated 
327k logs in 2 minutes and 2 seconds). Looking at the logs, I see the 
transaction block for the INSERT. The SELECT is definitely coming after the 
COMMIT in a different thread. I'll try the commit_unless_managed fix 
quickly and if that doesn't work, I'll post the full query trace.

On Tuesday, May 28, 2013 5:27:36 PM UTC-4, akaariai wrote:
>
> On 28 touko, 22:20, Chris Conover  wrote: 
> > Well, you can inspect the object and see it's primary key. Surely that 
> > means the INSERT is completed? So the workflow goes like this: 
> > 
> > foo = Foo() 
> > foo.save() 
> > foo.pk # new primary key is available 
> > submit_gearman_task(foo.pk) 
> > 
> > Then in the Gearman worker: 
> > 
> > foo = Foo.objects.get(pk=foo_pk) # this causes a Foo.DoesNotExist 
> exception 
> > 
> > That's what I don't understand. The primary key is assigned and 
> available 
> > in the application layer in one place but then the lookup using that 
> > primary key fails in another place. Maybe it has something to do with 
> the 
> > fact that the database is set to REPEATABLE-READ isolation level versus 
> > READ-COMMITTED. Still investigating... 
>
> Could it be that the Gearman worker is in a transaction? When you 
> issue Foo.objects.get(), if the transaction Gearman is in has started 
> before the save() you will not see the new object (as MySQL uses 
> REPEATABLE READ transaction). 
>
> Note that any read query will start a transaction implicitly, and ORM 
> writes commit implicitly started transaction. You can also use 
> connection.commit_unless_managed() to commit implicitly started 
> transaction (not part of public API!). So, even if you haven't 
> explicitly started any transactions in Gearman worker an earlier read 
> query might have started one for you. (If you find this behavior 
> confusing this is one of the reasons why transaction handling will be 
> changed in Django 1.6). 
>
> In short: try if connection.commit_unless_managed() before the get() 
> changes anything. If so, investigate why there is an ongoing 
> transaction in the worker. 
>
>  - Anssi 
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Nikolas Stevenson-Molnar
Deployment in general is something you should be sure to cover.
Especially when people are coming from the PHP world, deployment is
quite different. It seems like there are often questions on this list
around deployment problems, and they are often fairly trivial issues.

_Nik

On 5/28/2013 2:01 PM, Subodh Nijsure wrote:
> This is all IMHO.
>
> One of the thing that has been missing from many django books:
>
> How do you "marry" the current best practices for --deploying-- large
> scale web applications when using django.
>
> What are the best practices for enabling, monitoring caching?
> Implementing search using haystack or some other extensions?
> Would be interesting to find out, learn from best practices regarding
> how large  software development teams work on django projects.
>
> -Subodh
>
> On Tue, May 28, 2013 at 11:34 AM, Kevin  wrote:
>> Sean,
>>
>>   Thank you for your input.  Having those types of examples would actually
>> be a great idea for the course, as these are some of the most popular
>> website being developed in our social web 2.0 these days.
>>
>>   As for your thought on inputting financial data, I actually built a
>> personal financial manager in Django, and Django has the form facilities to
>> validate complex financial forms and tell the user to correct any issues
>> with their input.  This would actually be a great idea for an example as
>> well, since Django manages form validation very well.  I have this personal
>> application up on my BitBucket page if you wanted to take a look at it,
>> here's a link to the actual app:
>>
>> https://bitbucket.org/kveroneau/django-pim/src/fffb63b6d03050b30d134bbe39d862e5004a90da/pcbank?at=default
>>
>>   Keep in mind that this app is some of my much earlier work, stuff I built
>> when I was first learning the framework.  This was first built on Django 1.2
>> I believe, so it still does use function-based generic views.  I do have it
>> running currently on a website, and use it all the time to manage my
>> personal financial data, such as bills and debt.
>>
>>
>> Best Regards,
>>   Kevin Veroneau
>>   PythonDiary.com
>>
>>
>> On Tuesday, 28 May 2013 12:29:20 UTC-5, SeanJ wrote:
>>> Kevin,
>>>
>>> Looking forward to what you come up with.  I'd be willing to be a guinea
>>> pig for the course.
>>>
>>> First, I am a hobbyist developer (Java, Groovy/Grails, JS/Jquery/HTML5,
>>> PL/SQL, Python/Django), not a pro, and relatively new at it.  My day job is
>>> a Software QA Manager for 40,000+ employee ERP Web App.
>>> Just for the fun of it I've been exploring Django.  I've been through all
>>> the usual places on the web (djangoproject, djangobook, and others, and all
>>> the youtube tutorials) and I'm currently redeveloping 2 apps in django that
>>> I originally wrote in other languages/frameworks -- just as an exercise to
>>> see how django handles them.
>>>
>>> Second, My 2 cents on your outline and my request for content:  I know
>>> with its newsy roots django excels in the blog/wiki/social posting space so
>>> there is a bit of glut in the django tutorial world for these types of
>>> examples, but I'm coming from a business web perspective and I don't find
>>> much out there on incorporating user number input (financial or other
>>> quantity) type data from forms which is then processed through some business
>>> logic in the view and redisplayed for validation by the user before being
>>> comitted to the database for storage.
>>>
>>> Apart from those 2 cents, your outline looks good.  And I think JQuery is
>>> almost as much a part of the finished product as HTML these days.  I think
>>> many will benefit from learning how to incorporate that library.
>>>
>>> Regards,
>>>
>>> Sean
>>>
>>> On Monday, May 27, 2013 3:02:58 PM UTC-7, Kevin wrote:
 Hello everyone!

   It's been quite sometime since I have been on here, well I came back
 with some great news!  I am currently in the process of building an online
 Django web course aimed at both new and old Django developers.  I will be
 charging a minimal fee for access to the entire course, but the first 3
 chapters of the main sections will be free for everyone to read and enjoy.
 The course software itself is built using Django naturally.

   The course software has been completed and uploaded online.  I am now
 in the lengthily process of writing up all the chapters, quizzes, example
 code, and full projects.  This is going to be a large amount of work,
 however at the current moment this is my only job and that is why I am
 planning on charging for admittance.  I am aiming to have a large amount of
 it completed by around the middle of June and ready for public consumption
 shortly after.

   I have decided to give a lucky few free access to the entire course for
 the purpose of reviewing and providing me with feedback.  If you are
 interested, please reply back to me and explain why I should 

Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Kevin
Hello Subodh,

  Thank you for your input.  I actually have a large amount of knowledge in 
caching with Django, and all my Django powered sites using caching in some 
form or another.  There is an entire section devoted to caching, and if any 
indicator on how long I made Chapter 1 and how long Chapter 2 is going to 
be...  I am sure the caching chapter will be nothing short than thorough.  
There are so many ways you can use caching in Django, and most people don't 
understand which method to use when, and a large amount of developers don't 
even know how to "uncache" template fragments, which will also be shown in 
the course.  I use template fragment caching in lots of website, but how 
does one uncache them after a model has been updated?  I'll be showing this 
awesome secret in the course.  It's something every Django developer should 
know, as it creates a very optimal and high speed application.  I strive to 
hit the database as little as possible, I monitor the amount of SQL queries 
using the infamous Django Debug Toolbar(which will also be mentioned in the 
course).  I will also be going through the steps I use to create a Django 
website, what I start with, and what I do closer to actual deployment, and 
how I test various functions before deployment.

  My Uarica project actually uses Haystack, and I have experience in that 
too.

  The chapter on Revision Systems will cover all the popular SCM software 
and the pros and cons when using them in a "team environment", so you'll be 
covered there as well.  I am trying to make this course as extensive as 
possible, covering many aspects which other tutorials or books either don't 
cover at all, or just get your toe wet for a page.  This course has entire 
chapters dedicated to using a single app, and to integrate it into your 
overall Django website.  It's definitely going to be worth the price of 
admission, and should prove useful to both seasoned vets and novices alike.

  I do plan on having many chapters on different deployment methods, one 
chapter which will be there for sure is deployment using uWSGI, as it is 
gaining popularity and it is also my deployment method of choice.  uWSGI 
has lots of potential and can scale up Django websites with ease.  
Unfortunately this tool isn't expressed much on many Django tutorials and 
books, so many people do not understand how to use it's numerous amount of 
options to deploy a successful multi-tier Django server farm.

Best Regards,
  Kevin Veroneau
  PythonDiary.com

On Tuesday, 28 May 2013 16:01:23 UTC-5, Subodh Nijsure wrote:
>
> This is all IMHO. 
>
> One of the thing that has been missing from many django books: 
>
> How do you "marry" the current best practices for --deploying-- large 
> scale web applications when using django. 
>
> What are the best practices for enabling, monitoring caching? 
> Implementing search using haystack or some other extensions? 
> Would be interesting to find out, learn from best practices regarding 
> how large  software development teams work on django projects. 
>
> -Subodh 
>
> On Tue, May 28, 2013 at 11:34 AM, Kevin  
> wrote: 
> > Sean, 
> > 
> >   Thank you for your input.  Having those types of examples would 
> actually 
> > be a great idea for the course, as these are some of the most popular 
> > website being developed in our social web 2.0 these days. 
> > 
> >   As for your thought on inputting financial data, I actually built a 
> > personal financial manager in Django, and Django has the form facilities 
> to 
> > validate complex financial forms and tell the user to correct any issues 
> > with their input.  This would actually be a great idea for an example as 
> > well, since Django manages form validation very well.  I have this 
> personal 
> > application up on my BitBucket page if you wanted to take a look at it, 
> > here's a link to the actual app: 
> > 
> > 
> https://bitbucket.org/kveroneau/django-pim/src/fffb63b6d03050b30d134bbe39d862e5004a90da/pcbank?at=default
>  
> > 
> >   Keep in mind that this app is some of my much earlier work, stuff I 
> built 
> > when I was first learning the framework.  This was first built on Django 
> 1.2 
> > I believe, so it still does use function-based generic views.  I do have 
> it 
> > running currently on a website, and use it all the time to manage my 
> > personal financial data, such as bills and debt. 
> > 
> > 
> > Best Regards, 
> >   Kevin Veroneau 
> >   PythonDiary.com 
> > 
> > 
> > On Tuesday, 28 May 2013 12:29:20 UTC-5, SeanJ wrote: 
> >> 
> >> Kevin, 
> >> 
> >> Looking forward to what you come up with.  I'd be willing to be a 
> guinea 
> >> pig for the course. 
> >> 
> >> First, I am a hobbyist developer (Java, Groovy/Grails, JS/Jquery/HTML5, 
> >> PL/SQL, Python/Django), not a pro, and relatively new at it.  My day 
> job is 
> >> a Software QA Manager for 40,000+ employee ERP Web App. 
> >> Just for the fun of it I've been exploring Django.  I've been through 

Re: Object Lookup after Save

2013-05-28 Thread akaariai
On 28 touko, 22:20, Chris Conover  wrote:
> Well, you can inspect the object and see it's primary key. Surely that
> means the INSERT is completed? So the workflow goes like this:
>
> foo = Foo()
> foo.save()
> foo.pk # new primary key is available
> submit_gearman_task(foo.pk)
>
> Then in the Gearman worker:
>
> foo = Foo.objects.get(pk=foo_pk) # this causes a Foo.DoesNotExist exception
>
> That's what I don't understand. The primary key is assigned and available
> in the application layer in one place but then the lookup using that
> primary key fails in another place. Maybe it has something to do with the
> fact that the database is set to REPEATABLE-READ isolation level versus
> READ-COMMITTED. Still investigating...

Could it be that the Gearman worker is in a transaction? When you
issue Foo.objects.get(), if the transaction Gearman is in has started
before the save() you will not see the new object (as MySQL uses
REPEATABLE READ transaction).

Note that any read query will start a transaction implicitly, and ORM
writes commit implicitly started transaction. You can also use
connection.commit_unless_managed() to commit implicitly started
transaction (not part of public API!). So, even if you haven't
explicitly started any transactions in Gearman worker an earlier read
query might have started one for you. (If you find this behavior
confusing this is one of the reasons why transaction handling will be
changed in Django 1.6).

In short: try if connection.commit_unless_managed() before the get()
changes anything. If so, investigate why there is an ongoing
transaction in the worker.

 - Anssi

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Subodh Nijsure
This is all IMHO.

One of the thing that has been missing from many django books:

How do you "marry" the current best practices for --deploying-- large
scale web applications when using django.

What are the best practices for enabling, monitoring caching?
Implementing search using haystack or some other extensions?
Would be interesting to find out, learn from best practices regarding
how large  software development teams work on django projects.

-Subodh

On Tue, May 28, 2013 at 11:34 AM, Kevin  wrote:
> Sean,
>
>   Thank you for your input.  Having those types of examples would actually
> be a great idea for the course, as these are some of the most popular
> website being developed in our social web 2.0 these days.
>
>   As for your thought on inputting financial data, I actually built a
> personal financial manager in Django, and Django has the form facilities to
> validate complex financial forms and tell the user to correct any issues
> with their input.  This would actually be a great idea for an example as
> well, since Django manages form validation very well.  I have this personal
> application up on my BitBucket page if you wanted to take a look at it,
> here's a link to the actual app:
>
> https://bitbucket.org/kveroneau/django-pim/src/fffb63b6d03050b30d134bbe39d862e5004a90da/pcbank?at=default
>
>   Keep in mind that this app is some of my much earlier work, stuff I built
> when I was first learning the framework.  This was first built on Django 1.2
> I believe, so it still does use function-based generic views.  I do have it
> running currently on a website, and use it all the time to manage my
> personal financial data, such as bills and debt.
>
>
> Best Regards,
>   Kevin Veroneau
>   PythonDiary.com
>
>
> On Tuesday, 28 May 2013 12:29:20 UTC-5, SeanJ wrote:
>>
>> Kevin,
>>
>> Looking forward to what you come up with.  I'd be willing to be a guinea
>> pig for the course.
>>
>> First, I am a hobbyist developer (Java, Groovy/Grails, JS/Jquery/HTML5,
>> PL/SQL, Python/Django), not a pro, and relatively new at it.  My day job is
>> a Software QA Manager for 40,000+ employee ERP Web App.
>> Just for the fun of it I've been exploring Django.  I've been through all
>> the usual places on the web (djangoproject, djangobook, and others, and all
>> the youtube tutorials) and I'm currently redeveloping 2 apps in django that
>> I originally wrote in other languages/frameworks -- just as an exercise to
>> see how django handles them.
>>
>> Second, My 2 cents on your outline and my request for content:  I know
>> with its newsy roots django excels in the blog/wiki/social posting space so
>> there is a bit of glut in the django tutorial world for these types of
>> examples, but I'm coming from a business web perspective and I don't find
>> much out there on incorporating user number input (financial or other
>> quantity) type data from forms which is then processed through some business
>> logic in the view and redisplayed for validation by the user before being
>> comitted to the database for storage.
>>
>> Apart from those 2 cents, your outline looks good.  And I think JQuery is
>> almost as much a part of the finished product as HTML these days.  I think
>> many will benefit from learning how to incorporate that library.
>>
>> Regards,
>>
>> Sean
>>
>> On Monday, May 27, 2013 3:02:58 PM UTC-7, Kevin wrote:
>>>
>>> Hello everyone!
>>>
>>>   It's been quite sometime since I have been on here, well I came back
>>> with some great news!  I am currently in the process of building an online
>>> Django web course aimed at both new and old Django developers.  I will be
>>> charging a minimal fee for access to the entire course, but the first 3
>>> chapters of the main sections will be free for everyone to read and enjoy.
>>> The course software itself is built using Django naturally.
>>>
>>>   The course software has been completed and uploaded online.  I am now
>>> in the lengthily process of writing up all the chapters, quizzes, example
>>> code, and full projects.  This is going to be a large amount of work,
>>> however at the current moment this is my only job and that is why I am
>>> planning on charging for admittance.  I am aiming to have a large amount of
>>> it completed by around the middle of June and ready for public consumption
>>> shortly after.
>>>
>>>   I have decided to give a lucky few free access to the entire course for
>>> the purpose of reviewing and providing me with feedback.  If you are
>>> interested, please reply back to me and explain why I should select you.  I
>>> will then select 5 lucky individuals and email them their access credentials
>>> and a link to the actual course's website when it's ready.
>>>
>>>   Here's a little background information about myself, since I haven't
>>> been on here recently.  I am the current maintainer and author of
>>> PythonDiary.com, which has been a relatively successful Python blog since
>>> January of 2012.  Over 500 

Re: need immediate help setting up Apache

2013-05-28 Thread Rafael E. Ferrero
Ok, Tell me if works... of course are a better way to do this... something
like that work to me. www.fsorgosuardi.com.ar its an example of that


2013/5/28 John Fabiani 

>  Thanks I'll try it.
> Johnf
>
> On 05/28/2013 08:21 AM, Rafael E. Ferrero wrote:
>
> and here is an example of a django.wsgi file
>
> import os
> import sys
>
> path = '/path/to/your/project/'
> if path not in sys.path:
> sys.path.append(path)
>
> os.environ['DJANGO_SETTINGS_MODULE'] = 'yourproject.settings'
>
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
>
>
>
>
> 2013/5/28 Rafael E. Ferrero 
>
>>   First... configure Bind2 (or your DNS to support your domain)
>>  Second configure a Virtual Host for your domain (supoust that you use
>> wsgi)
>>  Here is an example:
>>
>> 
>> DocumentRoot /var/www/yourdomain.com
>> ServerName yourdomain.com.ar
>> ServerAlias www.yourdomain.com.
>> ServerAdmin youru...@yourdomain.com
>>
>> ErrorLog ${APACHE_LOG_DIR}/error.log
>> CustomLog ${APACHE_LOG_DIR}/access.log combined
>>
>> WSGIDaemonProcess yourdomain.com processes=2 threads=15
>> display-name=%{GROUP}
>> WSGIProcessGroup yourdomain.com
>>  #here i say: for all request call to django.wsgi
>> WSGIScriptAlias / /path/to/django.wsgi
>>
>> Alias /media/ /path/to/your/project/and/to/your/media/
>> Alias /static/admin/  /path/to/your/project/and/to/your/static/admin/
>>
>> 
>> Options FollowSymLinks -Indexes
>> AllowOverride None
>> 
>> 
>>
>>
>>
>> 2013/5/28 John Fabiani 
>>
>>>  Yes I have complete control.  But I don't know how to set it up.
>>> Johnf
>>>
>>> On 05/28/2013 07:39 AM, Rafael E. Ferrero wrote:
>>>
>>>  you have access to config files of apache ?? like site-available/
>>> yoursite.com to set your virtuals hosts ??
>>>
>>>
>>>  2013/5/28 John Fabiani 
>>>
 Hi Folks,
 I need immediate help setting up Apache on an openSUSE 12.3.  I'm
 willing to pay a little for the help.
 Currently I have my scripts working using manage.py runserver.  But I
 don't understand what I need to do with Apache.  I have to get website up
 today.
 I will also have to setup the delivery port to 443.

 Contact me via this list.

 Thanks in advance,

 Johnf

 --
 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 http://groups.google.com/group/django-users?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.



>>>
>>>
>>> --
>>> Rafael E. Ferrero
>>> Claro: (03562) 15514856
>>> --
>>> 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 http://groups.google.com/group/django-users?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>>
>>>--
>>> 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 http://groups.google.com/group/django-users?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>
>>
>> --
>> Rafael E. Ferrero
>> Claro: (03562) 15514856
>>
>
>
>
> --
> Rafael E. Ferrero
> Claro: (03562) 15514856
> --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>  --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Rafael E. Ferrero
Claro: (03562) 15514856

-- 
You received this message because you are subscribed to the Google 

Re: Object Lookup after Save

2013-05-28 Thread Christophe Pettus
Well, Django works. :)  I'd strongly suggest examining the data at the database 
layer to see if you are getting the interaction with the database you expect; 
you might try bringing it up in a test environment and see if you can reproduce 
it there.

On May 28, 2013, at 1:45 PM, Chris Conover wrote:

> No, we are not using the TransactionMiddleware. We are using the following 
> Django middlewares: CommonMiddleware, SessionMiddleware, MessageMiddleware, 
> and XFrameOptionsMiddleware. We have a few custom middlewares which handle 
> stuff for the edge caching. Nothing that produces any writes to MySQL. We are 
> also using Django Reversion which has a middleware. I'm looking at the 
> underlying code of that middleware to see if that would cause an issue. The 
> model that is being saved and submitted to the background task is not under 
> revision control.
> 
> On Tuesday, May 28, 2013 4:31:08 PM UTC-4, Christophe Pettus wrote:
> 
> On May 28, 2013, at 1:26 PM, Chris Conover wrote: 
> 
> > # no middleware that does any writes 
> 
> Are you using the Transaction Middleware? 
> 
> -- 
> -- Christophe Pettus 
>x...@thebuild.com 
> 
> 
> -- 
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

--
-- Christophe Pettus
   x...@thebuild.com

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Brian Williams
Kevin,

Sounds like a great idea.  Wish you the best of luck.

I would be willing to give you a hand if you want the perspective of a 
complete novice.  I am just learning Django and am not far beyond the docs 
tutorial.

Brian

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread Chris Conover
No, we are not using the TransactionMiddleware. We are using the following 
Django middlewares: CommonMiddleware, SessionMiddleware, MessageMiddleware, 
and XFrameOptionsMiddleware. We have a few custom middlewares which handle 
stuff for the edge caching. Nothing that produces any writes to MySQL. We 
are also using Django Reversion which has a middleware. I'm looking at the 
underlying code of that middleware to see if that would cause an issue. The 
model that is being saved and submitted to the background task is not under 
revision control.

On Tuesday, May 28, 2013 4:31:08 PM UTC-4, Christophe Pettus wrote:
>
>
> On May 28, 2013, at 1:26 PM, Chris Conover wrote: 
>
> > # no middleware that does any writes 
>
> Are you using the Transaction Middleware? 
>
> -- 
> -- Christophe Pettus 
>x...@thebuild.com  
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread Christophe Pettus

On May 28, 2013, at 1:26 PM, Chris Conover wrote:

> # no middleware that does any writes

Are you using the Transaction Middleware?

--
-- Christophe Pettus
   x...@thebuild.com

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: steps to connect as client to a tcp/ip server

2013-05-28 Thread andrea mucci
Hi Chiara

The best solution is make two different projects
one is your socket server and the other is the Django project.
is not a good idea connect with socket directly to Django, this will be cause 
some large delays and in case of connection fails?
what is the timeout of the socket connection?
is the same of dingo app?

The solutions will be, for example
django
celery
socket server

django is independently and the models are updated from celery workers
http://www.celeryproject.org/
this is the link of celery, is not so much easy but you can send some emails in 
this group and i'm sure that someone is ready to help you

have a nice day
El 27/05/2013, a las 14:14, chi...@tecnoelettricabrianza.it escribió:

> Hi there, I'm a really newbye, I've followed the polls tutorial.
>  I'm looking for a way to dinamically create web-pages that will send and 
> receive message to a TCP/Ip server that use a custom protocol for 
> communication.
> I've got the python code that handle the communication and I kindly ask you 
> some advice on the right way to do it:
> 
> 1)create a model with the fields of data to be sent and received from server
> 2)create in the view: 1) function that handle the connection
>  2) function that send data
>  3) function that receive data
> 3) create a template with model's fields
> 
> Is this right?
> 
> Below the python code that is now standalone and working to connect to server.
> 
> 
> #Socket client in python
> 
> import socket   #for sockets
> import sys  #for exit
> 
> #create an INET, STREAMing socket
> try:
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> except socket.error:
> print 'Failed to create socket'
> sys.exit()
> 
> print 'Socket Created'
> 
> host = '192.168.1.1';
> port = 35000;
> 
> try:
> remote_ip = socket.gethostbyname( host )
> 
> except socket.gaierror:
> #could not resolve
> print 'Hostname could not be resolved. Exiting'
> sys.exit()
> 
> #Connect to remote server
> s.connect((remote_ip , port))
> 
> print 'Socket Connected to ' + host + ' on ip ' + remote_ip
> 
> ## SEND DATA
> message = "GET / HTTP/1.1\r\n\r\n"
> 
> try :
> #Set the whole string
> s.sendall(message)
> except socket.error:
> #Send failed
> print 'Send failed'
> sys.exit()
> 
> print 'Message send successfully'
> 
> #RECEIVE DATA
> reply = s.recv(4096)
> 
> print reply
> 
> s.close()
> 
> 
> Please let me know about it. Thanks. BR. 
> 
> -- 
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread Chris Conover
I will enable to general query log tonight once the load tapers off and see 
what's happening. I must say that the opacity of this transaction stuff is 
pretty frustrating. I don't understand how there can be an enclosing 
transaction for such a simple view. The view is pretty much:

# no middleware that does any writes
# no decorators
def view(request, param):
  # do some checking, no writes here
  foo = Foo(user=request.user, param=param)
  foo.save()
  submit_background_task(foo.pk)
  messages.success(request, "success message")
  return HttpResponseRedirect

Before now, I assumed the foo.save() was a _blocking_ operation that did 
the following:

START TRANSACTION;
INSERT INTO TABLE foo(user_id, param) VALUES (?, ?);
COMMIT;

Which would allow you at any time, even 1 millisecond, after the save() to 
do the following and lookup the record:

SELECT * FROM foo WHERE id=;

Isolation levels or whatever shouldn't matter in my mind, the SELECT is 
happening after the COMMIT. Do any of those assumptions strike you as wrong?

Chris

On Tuesday, May 28, 2013 3:43:38 PM UTC-4, Christophe Pettus wrote:
>
>
> On May 28, 2013, at 12:20 PM, Chris Conover wrote: 
>
> > Well, you can inspect the object and see it's primary key. Surely that 
> means the INSERT is completed? 
>
> That shows the INSERT is completed, but it doesn't show that any enclosing 
> transaction has committed; that's what the database logs will show you. 
>  It's very unlikely that this is a bug in Django or MySQL; those are very 
> well-trod paths in those two applications. 
>
> -- 
> -- Christophe Pettus 
>x...@thebuild.com  
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Selecting site in admin

2013-05-28 Thread Mário Neto
Do you can this in your template


2013/5/28 Victor 

> As a newbye I'm happily using admin.
>
> Now I would like to select what a user can see in the admin main page
> according to its username just as a (non-working) example I would like to
> follow this idea
>
> in admin.py
>
> if request.user=='victor':
>   admin.site.register(Categorie)
>   admin.site.register(Codiciiva)
>   admin.site.register(Magazzini)
> else:
>   admin.site.register(Marca)
>   admin.site.register(Fornitori,FornitoriOption)
>   admin.site.register(Pazienti,PazientiOption)
>   admin.site.register(unita_misura)
>
> How can I do this?
>
> Ciao
> Vittorio
>
> --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
*
*MBA in Design Digital* - 2008 - FIC
*Analysis and Systems Development* - 2011 - Estácio
*D**esign and Implementation of Internet Environments* - 2003 - FIC

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread Christophe Pettus

On May 28, 2013, at 12:20 PM, Chris Conover wrote:

> Well, you can inspect the object and see it's primary key. Surely that means 
> the INSERT is completed? 

That shows the INSERT is completed, but it doesn't show that any enclosing 
transaction has committed; that's what the database logs will show you.  It's 
very unlikely that this is a bug in Django or MySQL; those are very well-trod 
paths in those two applications.

--
-- Christophe Pettus
   x...@thebuild.com

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Selecting site in admin

2013-05-28 Thread Victor
As a newbye I'm happily using admin.

Now I would like to select what a user can see in the admin main page according 
to its username just as a (non-working) example I would like to follow this idea

in admin.py

if request.user=='victor':
  admin.site.register(Categorie)
  admin.site.register(Codiciiva)
  admin.site.register(Magazzini)
else:
  admin.site.register(Marca)
  admin.site.register(Fornitori,FornitoriOption)
  admin.site.register(Pazienti,PazientiOption)
  admin.site.register(unita_misura)

How can I do this?

Ciao
Vittorio

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread Chris Conover
Well, you can inspect the object and see it's primary key. Surely that 
means the INSERT is completed? So the workflow goes like this:

foo = Foo()
foo.save()
foo.pk # new primary key is available
submit_gearman_task(foo.pk)

Then in the Gearman worker:

foo = Foo.objects.get(pk=foo_pk) # this causes a Foo.DoesNotExist exception

That's what I don't understand. The primary key is assigned and available 
in the application layer in one place but then the lookup using that 
primary key fails in another place. Maybe it has something to do with the 
fact that the database is set to REPEATABLE-READ isolation level versus 
READ-COMMITTED. Still investigating...


On Tuesday, May 28, 2013 1:57:03 PM UTC-4, Christophe Pettus wrote:
>
> I'll admit my MySQL skills are a bit rusty, but can you examine the 
> database logs to confirm that the session is in fact doing the INSERT and a 
> commit before the SELECT?
>
> On May 28, 2013, at 10:52, Chris Conover  
> wrote:
>
> It's not really feasible to move this project to PostgreSQL.
>
> I honestly just don't understand the problem. According to the Django 
> documentation, the ORM functions in autocommit mode by default. In other 
> words, the changes should be committed as soon as the query is complete, 
> right? So after an INSERT, you should be able to do a SELECT and the data 
> should be available. In the code written, the SELECT is definitely coming 
> after the INSERT. The code is not complex. I'm setting up a local test to 
> simulate the load on the production system to see if I can reproduce the 
> issue.
>
> On Tuesday, May 28, 2013 1:33:10 PM UTC-4, Christophe Pettus wrote:
>>
>> In the meantime, you can use this:
>>
>> https://github.com/Xof/xact
>>
>> On May 28, 2013, at 10:29, Chris Conover  wrote:
>>
>> That seems to only be available in the dev version of Django (now 1.6 
>> alpha).
>>
>> On Wednesday, May 22, 2013 4:43:29 AM UTC-4, Christian Schmitt wrote:
>>>
>>> if you want transactions you need to do :
>>>
>>> with transaction.atomic():
>>>
>>>
>>> like described here: 
>>> https://docs.djangoproject.com/en/dev/topics/db/transactions/
>>>
>>> Am Mittwoch, 22. Mai 2013 10:40:15 UTC+2 schrieb Christian Schmitt:

 In Django the normal behavior should be that when you do a save() it 
 will automatically commit() your query's to the database.
 so that in obj.save() you should just could access the pk with obj.idafter 
 you did a obj.save().
 If you want to maybe stop the commit you need to do a obj = 
 obj.save(commit=False), then you could add some things to your obj and 
 commit/save it later.
 But as i understood you already do a obj.save() but it doesn't commit 
 correctly? Maybe you should just try a PostgreSQL database for testing, 
 since I'm not having trouble looking up objects after i saved it.

 I often do things like:
 obj.save()
 return HttpResponseRedirect(reverse('view', {'pk': obj.id}))
 and i never run into any exception


 Am Dienstag, 21. Mai 2013 23:20:53 UTC+2 schrieb Chris Conover:
>
> Calling transaction.commit() after object.save results in 
> a TransactionManagementError. I mentioned at the end that I am using 
> MySQL 
> (5.5.27). The issue is not that the Gearman workers are having trouble 
> saving their transactions, it's that they are having trouble looking up 
> the 
> incoming object. I'm assuming the view and workers are separate 
> transactions since I don't see how they could be connected -- though I'm 
> looking into this. 
>
> On Tuesday, May 21, 2013 1:05:54 PM UTC-4, Tom Evans wrote:
>>
>> On Tue, May 21, 2013 at 4:23 PM, Chris Conover  
>> wrote: 
>> > Hello, 
>> > 
>> > I'm having an issue looking up objects immediately after they are 
>> saved and 
>> > am wondering if anyone has any advice on how to address the 
>> problem. 
>> > Specifically, I'm saving an object in a view (nothing fancy, a 
>> simple 
>> > save()) and then kicking off a Gearman task to do some operations 
>> on that 
>> > saved object in the background. I pass the newly created object's 
>> PK as data 
>> > to the Gearman worker which then does a simple 
>> Objects.objects.get(pk=PK). 
>> > However, almost all of the time this lookup operation fails with an 
>> > DoesNotExist exception. I believe the problem has to do with 
>> transactions. 
>> > Namely, the read in the Gearman worker is happening before the 
>> write from 
>> > the view is committed to the database. I've tried several things 
>> including 
>> > refactoring the saving code to be wrapped in a 
>> > @transaction.commit_on_success block, moving the worker submission 
>> to 
>> > post_save and adding a long delay before the Gearman worker does 
>> the lookup. 
>> > Nothing really 

Re: need immediate help setting up Apache

2013-05-28 Thread John Fabiani

Thanks I'll try it.
Johnf
On 05/28/2013 08:21 AM, Rafael E. Ferrero wrote:

and here is an example of a django.wsgi file

import os
import sys

path = '/path/to/your/project/'
if path not in sys.path:
 sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'yourproject.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()



2013/5/28 Rafael E. Ferrero >


First... configure Bind2 (or your DNS to support your domain)
Second configure a Virtual Host for your domain (supoust that you
use wsgi)
Here is an example:


DocumentRoot /var/www/yourdomain.com 
ServerName yourdomain.com.ar 
ServerAlias www.yourdomain.com .
ServerAdmin youru...@yourdomain.com 

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

WSGIDaemonProcess yourdomain.com 
processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup yourdomain.com 
#here i say: for all request call to django.wsgi
WSGIScriptAlias / /path/to/django.wsgi

Alias /media/ /path/to/your/project/and/to/your/media/
Alias /static/admin/ /path/to/your/project/and/to/your/static/admin/

http://yourdomain.com>>
Options FollowSymLinks -Indexes
AllowOverride None





2013/5/28 John Fabiani >

Yes I have complete control.  But I don't know how to set it up.
Johnf

On 05/28/2013 07:39 AM, Rafael E. Ferrero wrote:

you have access to config files of apache ?? like
site-available/yoursite.com  to set your
virtuals hosts ??


2013/5/28 John Fabiani >

Hi Folks,
I need immediate help setting up Apache on an openSUSE
12.3.  I'm willing to pay a little for the help.
Currently I have my scripts working using manage.py
runserver.  But I don't understand what I need to do with
Apache.  I have to get website up today.
I will also have to setup the delivery port to 443.

Contact me via this list.

Thanks in advance,

Johnf

-- 
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
http://groups.google.com/group/django-users?hl=en.
For more options, visit
https://groups.google.com/groups/opt_out.





-- 
Rafael E. Ferrero

Claro: (03562) 15514856
-- 
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
http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




-- 
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
http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.





-- 
Rafael E. Ferrero

Claro: (03562) 15514856




--
Rafael E. Ferrero
Claro: (03562) 15514856
--
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 http://groups.google.com/group/django-users?hl=en.
For more 

Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Kevin
Sean,

  Thank you for your input.  Having those types of examples would actually 
be a great idea for the course, as these are some of the most popular 
website being developed in our social web 2.0 these days.

  As for your thought on inputting financial data, I actually built a 
personal financial manager in Django, and Django has the form facilities to 
validate complex financial forms and tell the user to correct any issues 
with their input.  This would actually be a great idea for an example as 
well, since Django manages form validation very well.  I have this personal 
application up on my BitBucket page if you wanted to take a look at it, 
here's a link to the actual app:

https://bitbucket.org/kveroneau/django-pim/src/fffb63b6d03050b30d134bbe39d862e5004a90da/pcbank?at=default

  Keep in mind that this app is some of my much earlier work, stuff I built 
when I was first learning the framework.  This was first built on Django 
1.2 I believe, so it still does use function-based generic views.  I do 
have it running currently on a website, and use it all the time to manage 
my personal financial data, such as bills and debt.

Best Regards,
  Kevin Veroneau
  PythonDiary.com


On Tuesday, 28 May 2013 12:29:20 UTC-5, SeanJ wrote:
>
> Kevin,
>  
> Looking forward to what you come up with.  I'd be willing to be a guinea 
> pig for the course.
>  
> First, I am a hobbyist developer (Java, Groovy/Grails, JS/Jquery/HTML5, 
> PL/SQL, Python/Django), not a pro, and relatively new at it.  My day job is 
> a Software QA Manager for 40,000+ employee ERP Web App.
> Just for the fun of it I've been exploring Django.  I've been through all 
> the usual places on the web (djangoproject, djangobook, and others, and all 
> the youtube tutorials) and I'm currently redeveloping 2 apps in django that 
> I originally wrote in other languages/frameworks -- just as an exercise to 
> see how django handles them.
>  
> Second, My 2 cents on your outline and my request for content:  I know 
> with its newsy roots django excels in the blog/wiki/social posting space so 
> there is a bit of glut in the django tutorial world for these types of 
> examples, but I'm coming from a business web perspective and I don't find 
> much out there on incorporating user number input (financial or other 
> quantity) type data from forms which is then processed through some 
> business logic in the view and redisplayed for validation by the user 
> before being comitted to the database for storage.
>  
> Apart from those 2 cents, your outline looks good.  And I think JQuery is 
> almost as much a part of the finished product as HTML these days.  I think 
> many will benefit from learning how to incorporate that library.
>  
> Regards,
>  
> Sean
>  
> On Monday, May 27, 2013 3:02:58 PM UTC-7, Kevin wrote:
>
>> Hello everyone!
>>
>>   It's been quite sometime since I have been on here, well I came back 
>> with some great news!  I am currently in the process of building an online 
>> Django web course aimed at both new and old Django developers.  I will be 
>> charging a minimal fee for access to the entire course, but the first 3 
>> chapters of the main sections will be free for everyone to read and enjoy.  
>> The course software itself is built using Django naturally.
>>
>>   The course software has been completed and uploaded online.  I am now 
>> in the lengthily process of writing up all the chapters, quizzes, example 
>> code, and full projects.  This is going to be a large amount of work, 
>> however at the current moment this is my only job and that is why I am 
>> planning on charging for admittance.  I am aiming to have a large amount of 
>> it completed by around the middle of June and ready for public consumption 
>> shortly after.
>>
>>   I have decided to give a lucky few free access to the entire course for 
>> the purpose of reviewing and providing me with feedback.  If you are 
>> interested, please reply back to me and explain why I should select you.  I 
>> will then select 5 lucky individuals and email them their access 
>> credentials and a link to the actual course's website when it's ready.
>>
>>   Here's a little background information about myself, since I haven't 
>> been on here recently.  I am the current maintainer and author of 
>> PythonDiary.com, which has been a relatively successful Python blog since 
>> January of 2012.  Over 500 users visit the blog each day, and if a new 
>> article is available this amount can increase to over 1,000 hits.  Many of 
>> my articles and tutorials are related to Django, and most of my user base 
>> uses Django or wants to learn it.  I have received many requests from users 
>> to expand on my Django tutorials, however I lack the personal time required 
>> to write these articles.  To that affect, I have ultimately decided to 
>> create an entire Django web-based course for a very low cost.  The cost is 
>> much cheaper than a typical Django book available today and will 

Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread SeanJ
Kevin,
 
Looking forward to what you come up with.  I'd be willing to be a guinea 
pig for the course.
 
First, I am a hobbyist developer (Java, Groovy/Grails, JS/Jquery/HTML5, 
PL/SQL, Python/Django), not a pro, and relatively new at it.  My day job is 
a Software QA Manager for 40,000+ employee ERP Web App.
Just for the fun of it I've been exploring Django.  I've been through all 
the usual places on the web (djangoproject, djangobook, and others, and all 
the youtube tutorials) and I'm currently redeveloping 2 apps in django that 
I originally wrote in other languages/frameworks -- just as an exercise to 
see how django handles them.
 
Second, My 2 cents on your outline and my request for content:  I know with 
its newsy roots django excels in the blog/wiki/social posting space so 
there is a bit of glut in the django tutorial world for these types of 
examples, but I'm coming from a business web perspective and I don't find 
much out there on incorporating user number input (financial or other 
quantity) type data from forms which is then processed through some 
business logic in the view and redisplayed for validation by the user 
before being comitted to the database for storage.
 
Apart from those 2 cents, your outline looks good.  And I think JQuery is 
almost as much a part of the finished product as HTML these days.  I think 
many will benefit from learning how to incorporate that library.
 
Regards,
 
Sean
 
On Monday, May 27, 2013 3:02:58 PM UTC-7, Kevin wrote:

> Hello everyone!
>
>   It's been quite sometime since I have been on here, well I came back 
> with some great news!  I am currently in the process of building an online 
> Django web course aimed at both new and old Django developers.  I will be 
> charging a minimal fee for access to the entire course, but the first 3 
> chapters of the main sections will be free for everyone to read and enjoy.  
> The course software itself is built using Django naturally.
>
>   The course software has been completed and uploaded online.  I am now in 
> the lengthily process of writing up all the chapters, quizzes, example 
> code, and full projects.  This is going to be a large amount of work, 
> however at the current moment this is my only job and that is why I am 
> planning on charging for admittance.  I am aiming to have a large amount of 
> it completed by around the middle of June and ready for public consumption 
> shortly after.
>
>   I have decided to give a lucky few free access to the entire course for 
> the purpose of reviewing and providing me with feedback.  If you are 
> interested, please reply back to me and explain why I should select you.  I 
> will then select 5 lucky individuals and email them their access 
> credentials and a link to the actual course's website when it's ready.
>
>   Here's a little background information about myself, since I haven't 
> been on here recently.  I am the current maintainer and author of 
> PythonDiary.com, which has been a relatively successful Python blog since 
> January of 2012.  Over 500 users visit the blog each day, and if a new 
> article is available this amount can increase to over 1,000 hits.  Many of 
> my articles and tutorials are related to Django, and most of my user base 
> uses Django or wants to learn it.  I have received many requests from users 
> to expand on my Django tutorials, however I lack the personal time required 
> to write these articles.  To that affect, I have ultimately decided to 
> create an entire Django web-based course for a very low cost.  The cost is 
> much cheaper than a typical Django book available today and will touch on 
> more advanced concepts and also explain how to integrate and use popular 
> 3rd party Django apps.  After reading many Django books, I always see them 
> missing on some key concepts or don't explain how to use particular 3rd 
> party apps.  I have been building Django powered websites since around 2010 
> and have a large amount of experience with the framework that I can share 
> with others.
>
> Best Regards,
>   Kevin Veroneau
>   PythonDiary.com
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: need immediate help setting up Apache

2013-05-28 Thread Rafael E. Ferrero
and here is an example of a django.wsgi file

import os
import sys

path = '/path/to/your/project/'
if path not in sys.path:
sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'yourproject.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()




2013/5/28 Rafael E. Ferrero 

> First... configure Bind2 (or your DNS to support your domain)
> Second configure a Virtual Host for your domain (supoust that you use wsgi)
> Here is an example:
>
> 
> DocumentRoot /var/www/yourdomain.com
> ServerName yourdomain.com.ar
> ServerAlias www.yourdomain.com.
> ServerAdmin youru...@yourdomain.com
>
> ErrorLog ${APACHE_LOG_DIR}/error.log
> CustomLog ${APACHE_LOG_DIR}/access.log combined
>
> WSGIDaemonProcess yourdomain.com processes=2 threads=15
> display-name=%{GROUP}
> WSGIProcessGroup yourdomain.com
> #here i say: for all request call to django.wsgi
> WSGIScriptAlias / /path/to/django.wsgi
>
> Alias /media/ /path/to/your/project/and/to/your/media/
> Alias /static/admin/  /path/to/your/project/and/to/your/static/admin/
>
> 
> Options FollowSymLinks -Indexes
> AllowOverride None
> 
> 
>
>
>
> 2013/5/28 John Fabiani 
>
>>  Yes I have complete control.  But I don't know how to set it up.
>> Johnf
>>
>> On 05/28/2013 07:39 AM, Rafael E. Ferrero wrote:
>>
>>  you have access to config files of apache ?? like site-available/
>> yoursite.com to set your virtuals hosts ??
>>
>>
>>  2013/5/28 John Fabiani 
>>
>>> Hi Folks,
>>> I need immediate help setting up Apache on an openSUSE 12.3.  I'm
>>> willing to pay a little for the help.
>>> Currently I have my scripts working using manage.py runserver.  But I
>>> don't understand what I need to do with Apache.  I have to get website up
>>> today.
>>> I will also have to setup the delivery port to 443.
>>>
>>> Contact me via this list.
>>>
>>> Thanks in advance,
>>>
>>> Johnf
>>>
>>> --
>>> 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 http://groups.google.com/group/django-users?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>
>> --
>> Rafael E. Ferrero
>> Claro: (03562) 15514856
>> --
>> 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 http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>>
>>  --
>> 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 http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Rafael E. Ferrero
> Claro: (03562) 15514856
>



-- 
Rafael E. Ferrero
Claro: (03562) 15514856

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Object Lookup after Save

2013-05-28 Thread Christophe Pettus
I'll admit my MySQL skills are a bit rusty, but can you examine the database 
logs to confirm that the session is in fact doing the INSERT and a commit 
before the SELECT?

On May 28, 2013, at 10:52, Chris Conover  wrote:

> It's not really feasible to move this project to PostgreSQL.
> 
> I honestly just don't understand the problem. According to the Django 
> documentation, the ORM functions in autocommit mode by default. In other 
> words, the changes should be committed as soon as the query is complete, 
> right? So after an INSERT, you should be able to do a SELECT and the data 
> should be available. In the code written, the SELECT is definitely coming 
> after the INSERT. The code is not complex. I'm setting up a local test to 
> simulate the load on the production system to see if I can reproduce the 
> issue.
> 
> On Tuesday, May 28, 2013 1:33:10 PM UTC-4, Christophe Pettus wrote:
>> 
>> In the meantime, you can use this:
>> 
>> https://github.com/Xof/xact
>> 
>> On May 28, 2013, at 10:29, Chris Conover  wrote:
>> 
>>> That seems to only be available in the dev version of Django (now 1.6 
>>> alpha).
>>> 
>>> On Wednesday, May 22, 2013 4:43:29 AM UTC-4, Christian Schmitt wrote:
 
 if you want transactions you need to do :
 
 with transaction.atomic():
 
 like described here: 
 https://docs.djangoproject.com/en/dev/topics/db/transactions/
 
 Am Mittwoch, 22. Mai 2013 10:40:15 UTC+2 schrieb Christian Schmitt:
> 
> In Django the normal behavior should be that when you do a save() it will 
> automatically commit() your query's to the database.
> so that in obj.save() you should just could access the pk with obj.id 
> after you did a obj.save().
> If you want to maybe stop the commit you need to do a obj = 
> obj.save(commit=False), then you could add some things to your obj and 
> commit/save it later.
> But as i understood you already do a obj.save() but it doesn't commit 
> correctly? Maybe you should just try a PostgreSQL database for testing, 
> since I'm not having trouble looking up objects after i saved it.
> 
> I often do things like:
> obj.save()
> return HttpResponseRedirect(reverse('view', {'pk': obj.id}))
> and i never run into any exception
> 
> 
> Am Dienstag, 21. Mai 2013 23:20:53 UTC+2 schrieb Chris Conover:
>> 
>> Calling transaction.commit() after object.save results in a 
>> TransactionManagementError. I mentioned at the end that I am using MySQL 
>> (5.5.27). The issue is not that the Gearman workers are having trouble 
>> saving their transactions, it's that they are having trouble looking up 
>> the incoming object. I'm assuming the view and workers are separate 
>> transactions since I don't see how they could be connected -- though I'm 
>> looking into this. 
>> 
>> On Tuesday, May 21, 2013 1:05:54 PM UTC-4, Tom Evans wrote:
>>> 
>>> On Tue, May 21, 2013 at 4:23 PM, Chris Conover  
>>> wrote: 
>>> > Hello, 
>>> > 
>>> > I'm having an issue looking up objects immediately after they are 
>>> > saved and 
>>> > am wondering if anyone has any advice on how to address the problem. 
>>> > Specifically, I'm saving an object in a view (nothing fancy, a simple 
>>> > save()) and then kicking off a Gearman task to do some operations on 
>>> > that 
>>> > saved object in the background. I pass the newly created object's PK 
>>> > as data 
>>> > to the Gearman worker which then does a simple 
>>> > Objects.objects.get(pk=PK). 
>>> > However, almost all of the time this lookup operation fails with an 
>>> > DoesNotExist exception. I believe the problem has to do with 
>>> > transactions. 
>>> > Namely, the read in the Gearman worker is happening before the write 
>>> > from 
>>> > the view is committed to the database. I've tried several things 
>>> > including 
>>> > refactoring the saving code to be wrapped in a 
>>> > @transaction.commit_on_success block, moving the worker submission to 
>>> > post_save and adding a long delay before the Gearman worker does the 
>>> > lookup. 
>>> > Nothing really seems to solve the problem completely. Even with a 60 
>>> > second 
>>> > delay, the lookup fails with some frequency. Am I missing something 
>>> > here? Is 
>>> > there some Django query cache that I can clear? Or should I just 
>>> > rewrite all 
>>> > this to just to use a look-back perspective. 
>>> > 
>>> > The stack is Django 1.4 connecting to MySQL 5.5.27. Django is 
>>> > handling 
>>> > 200-1000 requests per second and the database is handling about 
>>> > double that. 
>>> > 
>>> > Thanks, 
>>> > Chris 
>>> 
>>>   from django import transaction 
>>>   … 
>>>   obj.save() 
>>>   

Re: Object Lookup after Save

2013-05-28 Thread Chris Conover
It's not really feasible to move this project to PostgreSQL.

I honestly just don't understand the problem. According to the Django 
documentation, the ORM functions in autocommit mode by default. In other 
words, the changes should be committed as soon as the query is complete, 
right? So after an INSERT, you should be able to do a SELECT and the data 
should be available. In the code written, the SELECT is definitely coming 
after the INSERT. The code is not complex. I'm setting up a local test to 
simulate the load on the production system to see if I can reproduce the 
issue.

On Tuesday, May 28, 2013 1:33:10 PM UTC-4, Christophe Pettus wrote:
>
> In the meantime, you can use this:
>
> https://github.com/Xof/xact
>
> On May 28, 2013, at 10:29, Chris Conover  
> wrote:
>
> That seems to only be available in the dev version of Django (now 1.6 
> alpha).
>
> On Wednesday, May 22, 2013 4:43:29 AM UTC-4, Christian Schmitt wrote:
>>
>> if you want transactions you need to do :
>>
>> with transaction.atomic():
>>
>>
>> like described here: 
>> https://docs.djangoproject.com/en/dev/topics/db/transactions/
>>
>> Am Mittwoch, 22. Mai 2013 10:40:15 UTC+2 schrieb Christian Schmitt:
>>>
>>> In Django the normal behavior should be that when you do a save() it 
>>> will automatically commit() your query's to the database.
>>> so that in obj.save() you should just could access the pk with obj.idafter 
>>> you did a obj.save().
>>> If you want to maybe stop the commit you need to do a obj = 
>>> obj.save(commit=False), then you could add some things to your obj and 
>>> commit/save it later.
>>> But as i understood you already do a obj.save() but it doesn't commit 
>>> correctly? Maybe you should just try a PostgreSQL database for testing, 
>>> since I'm not having trouble looking up objects after i saved it.
>>>
>>> I often do things like:
>>> obj.save()
>>> return HttpResponseRedirect(reverse('view', {'pk': obj.id}))
>>> and i never run into any exception
>>>
>>>
>>> Am Dienstag, 21. Mai 2013 23:20:53 UTC+2 schrieb Chris Conover:

 Calling transaction.commit() after object.save results in 
 a TransactionManagementError. I mentioned at the end that I am using MySQL 
 (5.5.27). The issue is not that the Gearman workers are having trouble 
 saving their transactions, it's that they are having trouble looking up 
 the 
 incoming object. I'm assuming the view and workers are separate 
 transactions since I don't see how they could be connected -- though I'm 
 looking into this. 

 On Tuesday, May 21, 2013 1:05:54 PM UTC-4, Tom Evans wrote:
>
> On Tue, May 21, 2013 at 4:23 PM, Chris Conover  
> wrote: 
> > Hello, 
> > 
> > I'm having an issue looking up objects immediately after they are 
> saved and 
> > am wondering if anyone has any advice on how to address the problem. 
> > Specifically, I'm saving an object in a view (nothing fancy, a 
> simple 
> > save()) and then kicking off a Gearman task to do some operations on 
> that 
> > saved object in the background. I pass the newly created object's PK 
> as data 
> > to the Gearman worker which then does a simple 
> Objects.objects.get(pk=PK). 
> > However, almost all of the time this lookup operation fails with an 
> > DoesNotExist exception. I believe the problem has to do with 
> transactions. 
> > Namely, the read in the Gearman worker is happening before the write 
> from 
> > the view is committed to the database. I've tried several things 
> including 
> > refactoring the saving code to be wrapped in a 
> > @transaction.commit_on_success block, moving the worker submission 
> to 
> > post_save and adding a long delay before the Gearman worker does the 
> lookup. 
> > Nothing really seems to solve the problem completely. Even with a 60 
> second 
> > delay, the lookup fails with some frequency. Am I missing something 
> here? Is 
> > there some Django query cache that I can clear? Or should I just 
> rewrite all 
> > this to just to use a look-back perspective. 
> > 
> > The stack is Django 1.4 connecting to MySQL 5.5.27. Django is 
> handling 
> > 200-1000 requests per second and the database is handling about 
> double that. 
> > 
> > Thanks, 
> > Chris 
>
>   from django import transaction 
>   … 
>   obj.save() 
>   transaction.commit() 
>   task.submit(obj.id) 
>
> You will also need to make sure that gearman is doing things correctly 
> as well. You haven't mentioned what database you are using, but if 
> gearman's DB connection is in a read repeated mode, you can do 
> whatever you like in django but you won't see new data in gearman 
> until gearman's current transaction is committed. 
>
> Cheers 
>
> Tom 
>
  -- 
> You received this 

Re: Object Lookup after Save

2013-05-28 Thread Christophe Pettus
In the meantime, you can use this:

https://github.com/Xof/xact

On May 28, 2013, at 10:29, Chris Conover  wrote:

> That seems to only be available in the dev version of Django (now 1.6 alpha).
> 
> On Wednesday, May 22, 2013 4:43:29 AM UTC-4, Christian Schmitt wrote:
>> 
>> if you want transactions you need to do :
>> 
>> with transaction.atomic():
>> 
>> like described here: 
>> https://docs.djangoproject.com/en/dev/topics/db/transactions/
>> 
>> Am Mittwoch, 22. Mai 2013 10:40:15 UTC+2 schrieb Christian Schmitt:
>>> 
>>> In Django the normal behavior should be that when you do a save() it will 
>>> automatically commit() your query's to the database.
>>> so that in obj.save() you should just could access the pk with obj.id after 
>>> you did a obj.save().
>>> If you want to maybe stop the commit you need to do a obj = 
>>> obj.save(commit=False), then you could add some things to your obj and 
>>> commit/save it later.
>>> But as i understood you already do a obj.save() but it doesn't commit 
>>> correctly? Maybe you should just try a PostgreSQL database for testing, 
>>> since I'm not having trouble looking up objects after i saved it.
>>> 
>>> I often do things like:
>>> obj.save()
>>> return HttpResponseRedirect(reverse('view', {'pk': obj.id}))
>>> and i never run into any exception
>>> 
>>> 
>>> Am Dienstag, 21. Mai 2013 23:20:53 UTC+2 schrieb Chris Conover:
 
 Calling transaction.commit() after object.save results in a 
 TransactionManagementError. I mentioned at the end that I am using MySQL 
 (5.5.27). The issue is not that the Gearman workers are having trouble 
 saving their transactions, it's that they are having trouble looking up 
 the incoming object. I'm assuming the view and workers are separate 
 transactions since I don't see how they could be connected -- though I'm 
 looking into this. 
 
 On Tuesday, May 21, 2013 1:05:54 PM UTC-4, Tom Evans wrote:
> 
> On Tue, May 21, 2013 at 4:23 PM, Chris Conover  wrote: 
> > Hello, 
> > 
> > I'm having an issue looking up objects immediately after they are saved 
> > and 
> > am wondering if anyone has any advice on how to address the problem. 
> > Specifically, I'm saving an object in a view (nothing fancy, a simple 
> > save()) and then kicking off a Gearman task to do some operations on 
> > that 
> > saved object in the background. I pass the newly created object's PK as 
> > data 
> > to the Gearman worker which then does a simple 
> > Objects.objects.get(pk=PK). 
> > However, almost all of the time this lookup operation fails with an 
> > DoesNotExist exception. I believe the problem has to do with 
> > transactions. 
> > Namely, the read in the Gearman worker is happening before the write 
> > from 
> > the view is committed to the database. I've tried several things 
> > including 
> > refactoring the saving code to be wrapped in a 
> > @transaction.commit_on_success block, moving the worker submission to 
> > post_save and adding a long delay before the Gearman worker does the 
> > lookup. 
> > Nothing really seems to solve the problem completely. Even with a 60 
> > second 
> > delay, the lookup fails with some frequency. Am I missing something 
> > here? Is 
> > there some Django query cache that I can clear? Or should I just 
> > rewrite all 
> > this to just to use a look-back perspective. 
> > 
> > The stack is Django 1.4 connecting to MySQL 5.5.27. Django is handling 
> > 200-1000 requests per second and the database is handling about double 
> > that. 
> > 
> > Thanks, 
> > Chris 
> 
>   from django import transaction 
>   … 
>   obj.save() 
>   transaction.commit() 
>   task.submit(obj.id) 
> 
> You will also need to make sure that gearman is doing things correctly 
> as well. You haven't mentioned what database you are using, but if 
> gearman's DB connection is in a read repeated mode, you can do 
> whatever you like in django but you won't see new data in gearman 
> until gearman's current transaction is committed. 
> 
> Cheers 
> 
> Tom
> -- 
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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 

Re: Object Lookup after Save

2013-05-28 Thread Chris Conover
That seems to only be available in the dev version of Django (now 1.6 
alpha).

On Wednesday, May 22, 2013 4:43:29 AM UTC-4, Christian Schmitt wrote:
>
> if you want transactions you need to do :
>
> with transaction.atomic():
>
>
> like described here: 
> https://docs.djangoproject.com/en/dev/topics/db/transactions/
>
> Am Mittwoch, 22. Mai 2013 10:40:15 UTC+2 schrieb Christian Schmitt:
>>
>> In Django the normal behavior should be that when you do a save() it will 
>> automatically commit() your query's to the database.
>> so that in obj.save() you should just could access the pk with obj.idafter 
>> you did a obj.save().
>> If you want to maybe stop the commit you need to do a obj = 
>> obj.save(commit=False), then you could add some things to your obj and 
>> commit/save it later.
>> But as i understood you already do a obj.save() but it doesn't commit 
>> correctly? Maybe you should just try a PostgreSQL database for testing, 
>> since I'm not having trouble looking up objects after i saved it.
>>
>> I often do things like:
>> obj.save()
>> return HttpResponseRedirect(reverse('view', {'pk': obj.id}))
>> and i never run into any exception
>>
>>
>> Am Dienstag, 21. Mai 2013 23:20:53 UTC+2 schrieb Chris Conover:
>>>
>>> Calling transaction.commit() after object.save results in 
>>> a TransactionManagementError. I mentioned at the end that I am using MySQL 
>>> (5.5.27). The issue is not that the Gearman workers are having trouble 
>>> saving their transactions, it's that they are having trouble looking up the 
>>> incoming object. I'm assuming the view and workers are separate 
>>> transactions since I don't see how they could be connected -- though I'm 
>>> looking into this. 
>>>
>>> On Tuesday, May 21, 2013 1:05:54 PM UTC-4, Tom Evans wrote:

 On Tue, May 21, 2013 at 4:23 PM, Chris Conover  
 wrote: 
 > Hello, 
 > 
 > I'm having an issue looking up objects immediately after they are 
 saved and 
 > am wondering if anyone has any advice on how to address the problem. 
 > Specifically, I'm saving an object in a view (nothing fancy, a simple 
 > save()) and then kicking off a Gearman task to do some operations on 
 that 
 > saved object in the background. I pass the newly created object's PK 
 as data 
 > to the Gearman worker which then does a simple 
 Objects.objects.get(pk=PK). 
 > However, almost all of the time this lookup operation fails with an 
 > DoesNotExist exception. I believe the problem has to do with 
 transactions. 
 > Namely, the read in the Gearman worker is happening before the write 
 from 
 > the view is committed to the database. I've tried several things 
 including 
 > refactoring the saving code to be wrapped in a 
 > @transaction.commit_on_success block, moving the worker submission to 
 > post_save and adding a long delay before the Gearman worker does the 
 lookup. 
 > Nothing really seems to solve the problem completely. Even with a 60 
 second 
 > delay, the lookup fails with some frequency. Am I missing something 
 here? Is 
 > there some Django query cache that I can clear? Or should I just 
 rewrite all 
 > this to just to use a look-back perspective. 
 > 
 > The stack is Django 1.4 connecting to MySQL 5.5.27. Django is 
 handling 
 > 200-1000 requests per second and the database is handling about 
 double that. 
 > 
 > Thanks, 
 > Chris 

   from django import transaction 
   … 
   obj.save() 
   transaction.commit() 
   task.submit(obj.id) 

 You will also need to make sure that gearman is doing things correctly 
 as well. You haven't mentioned what database you are using, but if 
 gearman's DB connection is in a read repeated mode, you can do 
 whatever you like in django but you won't see new data in gearman 
 until gearman's current transaction is committed. 

 Cheers 

 Tom 

>>>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




is there way to have multiple forms per step in django form wizard ?

2013-05-28 Thread Vishwajeet
I have this situation where I want to have multiple formsets and a normal 
form at single step in formwizard, I spent sometime time searching for the 
same but could not find any info.
Can someone suggest some workaround or solution to the problem ?

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: .annotate() in limit_choices_to?

2013-05-28 Thread galgal


I wrote some code, but it returns doubled entries if there's no annotate:

price_variants = models.ManyToManyField(
ProductPriceVariant, verbose_name=_(u'price variants'),
limit_choices_to=Q(translation__language__iexact=get_language()[:2]) & 
Q(
translation__product__subproducts__isnull=False))


On Tuesday, May 28, 2013 5:44:57 PM UTC+2, galgal wrote:
>
> Is it possible to put, somehow, *.annotate()* method into M2M *
> limit_choices_to*?
> I need to limit my choices to that query:
>
> *
> cls.objects.annotate(subproducts_num=models.Count('subproducts')).filter(subproducts_num__gt=0)
> *
>
>
> Any ideas?
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Sergiy Khohlov
 Big  job is  started !  Big congrat from me !

Many thanks,

Serge


+380 636150445
skype: skhohlov


On Tue, May 28, 2013 at 9:17 AM, Kevin  wrote:

> A small update, I just completed the first chapter and laid out the rest
> of the chapters which will be made available.  You can view the current
> chapter list on my Uarica project page:
>
> http://uarica.com/+12
>
> Here's the link to the chapter list of the "Core Framework" section:
> http://www.uarica.com/kveroneau/django-course/Apps/Wiki/CoreFramework
>
> Let me know what you think of the current list of Chapters, I know
> "jQuery" isn't technically part of the Core Framework, but it's not an app
> either.  Anything which doesn't require external Django apps will be placed
> in "Core Framework".  Many people seem to be asking about jQuery and
> Django, and it's one of the top search terms coming to my blog, so expect
> this chapter to be extensive.
>
>
> On Monday, 27 May 2013 17:02:58 UTC-5, Kevin wrote:
>>
>> Hello everyone!
>>
>>   It's been quite sometime since I have been on here, well I came back
>> with some great news!  I am currently in the process of building an online
>> Django web course aimed at both new and old Django developers.  I will be
>> charging a minimal fee for access to the entire course, but the first 3
>> chapters of the main sections will be free for everyone to read and enjoy.
>> The course software itself is built using Django naturally.
>>
>>   The course software has been completed and uploaded online.  I am now
>> in the lengthily process of writing up all the chapters, quizzes, example
>> code, and full projects.  This is going to be a large amount of work,
>> however at the current moment this is my only job and that is why I am
>> planning on charging for admittance.  I am aiming to have a large amount of
>> it completed by around the middle of June and ready for public consumption
>> shortly after.
>>
>>   I have decided to give a lucky few free access to the entire course for
>> the purpose of reviewing and providing me with feedback.  If you are
>> interested, please reply back to me and explain why I should select you.  I
>> will then select 5 lucky individuals and email them their access
>> credentials and a link to the actual course's website when it's ready.
>>
>>   Here's a little background information about myself, since I haven't
>> been on here recently.  I am the current maintainer and author of
>> PythonDiary.com, which has been a relatively successful Python blog since
>> January of 2012.  Over 500 users visit the blog each day, and if a new
>> article is available this amount can increase to over 1,000 hits.  Many of
>> my articles and tutorials are related to Django, and most of my user base
>> uses Django or wants to learn it.  I have received many requests from users
>> to expand on my Django tutorials, however I lack the personal time required
>> to write these articles.  To that affect, I have ultimately decided to
>> create an entire Django web-based course for a very low cost.  The cost is
>> much cheaper than a typical Django book available today and will touch on
>> more advanced concepts and also explain how to integrate and use popular
>> 3rd party Django apps.  After reading many Django books, I always see them
>> missing on some key concepts or don't explain how to use particular 3rd
>> party apps.  I have been building Django powered websites since around 2010
>> and have a large amount of experience with the framework that I can share
>> with others.
>>
>> Best Regards,
>>   Kevin Veroneau
>>   PythonDiary.com
>>
>>  --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




.annotate() in limit_choices_to?

2013-05-28 Thread galgal
Is it possible to put, somehow, *.annotate()* method into M2M *
limit_choices_to*?
I need to limit my choices to that query:

*
cls.objects.annotate(subproducts_num=models.Count('subproducts')).filter(subproducts_num__gt=0)
*


Any ideas?

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: need immediate help setting up Apache

2013-05-28 Thread Rafael E. Ferrero
First... configure Bind2 (or your DNS to support your domain)
Second configure a Virtual Host for your domain (supoust that you use wsgi)
Here is an example:


DocumentRoot /var/www/yourdomain.com
ServerName yourdomain.com.ar
ServerAlias www.yourdomain.com.
ServerAdmin youru...@yourdomain.com

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

WSGIDaemonProcess yourdomain.com processes=2 threads=15
display-name=%{GROUP}
WSGIProcessGroup yourdomain.com
#here i say: for all request call to django.wsgi
WSGIScriptAlias / /path/to/django.wsgi

Alias /media/ /path/to/your/project/and/to/your/media/
Alias /static/admin/  /path/to/your/project/and/to/your/static/admin/


Options FollowSymLinks -Indexes
AllowOverride None





2013/5/28 John Fabiani 

>  Yes I have complete control.  But I don't know how to set it up.
> Johnf
>
> On 05/28/2013 07:39 AM, Rafael E. Ferrero wrote:
>
>  you have access to config files of apache ?? like site-available/
> yoursite.com to set your virtuals hosts ??
>
>
>  2013/5/28 John Fabiani 
>
>> Hi Folks,
>> I need immediate help setting up Apache on an openSUSE 12.3.  I'm willing
>> to pay a little for the help.
>> Currently I have my scripts working using manage.py runserver.  But I
>> don't understand what I need to do with Apache.  I have to get website up
>> today.
>> I will also have to setup the delivery port to 443.
>>
>> Contact me via this list.
>>
>> Thanks in advance,
>>
>> Johnf
>>
>> --
>> 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 http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> --
> Rafael E. Ferrero
> Claro: (03562) 15514856
> --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>  --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Rafael E. Ferrero
Claro: (03562) 15514856

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: need immediate help setting up Apache

2013-05-28 Thread John Fabiani

Yes I have complete control.  But I don't know how to set it up.
Johnf
On 05/28/2013 07:39 AM, Rafael E. Ferrero wrote:
you have access to config files of apache ?? like 
site-available/yoursite.com  to set your virtuals 
hosts ??



2013/5/28 John Fabiani >


Hi Folks,
I need immediate help setting up Apache on an openSUSE 12.3.  I'm
willing to pay a little for the help.
Currently I have my scripts working using manage.py runserver.
 But I don't understand what I need to do with Apache.  I have to
get website up today.
I will also have to setup the delivery port to 443.

Contact me via this list.

Thanks in advance,

Johnf

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.





--
Rafael E. Ferrero
Claro: (03562) 15514856
--
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




--
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: need immediate help setting up Apache

2013-05-28 Thread Rafael E. Ferrero
you have access to config files of apache ?? like site-available/
yoursite.com to set your virtuals hosts ??


2013/5/28 John Fabiani 

> Hi Folks,
> I need immediate help setting up Apache on an openSUSE 12.3.  I'm willing
> to pay a little for the help.
> Currently I have my scripts working using manage.py runserver.  But I
> don't understand what I need to do with Apache.  I have to get website up
> today.
> I will also have to setup the delivery port to 443.
>
> Contact me via this list.
>
> Thanks in advance,
>
> Johnf
>
> --
> 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+unsubscribe@**googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at 
> http://groups.google.com/**group/django-users?hl=en
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out
> .
>
>
>


-- 
Rafael E. Ferrero
Claro: (03562) 15514856

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Test limit_choices_to

2013-05-28 Thread galgal
Is there any way to test if my *limit_choices_to* argument is working as I 
expect? How can I test that in unit test?

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




need immediate help setting up Apache

2013-05-28 Thread John Fabiani

Hi Folks,
I need immediate help setting up Apache on an openSUSE 12.3.  I'm 
willing to pay a little for the help.
Currently I have my scripts working using manage.py runserver.  But I 
don't understand what I need to do with Apache.  I have to get website 
up today.

I will also have to setup the delivery port to 443.

Contact me via this list.

Thanks in advance,

Johnf

--
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: listing objects in a html file

2013-05-28 Thread Drew Ferguson
Hi

I do not think you can include python in django templates so the various
uses of "unusedpremises" are ignored

You can generate a list of unused premises for the view by over-riding
the get_context_data method, perhaps something like this

### view.py

class PremisesListView()
  class = Premises
  etc...

  def get_context_data(self, **kwargs):
context = super(PremisesListView,self).get_context_data(**kwargs)
context['unusedpremises'] =
Premises.objects.filter(in_use=False).order_by('name')
return context

The final loop in the template should then work

As ever, more info at
https://docs.djangoproject.com/en/1.5/topics/class-based-views/generic-display/
in the section "Adding extra context"

On Tue, 28 May 2013 05:02:30 -0700 (PDT)
tony gair  wrote:

> 
> 
> This file is used to print out the name of the premises with an update
> link , however I wanted to add a list of premises with the in_use flag
> set to false. 
> Can anyone tell me what I am doing wrong?
> 
> 
> {% extends "base.html" %}
> 
> {% block content %}
> Premises
> 
> {% unusedpremises = [] %}
> {% for premises in object_list %}
> {% if premises.in_use %}
> {{ premises.name }}  Update   
> 
> {% else unusedpremises.add(premises) %}
> {% endif %}
> {% endfor %}
> 
> Unused Premises
> 
> {% for premises in unusedpremises %}
> {{ premises.name }}  Update  
> %nbsp 
> {% endif %}
> {% endfor %}
> 
> {% endblock %}
> 



-- 
Drew Ferguson

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




listing objects in a html file

2013-05-28 Thread tony gair


This file is used to print out the name of the premises with an update link 
, however I wanted to add a list of premises with the in_use flag set to 
false. 
Can anyone tell me what I am doing wrong?


{% extends "base.html" %}

{% block content %}
Premises

{% unusedpremises = [] %}
{% for premises in object_list %}
{% if premises.in_use %}
{{ premises.name }}  Update   

{% else unusedpremises.add(premises) %}
{% endif %}
{% endfor %}

Unused Premises

{% for premises in unusedpremises %}
{{ premises.name }}  Update  
%nbsp 
{% endif %}
{% endfor %}

{% endblock %}

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




example on django mptt

2013-05-28 Thread Randa Hisham
-- 
Randa Hesham
Software Developer

Twitter:@ro0oraa 
FaceBook:Randa Hisham 

ٍ

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django - Tastypie filtering by related field

2013-05-28 Thread Hélio Miranda
Yes, using the django tastypie and making the filter

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django - Tastypie filtering by related field

2013-05-28 Thread Tom Evans
On Tue, May 28, 2013 at 10:38 AM, Hélio Miranda  wrote:
> I have in my application, players and clubs and want to know how many
> players belong to a club, and I'm doing the following filter, but it returns
> empty [].
> What am I doing wrong?
>
> class PlayerResource(resources.MongoEngineResource):
>
> PlayerClub = fields.ReferencedListField(of='Rela.Resource.ClubResource',
>  attribute='PlayerClub', full=True, null=True)
>
> class Meta:
> queryset = Player.objects.all()
> allowed_methods = ('get', 'post', 'put', 'delete')
> list_allowed_methods = ['get', 'post','put', 'delete']
> authorization = Authorization()
> fields = ['id', 'PlayerName', 'PlayerAge']
> resource_name = 'Player'
>
> filtering = {
> 'PlayerClub': ALL_WITH_RELATIONS,
> 'PlayerAge' : ALL,
> }
>
> def determine_format(self, request):
> return "application/json"
>
> class ClubResource(resources.MongoEngineResource):
>
> class Meta:
> queryset = Club.objects.all()
> allowed_methods = ('get', 'post', 'put', 'delete')
> list_allowed_methods = ['get', 'post','put', 'delete']
> authorization = Authorization()
> resource_name = 'Club'
> fields = ['id', 'ClubName']
> filtering = {
> 'id': ALL
> }
>
> def determine_format(self, request):
> return "application/json"
>

Are you asking how to do this in Django?

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Django - Tastypie filtering by related field

2013-05-28 Thread Hélio Miranda
I have in my application, players and clubs and want to know how many 
players belong to a club, and I'm doing the following filter, but it 
returns empty [].
What am I doing wrong?

*class PlayerResource(resources.MongoEngineResource):*
**
*PlayerClub = 
fields.ReferencedListField(of='Rela.Resource.ClubResource',*
* attribute='PlayerClub', full=True, null=True)*
**
*class Meta:*
*queryset = Player.objects.all()*
*allowed_methods = ('get', 'post', 'put', 'delete')*
*list_allowed_methods = ['get', 'post','put', 'delete']*
*authorization = Authorization()*
*fields = ['id', 'PlayerName', 'PlayerAge']*
*resource_name = 'Player'*

*filtering = {*
*'PlayerClub': ALL_WITH_RELATIONS,*
*'PlayerAge' : ALL,*
*}*
**
*def determine_format(self, request): *
*return "application/json"*
*
*
*class ClubResource(resources.MongoEngineResource):*
**
*class Meta:*
*queryset = Club.objects.all()*
*allowed_methods = ('get', 'post', 'put', 'delete')*
*list_allowed_methods = ['get', 'post','put', 'delete']*
*authorization = Authorization()*
*resource_name = 'Club'*
*fields = ['id', 'ClubName']*
*filtering = {*
*'id': ALL*
*}*
*
*
*def determine_format(self, request): *
*return "application/json"*

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Problem counting names by letter

2013-05-28 Thread Tom Evans
On Fri, May 24, 2013 at 9:40 PM, Brian Millham  wrote:
> With this simple database table:
>
> class Artist(models.Model):
> id = models.IntegerField(primary_key=True)
> name = models.CharField(max_length=255L, blank=True)
> prefix = models.CharField(max_length=32L, blank=True)
> class Meta:
> db_table = 'artist'
>
> I want to be able to get a list of the first letter of the names with a
> count, for example with these artists in the table:
>
> ABBA, America, Asia, Blondie, Billy Joel, Charo
>
> I want this result
>
> letter=A lcount=3
> letter=B lcount=2
> letter=C lcount=1
>
> To complicate things, the database is not the default database.
>
> I've tried this raw query
>
> letters = Artist.objects.using('database_name').raw('SELECT id,
> UPPER(LEFT(name,1)) AS letter, COUNT(DISTINCT name) AS lcount FROM
> artist GROUP BY UPPER(LEFT(name,1)) ORDER BY UPPER(name)')
>
> but I get this error: AttributeError: 'QuerySet' object has no attribute
> 'raw'
>
> I've been able to do it using a cursor directly. Is that the only way?
> Or am I missing something. I'm trying to limit my use of raw and direct
> queries.
>
> I'd like to be able to do something like this:
>
> Artist.objects.using('database_name').aggregate(lc=Count('upper(left(name,1))'))
>
> but that doesn't work: FieldError: Cannot resolve keyword
> 'upper(left(name,1))' into field. Choices are: id, name, prefix
>

Manager.raw() is for those use cases where you will be producing a
list of objects to instantiate into objects.

In this case, you aren't producing a list of Artist objects, you are
producing a list of data about artists, and so it makes sense to use
the cursor directly.

Django can help you when you are annotating objects, or aggregating
data about related objects, but for some things, yes, you need to use
SQL.

Cheers

Tom

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Django with Moodle

2013-05-28 Thread Derek
Sourabh

Not sure if this is your first time on the list... if it is, please take 
some time to read:
https://code.djangoproject.com/wiki/UsingTheMailingList

Under "don'ts" you will find:

*Don't be vague e.g. "please help build a website". No one has time to 
write a vague answer. *

If you have googled extensively on the topic you want to solve, then at 
least post a quick summary of what you have found.  Then explain what you 
have tried already and what did/did not work.  Then ask for help on a 
specific issue (e.g. I tried to create Model A to talk to Table B in a 
moodle database, but got Error C.)

HTH
Derek

On Monday, 27 May 2013 15:48:13 UTC+2, Sourabh Banerjee wrote:
>
> I have moodle version 2.5.But its based on PHP.
> So how to integrate Django with moodle.Need help.
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Kevin
A small update, I just completed the first chapter and laid out the rest of 
the chapters which will be made available.  You can view the current 
chapter list on my Uarica project page:

http://uarica.com/+12

Here's the link to the chapter list of the "Core Framework" section:
http://www.uarica.com/kveroneau/django-course/Apps/Wiki/CoreFramework

Let me know what you think of the current list of Chapters, I know "jQuery" 
isn't technically part of the Core Framework, but it's not an app either.  
Anything which doesn't require external Django apps will be placed in "Core 
Framework".  Many people seem to be asking about jQuery and Django, and 
it's one of the top search terms coming to my blog, so expect this chapter 
to be extensive.

On Monday, 27 May 2013 17:02:58 UTC-5, Kevin wrote:
>
> Hello everyone!
>
>   It's been quite sometime since I have been on here, well I came back 
> with some great news!  I am currently in the process of building an online 
> Django web course aimed at both new and old Django developers.  I will be 
> charging a minimal fee for access to the entire course, but the first 3 
> chapters of the main sections will be free for everyone to read and enjoy.  
> The course software itself is built using Django naturally.
>
>   The course software has been completed and uploaded online.  I am now in 
> the lengthily process of writing up all the chapters, quizzes, example 
> code, and full projects.  This is going to be a large amount of work, 
> however at the current moment this is my only job and that is why I am 
> planning on charging for admittance.  I am aiming to have a large amount of 
> it completed by around the middle of June and ready for public consumption 
> shortly after.
>
>   I have decided to give a lucky few free access to the entire course for 
> the purpose of reviewing and providing me with feedback.  If you are 
> interested, please reply back to me and explain why I should select you.  I 
> will then select 5 lucky individuals and email them their access 
> credentials and a link to the actual course's website when it's ready.
>
>   Here's a little background information about myself, since I haven't 
> been on here recently.  I am the current maintainer and author of 
> PythonDiary.com, which has been a relatively successful Python blog since 
> January of 2012.  Over 500 users visit the blog each day, and if a new 
> article is available this amount can increase to over 1,000 hits.  Many of 
> my articles and tutorials are related to Django, and most of my user base 
> uses Django or wants to learn it.  I have received many requests from users 
> to expand on my Django tutorials, however I lack the personal time required 
> to write these articles.  To that affect, I have ultimately decided to 
> create an entire Django web-based course for a very low cost.  The cost is 
> much cheaper than a typical Django book available today and will touch on 
> more advanced concepts and also explain how to integrate and use popular 
> 3rd party Django apps.  After reading many Django books, I always see them 
> missing on some key concepts or don't explain how to use particular 3rd 
> party apps.  I have been building Django powered websites since around 2010 
> and have a large amount of experience with the framework that I can share 
> with others.
>
> Best Regards,
>   Kevin Veroneau
>   PythonDiary.com
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.