Ticket #14426: remove_mysite_from_import.diff

File remove_mysite_from_import.diff, 4.2 KB (added by Keith Gray, 14 years ago)
  • docs/topics/db/models.txt

     
    570570import the related model at the top of the model that holds your model. Then,
    571571just refer to the other model class wherever needed. For example::
    572572
    573     from mysite.geography.models import ZipCode
     573    from geography.models import ZipCode
    574574
    575575    class Restaurant(models.Model):
    576576        # ...
  • docs/topics/db/queries.txt

     
    6060
    6161Assuming models live in a file ``mysite/blog/models.py``, here's an example::
    6262
    63     >>> from mysite.blog.models import Blog
     63    >>> from blog.models import Blog
    6464    >>> b = Blog(name='Beatles Blog', tagline='All the latest Beatles news.')
    6565    >>> b.save()
    6666
     
    9898field; simply assign an object of the right type to the field in question.
    9999This example updates the ``blog`` attribute of an ``Entry`` instance ``entry``::
    100100
    101     >>> from mysite.blog.models import Entry
     101    >>> from blog.models import Entry
    102102    >>> entry = Entry.objects.get(pk=1)
    103103    >>> cheese_blog = Blog.objects.get(name="Cheddar Talk")
    104104    >>> entry.blog = cheese_blog
     
    108108method on the field to add a record to the relation. This example adds the
    109109``Author`` instance ``joe`` to the ``entry`` object::
    110110
    111     >>> from mysite.blog.models import Author
     111    >>> from blog.models import Author
    112112    >>> joe = Author.objects.create(name="Joe")
    113113    >>> entry.authors.add(joe)
    114114
  • docs/topics/generic-views.txt

     
    7272
    7373    from django.conf.urls.defaults import *
    7474    from django.views.generic.simple import direct_to_template
    75     **from mysite.books.views import about_pages**
     75    **from books.views import about_pages**
    7676
    7777    urlpatterns = patterns('',
    7878        ('^about/$', direct_to_template, {
     
    152152
    153153    from django.conf.urls.defaults import *
    154154    from django.views.generic import list_detail
    155     from mysite.books.models import Publisher
     155    from books.models import Publisher
    156156
    157157    publisher_info = {
    158158        "queryset" : Publisher.objects.all(),
     
    251251
    252252.. parsed-literal::
    253253
    254     from mysite.books.models import Publisher, **Book**
     254    from books.models import Publisher, **Book**
    255255
    256256    publisher_info = {
    257257        "queryset" : Publisher.objects.all(),
     
    376376
    377377.. parsed-literal::
    378378
    379     from mysite.books.views import books_by_publisher
     379    from books.views import books_by_publisher
    380380
    381381    urlpatterns = patterns('',
    382382        (r'^publishers/$', list_detail.object_list, publisher_info),
     
    387387
    388388    from django.http import Http404
    389389    from django.views.generic import list_detail
    390     from mysite.books.models import Book, Publisher
     390    from books.models import Book, Publisher
    391391
    392392    def books_by_publisher(request, name):
    393393
     
    447447
    448448.. parsed-literal::
    449449
    450     from mysite.books.views import author_detail
     450    from books.views import author_detail
    451451
    452452    urlpatterns = patterns('',
    453453        #...
     
    457457Then we'd write our wrapper function::
    458458
    459459    import datetime
    460     from mysite.books.models import Author
     460    from books.models import Author
    461461    from django.views.generic import list_detail
    462462    from django.shortcuts import get_object_or_404
    463463
  • docs/ref/contrib/formtools/form-wizard.txt

     
    193193arguments when you instantiate the Wizard::
    194194
    195195    from django.conf.urls.defaults import *
    196     from mysite.testapp.forms import ContactForm1, ContactForm2, ContactWizard
     196    from testapp.forms import ContactForm1, ContactForm2, ContactWizard
    197197
    198198    urlpatterns = patterns('',
    199199        (r'^contact/$', ContactWizard([ContactForm1, ContactForm2])),
Back to Top