This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#urls.py | |
urlpatterns = patterns('', | |
url(r'^profile/$', login_required(views.BaseView.as_view( | |
template_name='profile_view.html' testVariable='testing' )), name='profile'), | |
) | |
#views.py | |
class BaseView(TemplateView): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#urls.py | |
urlpatterns = patterns('', | |
url(r'^profile/$', login_required(views.BaseView.as_view( | |
template_name='profile_view.html' testVariable='testing' )), name='profile'), | |
) | |
#views.py | |
class BaseView(TemplateView): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User(AbstractBaseUser, PermissionsMixin): | |
class Meta: | |
abstract = False | |
USERNAME_FIELD = 'email' | |
account_type = models.IntegerField(choices=ACCOUNT_TYPES, default=2) | |
first_name = models.CharField(max_length=30) | |
middle_names = models.CharField(max_length=30) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User(AbstractBaseUser, PermissionsMixin): | |
class Meta: | |
abstract = False | |
USERNAME_FIELD = 'email' | |
account_type = models.IntegerField(choices=ACCOUNT_TYPES, default=2) | |
first_name = models.CharField(max_length=30) | |
middle_names = models.CharField(max_length=30) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Environment: | |
Request Method: GET | |
Request URL: http://localhost:8000/profile/users/ | |
Django Version: 1.7.4 | |
Python Version: 3.4.2 | |
Installed Applications: | |
('django.contrib.admin', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"url": "https://api.localhost:8000/users/3/", | |
"first_name": "Steven ", | |
"last_name": "Konig", | |
"email": "[email protected]", | |
"profile-image": "https://fbcdn-profile-a.akamaihd.net/profile_picture.jpg", | |
"age": 36, | |
"profiles": { | |
"customer_profile_url": "https://api.localhost:8000/customers/3/", | |
"vendor_profile_url": "https://api.localhost:8000/vendors/3/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SearchBar = React.createClass({ | |
render: function() { | |
return ( | |
<div className="search-large-wrap"> | |
<div className="search-large-textfield-wrap"> | |
<input placeholder="Search For Existing Products" type="search" className="search-large-textfield" id="search-products"></input> | |
</div> | |
<div className="search-large-submit-wrap"> | |
<button type="button" className="search-large-submit" id="add-products" >Continue</button> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFunction() { | |
console.log("Hello World"); | |
} | |
var SearchBar = React.createClass({ | |
render: function() { | |
return ( | |
<button type="button" onClick= { myFunction() } >Continue</button> | |
); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ProductSearch = React.createClass({ | |
filterList: function(event){ | |
//debugger; | |
var updatedProducts = this.state.initialProducts; | |
updatedProducts = updatedProducts.filter(function(item){ | |
return item.name.toLowerCase().search(event.target.value.toLowerCase()) !== -1; | |
}); | |
this.setState({filteredProducts: updatedProducts}); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
React.render( | |
<MainViewContainer/>, | |
document.getElementById("main-area") | |
); | |
React.render( | |
<MainSideMenu/>, | |
document.getElementById("sidemenu-nav") | |
); |
OlderNewer