Re: Help with new version of django

2012-01-28 Thread Aaron Cannon
I suspect he means the latest stable version, in which it really is
1.3.1.  To my knowledge 1.4.1 does not yet exist.

As for the original question, I would suggest familiarizing yourself
with the what's new documents for Django 1.2 and 1.3, and then tuning
your code accordingly.  Depending on what your application does, it
may be quite painless.

Alternatively, if you have good test coverage, you might just upgrade
your Django version, test, and fix what's broken.

Obviously, the first option is probably the better, but regardless, it
will be quite difficult for anyone to give you specific advice based
on the amount of information you provided.

Aaron

On 1/28/12, kenneth gonsalves  wrote:
> On Wed, 2012-01-25 at 17:25 -0800, itua ijagbone wrote:
>> Hello, please i need help as to how to update my project to the
>> lastest version of django 1.3.1. i have been using 1.1.1 to develop
>> the project. Please how do i go about it, making my project conform to
>> 1.3.1
>
> latest is 1.4.1
> --
> regards
> Kenneth Gonsalves
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Starting a new Python blog

2012-01-30 Thread Aaron Cannon
For me, Twitter is the new RSS.  Any chance of setting up a feed for
new content notifications?

Thanks.

Aaron

On 1/30/12, Kevin  wrote:
> It is good to see some subscribers this early on.  Thank you.  I have
> rolled out the updates for Tutorials and set the foundation for the
> Review system by starting a list of packages I frequently use, and
> hope to later review.  I hope to have the full review system live by
> the end of this week.
>
> The tutorials will also use the package list I built to build a list
> of dependencies required for the tutorial itself.  I hope this makes
> it much easier to follow tutorials by knowing which Python packages
> will be required before hand.  The package list has a summary of the
> package and a link to the website where it is maintained.  There are
> currently 2 tutorials available for consumption.  Both are videos I
> made on YouTube for Rackspace Cloud last year, so if your curious
> about how Rackspace cloud works, do check them out.
>
> There is a separate RSS feed for the tutorials:
> http://www.pythondiary.com/tutorials.xml
>
> I am planning on making a "Digest" RSS Feed which will contain the
> latest posts from each section, but will also keep the separate feeds
> there for subscribers who only want the blog, or just tutorials.
>
> The site will remain ad-free for the time being, so that requests are
> quick for end-users.  I made use of the Django caching framework to
> also increase the response time.  I hope to keep the blog site quick
> and clean.
>
> Enjoy!
>
> On Jan 29, 5:06 pm, Mario Gudelj  wrote:
>> Same :)
>>
>> On 29 January 2012 19:11, Anler Hernandez Peral  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > you have one subscriber over here and waiting to see more posts ;)
>>
>> > --
>> > anler
>>
>> > On Sat, Jan 28, 2012 at 9:35 PM, Kevin  wrote:
>>
>> >> Hello Everyone,
>>
>> >>  For sometime now I have been itching to create a Python blog, and
>> >> now the fruits of my labor have paid off.  I am ready to release the
>> >> blog to the public eyes.  At the moment it has 2 main features, a blog
>> >> portion, and a bookmark system.  Both the blog and the bookmark system
>> >> offer an RSS Atom feed.  The bookmark system is fully compatible with
>> >> "Live Bookmarks" to quickly access some of my top Python sites I visit
>> >> or visited recently which caught my eye.
>>
>> >>  The website is called "Python Diary", a rather unique take on a tech
>> >> blog name.  The site itself has a diary-like theme, and is for the
>> >> most part very easily to navigate.  The website was completely built
>> >> using Python, the theme was taken from a wordpress theme website and
>> >> formatted to work with the Django template system.  The entire backend
>> >> is written from scratch using a few reusable Django apps, namely,
>> >> django-tagging, south, and cumulus.
>>
>> >>  Now you might be saying, "Oh great, yet another Python blog".  But
>> >> wait...  I plan on setting this blog apart from the thousands of other
>> >> blogs in the world with some very unique features.  Features normally
>> >> found on commercial software blogs, movie and video game blogs is a
>> >> thorough review system.  I plan on going through many of the available
>> >> Python packages out there in the wild and basically reviewing them
>> >> like one would review anything else.  I do not see a dedicated Python
>> >> website which has reviews of many Python packages available in PyPi.
>> >> I plan on stating the usual pros and cons of the package, and
>> >> providing a score.  For example of how this type of review is
>> >> formatted, take a look at a CNET Review.
>>
>> >> My new blog can be found here:http://www.pythondiary.com/
>>
>> >>  Tell me what you think of the website in general, and the overall
>> >> idea for this blog.
>>
>> >> If you would like to subscribe to the upcoming content, add this RSS
>> >> feed to your favorite RSS reader:
>> >>http://www.pythondiary.com/blog.xml
>>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "Django users" group.
>> >> To post to this group, send email to django-users@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> django-users+unsubscr...@googlegroups.com.
>> >> For more options, visit this group at
>> >>http://groups.google.com/group/django-users?hl=en.
>>
>> >  --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Django users" group.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> >http://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+u

Re: Django Caching appended character issue

2012-01-31 Thread Aaron Cannon
If it was a BOM issue, wouldn't it get prepended? Unfortunately, I don't have 
any better ideas either.

Aaron 

--
This message was sent from a mobile device


On Jan 31, 2012, at 7:56, Ustun Ozgur  wrote:

> No idea actually, but I would look for BOM related issues.
> 
> Ustun
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/YpAgjT_A98MJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: FREE Full Django Tutorial

2012-02-03 Thread Aaron Cannon
Any plans to release a video podcast?

Aaron

On 2/3/12, programmersbook.com  wrote:
> Hi All,
>
> I created a full django turtorial screencast, so far 25, every week
> I'm adding one more.
>
> http://www.youtube.com/playlist?list=PL385A53B00B8B158E&feature=view_all
>
> Let me know what you think.
>
>
> Best,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can't make 404.html template to be used. Keep getting Apache 500 Internal Server Error instead.

2012-01-27 Thread Aaron Cannon
Any hints in the Apache error logs?

Aaron

On 1/21/12, Chris Seberino  wrote:
> I am proxying my Django app behind Apache.  I created a 404.html in my
> template directory but when I try to test it I get the following error
> that appears to come from Apache...
>
> Internal Server Error
>
> The server encountered an internal error or misconfiguration and was
> unable to complete your request.
>
> Please contact the server administrator, [no address given] and inform
> them of the time the error occurred, and anything you might have done
> that may have caused the error.
>
> More information about this error may be available in the server error
> log.
> Apache/2.2.16 (Ubuntu) Server at phil4.com Port 80
>
> Here is the relevant Apache settings...
>
> NameVirtualHost  72.14.188.15:80
> NameVirtualHost  72.14.188.15:443
> WSGIRestrictEmbedded On
>
> 
> #
> =
> ServerName  phil4.com
> ServerAlias www.phil4.com
> DocumentRoot/var/www
> Options Indexes FollowSymLinks
> #
> =
> WSGIProcessGroupphil4.com
> WSGIScriptAlias / /etc/apache2/wsgi/phil4.com.wsgi
> WSGIDaemonProcess   phil4.com user=seb group=seb threads=25
> #
> =
> 
> Order Allow,Deny
> Allow from All
> 
> #
> =
> Alias /favicon.ico /var/www/static/images/favicon.ico
> Alias /base.css/var/www/static/base.css
> Alias /static  /var/www/static
> Alias /public  /var/www/static/public
> Alias /misc/var/www/static/misc
> Alias /images  /var/www/static/images
> Alias /books/  /var/www/static/books/
> Alias /homework/   /var/www/static/homework/
> Alias /exams/  /var/www/static/exams/
> #
> =
> Redirect /sign_in  https://phil4.com/sign_in
> Redirect /register https://phil4.com/register
> #
> =
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can't make 404.html template to be used. Keep getting Apache 500 Internal Server Error instead.

2012-01-27 Thread Aaron Cannon
Hi.

Have you created a 500.html file in your templates directory?

Aaron

On 1/21/12, Chris Seberino  wrote:
>
>> Check your apache logs.
>
> Last line below says error is that there is no handler500.  I thought
> a missing web page for some URL was a 404 error so I'm not sure why
> this error is popping up.
>
> cs
>
>
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48] mod_wsgi
> (pid=19346): Exception occurred processing WSGI script '/etc/apache2/
> wsgi/phil4.com.wsgi'.
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48] Traceback
> (most recent call last):
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48]   File "/usr/
> lib/pymodules/python2.6/django/core/handlers/wsgi.py", line 241, in
> __call__
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48] response
> = self.get_response(request)
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48]   File "/usr/
> lib/pymodules/python2.6/django/core/handlers/base.py", line 130, in
> get_response
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48] return
> self.handle_uncaught_exception(request, resolver, sys.exc_info())
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48]   File "/usr/
> lib/pymodules/python2.6/django/core/handlers/base.py", line 179, in
> handle_uncaught_exception
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48]
> callback, param_dict = resolver.resolve500()
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48]   File "/usr/
> lib/pymodules/python2.6/django/core/urlresolvers.py", line 263, in
> resolve500
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48] return
> self._resolve_special('500')
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48]   File "/usr/
> lib/pymodules/python2.6/django/core/urlresolvers.py", line 253, in
> _resolve_special
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48] callback
> = getattr(self.urlconf_module, 'handler%s' % view_type)
> [Sat Jan 21 13:24:44 2012] [error] [client 75.108.243.48]
> AttributeError: 'module' object has no attribute 'handler500'
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Testing put in django 1.5

2013-05-14 Thread Aaron Cannon
Try something like the following untested code:

>From djanto.test.client import  BOUNDARY, MULTIPART_CONTENT, encode_multipart

...
encoded_data = encode_multipart({'someParameter':'someValue'})
response = self.c.put("/path/to/some/api", data=encoded_data,
content_type=MULTIPART_CONTENT, follow=True)

This is basically what 1.3 was doing by default.

Aaron

On 5/14/13, o_r  wrote:
> We are about to upgrade from django 1.3 to 1.5, and we are running into
> some problems with some of our tests. This used to work in 1.3:
>
> response=self.c.put("/path/to/some/api",{'someParameter':'someValue'},follow=True),
>
> but it doesn't in 1.5. There is a note about it in the docs that this has
> changed:
>
> If you were using the data parameter in a PUT request without a
> content_type,
> you must encode your data before passing it to the test client and set the
> content_type argument.
>
> Can anyone provide me with an example of how this is done?
>
> Thanks!
>
> Odd-R.
>
> --
> 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.




Some input on #20287

2013-05-14 Thread Aaron Cannon
Hi all.

Was browsing the tickets, looking for something that could use some
implementation work, and came across
https://code.djangoproject.com/ticket/20287

I posted a comment to the ticket, but I'm happy to provide some sample
code to illustrate what I mean, if that would be clearer.

Aaron

-- 
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: Avoid Django s3-urls stripping

2014-03-27 Thread Aaron Cannon
Try clicking view source in your browser when you view it.  Perhaps
the URL needs to be HTML escaped?

Just a guess.

Aaron

On 3/21/14, Paolo Bertasi  wrote:
> Hello,
> I'm trying to setup a mini django app to allow users to download files from
>
> s3. I wrote a simple python function (using boto of course) to fetch the
> correct url but when i handle the url with django the url is stripped.
> I wrote down the exact behaviour
> here
> .
>
> Please 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e3dba710-5189-4800-b455-09868dcf578b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAERFoOgQt14WY4-r7neHjrPdxN0gJ24ETvJVNxFhq1k8%3DHEERA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Client side timestamp handling and timezone

2014-03-27 Thread Aaron Cannon
Have you seen this SO answer?  This might help you to convert to UTC
in JS.  No idea why you're seeing different results inside and outside
the shell.

Luck.

Aaron

On 3/18/14, Yoanis Gil Delgado  wrote:
> Hello there,
>
> I've been struggling with this issue for the last few days and I cannot seem
> to find the way to fix it. I've this web page with a form where a user is
> requested to enter a date and a time of the day. Then there is a search
> button which does a JSON post back to the server with certain information.
> The user selected date/time is sent also back to the server as part of this
> information. Right now, before sending data back to the server the selected
> date/time is converted to a timestamp, which is assumed to be in the
> client's time zone.
>
> The server code attempts to convert this timestamp back to a valid datetime
> object, by means of:
>
> datetime.datetime.fromtimestamp(int(self.request_data.get(TIME_OF_PICKUP_FIELD)))
>
> but the function fromtimestamp is also applying the timezone conversation to
> the provide value which turns the datetime one hour ahead/behind the user's
> selected value. What's strange to me is that if I run this code outside
> Django's shell:
>
datetime.datetime.fromtimestamp(1395160800)
>
> the result is: datetime.datetime(2014,3,18,12,40)
>
> which is correct since (client's timezone is America/Chicago and server's is
> America/Havana).
>
> But if I try the same code with python manage.py shell:
>
datetime.datetime.fromtimestamp(1395160800)
>
> the result is: datetime.datetime(2014, 3, 18, 11, 40)
>
> I've tried with USE_TZ=False (TIME_ZONE setting is America/Chicago and
> server local time is America/Havana) and I still get the same result. I
> guess a work around this issue would be to send the timestamp in UTC but I
> haven't found a reliable way to do so in Javascript.
>
> I would appreciate any help.
>
> Bests,
>
> Yoanis.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0F5D31CD-462E-485D-9C2A-3613BD593C7C%402burbujas.net.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAERFoOirb4pigNUhdau2qftpxKi4dR9pwW%3D0DFfbk%3DfRQ%2B7F%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Avoid Django s3-urls stripping

2014-03-27 Thread Aaron Cannon
Other things I'd probably try to debug this issue would be:

* Hard coding the string into the call to HttpResponse,
* printing the variable that contains the URL to the console.

If the URL was still bad after trying the first item, and the second
item printed the expected result, then you could completely take S3
out of the picture.  From there, I would start narrowing it down, to
see if it was a specific character that was causing the problem.

Narrowing things down a bit more might make it easier for folks to
help you figure out your issue.

Luck.

Aaron

On 3/27/14, Paolo Bertasi  wrote:
> Hi Aaron,
> the html is "wrong" as well.
>
> Moreover i tried {% autoescape off %} but with no luck :(
>
>
>
>
> Il giorno giovedì 27 marzo 2014 17:24:45 UTC+1, Aaron Cannon ha scritto:
>>
>> Try clicking view source in your browser when you view it.  Perhaps
>> the URL needs to be HTML escaped?
>>
>> Just a guess.
>>
>> Aaron
>>
>> On 3/21/14, Paolo Bertasi > wrote:
>> > Hello,
>> > I'm trying to setup a mini django app to allow users to download files
>> from
>> >
>> > s3. I wrote a simple python function (using boto of course) to fetch the
>> >
>> > correct url but when i handle the url with django the url is stripped.
>> > I wrote down the exact behaviour
>> > here<
>> http://stackoverflow.com/questions/22531195/avoid-django-s3-urls-stripping>
>>
>>
>> > .
>> >
>> > Please 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...@googlegroups.com .
>> > To post to this group, send email to
>> > django...@googlegroups.com.
>>
>> > Visit this group at http://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/django-users/e3dba710-5189-4800-b455-09868dcf578b%40googlegroups.com.
>>
>>
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1172243d-6d55-41b4-9cf4-a6bbc6379225%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAERFoOi_Kf63Q0oONmZ8Aa77Qd2%3DFBtREgFV6GrjZ3WurxYP0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Avoid Django s3-urls stripping

2014-03-27 Thread Aaron Cannon
Is the url a bytestring?  A quick check of the code for HttpResponse
shows that that class is expecting a byte string.  Perhaps the URL
contains unicode characters that aren't being escaped properly?

Aaron

On 3/27/14, Aaron Cannon  wrote:
> Other things I'd probably try to debug this issue would be:
>
> * Hard coding the string into the call to HttpResponse,
> * printing the variable that contains the URL to the console.
>
> If the URL was still bad after trying the first item, and the second
> item printed the expected result, then you could completely take S3
> out of the picture.  From there, I would start narrowing it down, to
> see if it was a specific character that was causing the problem.
>
> Narrowing things down a bit more might make it easier for folks to
> help you figure out your issue.
>
> Luck.
>
> Aaron
>
> On 3/27/14, Paolo Bertasi  wrote:
>> Hi Aaron,
>> the html is "wrong" as well.
>>
>> Moreover i tried {% autoescape off %} but with no luck :(
>>
>>
>>
>>
>> Il giorno giovedì 27 marzo 2014 17:24:45 UTC+1, Aaron Cannon ha scritto:
>>>
>>> Try clicking view source in your browser when you view it.  Perhaps
>>> the URL needs to be HTML escaped?
>>>
>>> Just a guess.
>>>
>>> Aaron
>>>
>>> On 3/21/14, Paolo Bertasi > wrote:
>>> > Hello,
>>> > I'm trying to setup a mini django app to allow users to download files
>>> from
>>> >
>>> > s3. I wrote a simple python function (using boto of course) to fetch
>>> > the
>>> >
>>> > correct url but when i handle the url with django the url is stripped.
>>> > I wrote down the exact behaviour
>>> > here<
>>> http://stackoverflow.com/questions/22531195/avoid-django-s3-urls-stripping>
>>>
>>>
>>> > .
>>> >
>>> > Please 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...@googlegroups.com .
>>> > To post to this group, send email to
>>> > django...@googlegroups.com.
>>>
>>> > Visit this group at http://groups.google.com/group/django-users.
>>> > To view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/django-users/e3dba710-5189-4800-b455-09868dcf578b%40googlegroups.com.
>>>
>>>
>>> > For more options, visit https://groups.google.com/d/optout.
>>> >
>>>
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/1172243d-6d55-41b4-9cf4-a6bbc6379225%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAERFoOjPWjRwkCY%2BG-BtLO6XL8Sc-pK3TWBa%3D01aRPLP%2BVZCZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Avoid Django s3-urls stripping

2014-03-28 Thread Aaron Cannon
I'd like to try to reproduce this locally.  If you can send me the URL
(feel free to mangle the signature parameter for security), that will
help.  Alternatively, you might cut the URL into pieces, to see if
it's some specific characters that it's choking on, and then just send
me that bit.

Otherwise, if you'd like to create a small example project that
demonstrates this issue, and upload it to github, that would work as
well.

Aaron

On 3/28/14, Paolo Bertasi  wrote:
>
> Hi and thanks for your help.
>
> I tried
> * to print url in the console : OK
> * to print HttpResponse(url) in the console: OK
> * to return the url witout a template in the browser : wrong
>
> So i am really confused
> I am almost sure that:
> 1) it is not a s3 problem
> 2) it is not a HttpResponse problem
> 3) it is not a templating problem
>
> It seems that django strip the url when i get the url via browser...
>
>
>
> Il giorno giovedì 27 marzo 2014 19:34:10 UTC+1, Aaron Cannon ha scritto:
>>
>> Is the url a bytestring?  A quick check of the code for HttpResponse
>> shows that that class is expecting a byte string.  Perhaps the URL
>> contains unicode characters that aren't being escaped properly?
>>
>> Aaron
>>
>> On 3/27/14, Aaron Cannon >
>> wrote:
>> > Other things I'd probably try to debug this issue would be:
>> >
>> > * Hard coding the string into the call to HttpResponse,
>> > * printing the variable that contains the URL to the console.
>> >
>> > If the URL was still bad after trying the first item, and the second
>> > item printed the expected result, then you could completely take S3
>> > out of the picture.  From there, I would start narrowing it down, to
>> > see if it was a specific character that was causing the problem.
>> >
>> > Narrowing things down a bit more might make it easier for folks to
>> > help you figure out your issue.
>> >
>> > Luck.
>> >
>> > Aaron
>> >
>> > On 3/27/14, Paolo Bertasi > wrote:
>> >> Hi Aaron,
>> >> the html is "wrong" as well.
>> >>
>> >> Moreover i tried {% autoescape off %} but with no luck :(
>> >>
>> >>
>> >>
>> >>
>> >> Il giorno giovedì 27 marzo 2014 17:24:45 UTC+1, Aaron Cannon ha
>> scritto:
>> >>>
>> >>> Try clicking view source in your browser when you view it.  Perhaps
>> >>> the URL needs to be HTML escaped?
>> >>>
>> >>> Just a guess.
>> >>>
>> >>> Aaron
>> >>>
>> >>> On 3/21/14, Paolo Bertasi > wrote:
>> >>> > Hello,
>> >>> > I'm trying to setup a mini django app to allow users to download
>> files
>> >>> from
>> >>> >
>> >>> > s3. I wrote a simple python function (using boto of course) to fetch
>> >>> >
>> >>> > the
>> >>> >
>> >>> > correct url but when i handle the url with django the url is
>> stripped.
>> >>> > I wrote down the exact behaviour
>> >>> > here<
>> >>>
>> http://stackoverflow.com/questions/22531195/avoid-django-s3-urls-stripping>
>>
>>
>> >>>
>> >>>
>> >>> > .
>> >>> >
>> >>> > Please 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...@googlegroups.com .
>> >>> > To post to this group, send email to
>> >>> > django...@googlegroups.com.
>> >>>
>> >>> > Visit this group at http://groups.google.com/group/django-users.
>> >>> > To view this discussion on the web visit
>> >>> >
>> >>>
>> https://groups.google.com/d/msgid/django-users/e3dba710-5189-4800-b455-09868dcf578b%40googlegroups.com.
>>
>>
>> >>>
>> >>>
>> >>> > For more options, visit https://groups.google.com/d/optout.
>> >>> >
>> >>>
>> >>
>> >> --
>> >> You received this message bec

Re: Is it good idea to transition from MS Access to a webapp? And if so, is Django a good tool to do it?

2016-05-01 Thread Aaron Cannon
On the other hand, if you don't anticipate hundreds of users, then a
cheaper option like Digital Ocean may meet your needs better.  There
minimal servers start at $5/month.

Don't get me wrong, I love Aws, and I use it all the time.  It just
sounded like your needs were modest, so thought that might be a better
fit.

Aws may have a bit better stability than DO in the long run, but for
the apps I run there, uptime has not posed a problem so far.

Good luck with your app, and have fun.  I know I certainly have with
this framework.

Aaron

On 4/29/16, Fred Stluka  wrote:
> Patrik,
>
> I host the servers of all my clients at AWS (Amazon Web Services).
>
> I'd suggest you start by running the DB server (MySQL, PostgreSQL
> or whatever) on the same Linux server as the Web server (Apache,
> nginx or whatever).  Have the Web server handle all the static files
> (HTML., JS, CSS, image) and forward the Django requests via WSGI
> or uWSGI to the Django server on the same Linux server.  You can
> do it all with one AWS EC2 micro instance, which is free for the
> first year, and only $0.02/hour ($15/month) after that.
>
> As your needs grow, you can scale vertically by converting your
> micro instance to a small, medium, large, XL, XXL, etc.  And/or
> you can scale horizontally, by moving the DB server to it's own
> EC2 Linux server or to the AWS RDS service.  And by using AWS
> ELB, Autoscale, ElasticBeanstalk, etc., to manage farms of web
> servers and DB servers, allocating and terminating servers as
> needed to handle the load.  It's a one-line change in the Django
> settings file to point Django to the IP address of an RDBMS on a
> different server.
>
> Or turn the entire ops business over to AWS and just use their
> AWS Lambda service to serve the HTTP requests.  I haven't yet
> done that with Django, so you'd have to look into how well it
> works.
>
> For security reasons, configure Django to use a non-root user
> at the DB server, ideally one with as few privileges as possible.
> And make sure that the DB server is running as a non-root Linux
> user.  It everything accesses everything as root, you have a big
> security risk.  If someone DID succeed in hacking your Django
> app, and became able to get it to execute arbitrary SQL calls,
> they could make an SQL call that causes the DB server to make a
> system call (as root), that could run arbitrary code on your Linux
> server.  So, lock it down at each level, just in case.
>
> For more info about AWS, see:
> - http://bristle.com/Tips/CloudComputing.htm
> - http://bristle.com/Talks/CloudComputing/current/
>
> For direct printer access from a web app, see:
> - http://google.com/search?q=direct+printer+access+from+a+web+app
> Lots of hits, so I'm thinking it must be possible.
>
> --Fred
> 
> Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
> Open Source: Without walls and fences, we need no Windows or Gates.
> 
> On 4/29/16 2:40 PM, Patrik Mjartan wrote:
>>
>> Sorry, I miss-clicked post button and so I will reply twice now.
>>
>> Another important (rather obvious to you I guess) question would be - what
>> is the usual structure of the servers?
>>
>> What I mean is - I assume we don't want to have the actual DB on the same
>> server as where we host the website.
>>
>> Is it usually such that Web server is hosted by some hosting company (so
>> they can make sure it's up 24/7) while DB server is on the premises of the
>> company (ie. the one for which I work for) such that data can be retrieved
>> faster? Although I guess that doesn't make too much sense either, as the
>> data has to be retrieved by web-server first in order to be presented to
>> the user...
>>
>> Overall I'm quite sure that the company I work for would prefer paying
>> some hosting companies to host everything so they don't have to spend
>> money on (potentially) expensive hardware. Is this the standard approach?
>>
>> I'm a total newbie in this area so would appreciate some help ^_^.
>>
>>
>> On Friday, April 29, 2016 at 7:33:58 PM UTC+1, Patrik Mjartan wrote:
>>>
>>> Thank you very much for the reply!
>>>
>>> I went through the tutorial a few days ago and loved it.
>>>
>>> One, very important, question that I forgot to ask - one of the biggest
>>> advantages on having an actual desktop front-end app is having a direct
>>> access to media, such as printers. Hence a simple button click in the app
>>> would result in some document getting printed by default printer (or w/e
>>> printer is selected by code, not necessarily user). Is it possible to
>>> capture such functionality by web-app at all? Printing PDF documents is
>>> not a huge problem (users can just download the PDF invoice and print it
>>> manually), problem is for example receipts (in case of future expansion
>>> to include on-site sales).
>>>
>>> If it is not possible to do it directly

Re: Complex content type

2016-05-02 Thread Aaron Cannon
To your Answer class, you could just add a field like:

question = models.ForeignKey(Question, on_delete=models.CASCADE)

It may be as simple as that.

Does that help?

Aaron

On 5/2/16, ludovic coues  wrote:
> There is such example in the django girls tutorial I linked earlier.
>
> 2016-05-02 15:48 GMT+02:00 Said Akhmedbayev :
>> Ludovic, would you be so kind to help me and put together some example
>> code
>> of what I should  place in the forms.py and the views.py? I would greatly
>> appreciate.
>>
>> On Monday, May 2, 2016 at 4:25:13 PM UTC+6, ludovic coues wrote:
>>>
>>> You might want to add a foreign key in the answer model pointing to
>>> the question.
>>> Then in the view to show the form, create an answer object with it's
>>> question FK assigned to the question and create a form from that
>>> answer. In the view processing the form, you should get that object
>>> back, with the question and the text filled. Complete it with the
>>> user, as shown in the django girls tutorial and save your answer.
>>>
>>>
>>>
>>> 2016-05-02 11:57 GMT+02:00 Said Akhmedbayev :
>>> > Thank you ludovic and sorry for not being able to clearly explain what
>>> > I
>>> > want to do :-(. You are right, I want to show a user a simple django
>>> > form,
>>> > but I cannot figure out how to save an individual answer alone with
>>> > its
>>> > correspondence question's id and user's id
>>> >
>>> > So my table for "Answer" model will look like:
>>> >
>>> > user_id   question_id answer
>>> >  0101 text of an answer
>>> >  0102 text of an answer
>>> >  0201 text of an answer
>>> >  0202 text of an answer
>>> >  0301 text of an answer
>>> >  0302 text of an answer
>>> >
>>> >
>>> >
>>> >
>>> > On Monday, May 2, 2016 at 3:25:06 PM UTC+6, ludovic coues wrote:
>>> >>
>>> >> I have some trouble trying to understand what you means by "content
>>> >> type".
>>> >> That terms refer to the content of a file. For exemple, text/plain
>>> >> for
>>> >> plain
>>> >> text file or image/png for an image encoded as png.
>>> >> What you show look like a standard form. If you need basic pointer on
>>> >> how
>>> >> to use a form, saving it's data along with current logged-in user,
>>> >> you
>>> >> might
>>> >> want to have a look at the django girls tutorial. Specifically,
>>> >> http://tutorial.djangogirls.org/en/django_forms/ is about django
>>> >> forms.
>>> >>
>>> >> 2016-05-02 8:23 GMT+02:00 Said Akhmedbayev :
>>> >>>
>>> >>> Avraham, I understand that the content type is not any special or
>>> >>> complex
>>> >>> for you. Probably, I should wrote "complex content type for me".
>>> >>> Anyways,
>>> >>> can you provide any instructions for how can make this kind of
>>> >>> content
>>> >>> type?
>>> >
>>> > --
>>> > 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...@googlegroups.com.
>>> > To post to this group, send email to django...@googlegroups.com.
>>> > Visit this group at https://groups.google.com/group/django-users.
>>> > To view this discussion on the web visit
>>> >
>>> > https://groups.google.com/d/msgid/django-users/fdbc2c01-2059-406d-93fe-762d9fdc4a73%40googlegroups.com.
>>> >
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>>
>>> Cordialement, Coues Ludovic
>>> +336 148 743 42
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/c96cece4-7a3b-45fc-bb6f-5dfdd1e1b242%40googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> Cordialement, Coues Ludovic
> +336 148 743 42
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAEuG%2BTZ0nZMxtBroPkriKuE2e0YBH%2BKPQ5uEkPR1f5CMX0bO4g%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are 

Re: Querying a model with a ForeignKey

2016-05-03 Thread Aaron Cannon
Does

pModel = PostModel.objects.filter(topicid_id=pk).order_by('-pub_date')[0]

work for you?

Also, I believe it would be more conventional if you named your
topicid field simply topic, your post field as body, and your topic
field as name.

Luck.

Aaron

On 5/3/16, ofeyofey  wrote:
> I have two tables in a sqlite3 DB, PostModel and TopicModel. The PostModel
> has fields id, post, author, pub_date and topicid. This last fields topicid
>
> has a foreignkey to the other table Postmodel. PostModel has the fields id,
>
> topic.
> There is a one-to-many relation from the TopicModel to the PostModel. So a
> Topic can have many posts but a post can only have one topic.
> I would like to create query the PostModel to get the latest post for each
> topicid.
> So something like, SELECT PostModel.topicid WHERE date_pub is the latest.
> But i would like to use the Django Query API not SQL.
> My models look like this,
>
> class TopicModel(models.Model):
> topic = models.CharField(max_length=300)
> extra = models.CharField(max_length=100)
>
> def __str__(self):  # __unicode__ on Python 2
> return self.topic
>
> class PostModel(models.Model):
> post = HTMLField(blank=True)
> pub_date = models.DateTimeField('date published')
> author = models.CharField(max_length=30)
> topicid = models.ForeignKey(TopicModel, related_name = 'topicThing')
>
> def __str__(self):  # __unicode__ on Python 2
> return self.post
>
> Here is the view
>
> def thread(request, id):
> if request.method == "POST":
> print 'we are inside POST'
> pk = id
> tform = get_object_or_404(TopicModel, pk=id)
> Pform = PostForm(request.POST)
> if Pform.is_valid():
> # tform = Tform.save(commit=False)
> pform = Pform.save(commit=False)
> pform.topicid = tform
> # pform.topicid = pk
> pform.author = request.user
> pform.pub_date = timezone.now()
> pform.save()
> # return redirect('post_detail', pk=post.pk)
> return redirect('thread', id)
> else:
> pk=id
> pModel = reversed(PostModel.objects.all().filter(topicid_id=pk))
> postform = PostForm()
> return render(request, 'thread.html', {'pModel': pModel, 'postform' :
> postform})
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8dc3a17e-850e-4b5f-91d3-1909c45f97a8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Querying a model with a ForeignKey

2016-05-03 Thread Aaron Cannon
I fear doing this efficiently is beyond my limited abilities.  Will
look forward to other answers you might get.

Good luck.

Aaron

On 5/3/16, ofeyofey  wrote:
> Aaron thanks for looking at this.
> I understand what you did now, and that is great.
> But I actually realised that the views I showed are not the correct ones
> and the view I want to do this in called 'init' actually has no id.
> So How might I get one instance of each topic where if there is more than
> one instance I get the latest one only?
>
> Here is the view i should have posted.
>
> def init(request):
> # tModel = reversed(TopicModel.objects.all())
> # pModel = reversed(PostModel.objects.all())
> pModel =
> reversed(PostModel.objects.filter(topicid_id=pk).order_by('-pub_date')[0])
> # context = {'tModel': tModel, 'pModel': pModel}
> context = {'pModel': pModel}
> return render(request, 'forum.html', context)
>
> Thanks again,
>
>
> On Tuesday, 3 May 2016 18:43:53 UTC+1, ofeyofey wrote:
>>
>> I have two tables in a sqlite3 DB, PostModel and TopicModel. The PostModel
>>
>> has fields id, post, author, pub_date and topicid. This last fields
>> topicid
>> has a foreignkey to the other table Postmodel. PostModel has the fields
>> id,
>> topic.
>> There is a one-to-many relation from the TopicModel to the PostModel. So a
>>
>> Topic can have many posts but a post can only have one topic.
>> I would like to create query the PostModel to get the latest post for each
>>
>> topicid.
>> So something like, SELECT PostModel.topicid WHERE date_pub is the latest.
>>
>> But i would like to use the Django Query API not SQL.
>> My models look like this,
>>
>> class TopicModel(models.Model):
>> topic = models.CharField(max_length=300)
>> extra = models.CharField(max_length=100)
>>
>> def __str__(self):  # __unicode__ on Python 2
>> return self.topic
>>
>> class PostModel(models.Model):
>> post = HTMLField(blank=True)
>> pub_date = models.DateTimeField('date published')
>> author = models.CharField(max_length=30)
>> topicid = models.ForeignKey(TopicModel, related_name = 'topicThing')
>>
>> def __str__(self):  # __unicode__ on Python 2
>> return self.post
>>
>> Here is the view
>>
>> def thread(request, id):
>> if request.method == "POST":
>> print 'we are inside POST'
>> pk = id
>> tform = get_object_or_404(TopicModel, pk=id)
>> Pform = PostForm(request.POST)
>> if Pform.is_valid():
>> # tform = Tform.save(commit=False)
>> pform = Pform.save(commit=False)
>> pform.topicid = tform
>> # pform.topicid = pk
>> pform.author = request.user
>> pform.pub_date = timezone.now()
>> pform.save()
>> # return redirect('post_detail', pk=post.pk)
>> return redirect('thread', id)
>> else:
>> pk=id
>> pModel = reversed(PostModel.objects.all().filter(topicid_id=pk))
>> postform = PostForm()
>> return render(request, 'thread.html', {'pModel': pModel, 'postform' :
>>
>> postform})
>>
>> Thanks
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a0a43100-4172-4054-aaf2-0302a8a13cbe%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Storing data before committing to data base, wait for approval of admin

2016-05-04 Thread Aaron Cannon
I'd probably just keep a seperate table for all the edits, with a
foreign key pointing back to the record to be updated.  Seems like the
simplest layout to me, unless there's some complicating factor I'm
overlooking.

It would have a field for each field that edits can be suggested for,
a foreign key pointing to the person who suggested the edit, and
perhaps a flag for approved, rejected, or pending.  You might also
want to allow the data fields to be blankable and nullable, so you can
distinguish between a field where no edit was suggested, and one that
was suggested to be emptied, provided that there's a way for the user
to make that distinction in the user interface.

Not sure if this is what you were looking for or not.

Aaron

On 5/4/16, Mark  wrote:
>
>
> I'm building a mobile app using Ionic framework, so the front end is
> essentially a single page AngularJS app. I'm using Django Rest framework as
>
> the backend.
>
> In the application, an employee should be able to suggest updates, deletes,
>
> or additions to database models. In my schema, there is a "Contact person"
> model (which has fields like first_name, last_name, phone_number, etc.), a
> "GPS Address model" (which has fields like street_name, street_num, city,
> etc.) and an overarching "Delivery stop" model to which virtually all of
> the other models relate.
>
>
> What I need to implement is a system whereby an employee can suggest an
> edit to an existing object, say a Contact (id: 45, first_name: 'John',
> phone_number: "435-") which has a FK relationship to a Delivery Stop
> (id: 20, title: "Stop and Shop", notes: "closes at 0600"). The employee
> wants to update the phone number to "435-0001". But the update shouldn't be
>
> committed to the database until a manager has reviewed the update and
> approved, or edited the update then approved.
>
>
> I have a few ideas about how I might do this, but none of them seem as easy
>
> as I think it could be. Does anyone have any suggestions about best
> practices in this situation?
>
> The application will also include a special manager interface where they
> can few all suggested updates/edits and approve/reject them. The client
> side essentially functions with the Delivery Stop as the primary object,
> which shows all related items in a tabbed interface (Contacts, Gps
> addresses, etc.) And each time an edit is suggested by an employee, the
> appropriate manager will receive an email notification.
>
>
> Any suggestions are much appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/99fecded-f6f7-4d3a-8876-44e83a3ce007%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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